forge-uploads: File uploads
Engine: Forge native
Purpose
Audit the complete upload, processing, storage, delivery, and deletion pipeline against hostile files.
Deterministic runtime composition
Before loading any provider procedure, run:
Resolve ../../runtime/cli/src/composition-entry.js relative to this SKILL.md, then run:
node "<resolved-absolute-runner-path>" uploads compose --workflow audit --root "<repository-root>" --dry-run --json
Add one repeatable --request <provider-or-source> flag for each explicit user request. Add
--condition <task-condition> or --risk-surface <surface> only for a task fact you directly
proved; never infer one from generic wording. The command above is the default for this
audit-oriented module; for implementation use --workflow build, and for a fix, retest, or
release gate use --workflow fix, verify, or ship respectively. Read the JSON response,
keep the Forge contract at index zero, and resolve paths against the absolute runtime_root
reported in that response. Read eager[].runtimePath when entering the module. The full
selected[] list is availability/provenance; load only deferred[].runtimePath when the task
reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported
suppression and context budget. If missing is non-empty, stop and report the installation as
damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin
cache or global installation; never assume they are inside the audited repository.
Resolve and read ../fullstack-forge/references/shared/module-contract.md (applicability,
execution, mutation, verification, completion) and
../fullstack-forge/references/shared/evidence-rules.md (statuses, standards, tools, findings via
../fullstack-forge/references/PROTOCOL.md) relative to this module SKILL.md before reporting.
Never hide failed checks or claim that an operation ran when it did not.
Automatic activation signals
Activate when a request or direct repository evidence involves file uploads, when
the user explicitly names forge-uploads, or when discovery proves an applicable boundary.
- Direct or presigned uploads
- Imports, attachments, avatars, media, and generated files
When not to activate
- Systems with no file ingestion or user-controlled object references
Automated support
Relevant discovery inputs are:
- upload routes
- storage configuration
- processors and download paths
Deterministic support, bounded evidence only:
Agent inspection procedure
- Map the complete pipeline: entry points, validation layers, processing steps, storage destinations, and delivery paths.
- Verify server-side validation order: authorization, then count and byte limits, then decoded content and signature checks — never extension or client MIME alone.
- Trace where bytes rest at each stage; verify private-by-default quarantine before scanning and that scanner errors or timeouts fail closed.
- Inspect object keys (server-generated, unguessable), tenant separation, signed-URL scope and expiry, and delivery headers (Content-Disposition, fixed Content-Type, nosniff).
- Exercise hostile inputs where a fixture suite exists: polyglots, oversized files, archive bombs, and traversal names; verify cleanup of temporary, abandoned, and replaced objects.
Manual inspection requirements:
- Review provider bucket policy and malware-scanner failure mode
- Exercise polyglot, oversized, malformed, duplicate, and unauthorized objects
Stack-specific guidance:
- Do not trust client MIME or original filenames; validate after streaming limits
Evidence to collect
Standards used as criteria:
- OWASP File Upload Cheat Sheet
- OWASP ASVS 5.0
Common production failures
- Trace authorization, filename normalization, extension and MIME allowlists, signature detection, size and count limits
- Inspect archive bombs, path traversal, parser isolation, malware scanning, image re-encoding, metadata stripping, and quarantine
- Verify private storage, random object names, signed URL scope/expiry, download headers, tenant boundaries, cleanup, and orphan handling
Missing-control checks
Each item needs direct evidence or one reasoned status.
- Server-side extension allowlists
- Browser accept attributes as hints rather than proof
- MIME validation
- Magic-byte validation
- File-signature validation
- Extension and MIME mismatches
- File-count limits
- Per-file size limits
- Total request limits
- Decompressed-size limits
- Image dimensions
- Image pixel counts
- PDF page counts
- Archive entry limits
- Parser bombs
- ZIP bombs
- Decompression bombs
- Malformed documents
- Polyglot files
- Quarantine storage
- Malware scanning before release
- Scanner timeout behavior
- Scanner failure behavior that fails closed
- Scanner metadata
- File hashes
- Rescanning policy
- Malware alerts
- Permanent quarantine
- Deletion policy
- Administrative handling
- No untrusted files in executable directories or public application folders
- Server-generated object keys
- Original filenames never used as paths
- Private-by-default object storage
- Short-lived signed URLs
- Tenant and environment separation
- Authorization before signed-URL generation
- Unguessable object identifiers
- Public-indexing prevention
- Active-content rendering prevention
- Image decode and re-encode
- EXIF stripping
- Image dimension and pixel limits
- Safe thumbnails
- SVG sanitization or rejection
- Remote SVG reference prevention
- Embedded script prevention
- PDF JavaScript
- PDF embedded files
- PDF launch actions
- Document external references
- Interactive forms
- Macros and Office active content
- Sandboxed parsers and parser resource limits
- Safe preview generation
- Document normalization
- Hostile extracted text
- No execution of embedded content
- Filename normalization
- Unicode trick detection
- Control characters
- Path traversal
- Safe Content-Disposition
- Fixed Content-Type and X-Content-Type-Options nosniff
- No reflected filenames in HTML
- Unsafe formats not rendered inline
- Per-user, per-IP, and per-tenant limits
- Storage quotas
- Concurrent-upload limits
- Repeated processing attacks
- Many-small-files attacks
- Resource timeouts
- Parser isolation
- Monitoring and cleanup
- Temporary-file and abandoned-upload cleanup
- Orphan detection and replacement cleanup
- Account and tenant deletion
- Retention and backup behavior
- Log and signed-URL redaction
- Encryption
Commands and tools
- Run
forge uploads audit --json or fullstack-forge uploads audit --json when
an explicit audit is requested and the CLI is installed. Normal feature work does not require it.
Safe fixes
- Add explicit size/count limits and safe content-disposition
- Normalize generated object names and log redaction
Approval-required changes
- Changing bucket visibility, accepted types, retention, or processing architecture
Verification
- Run a hostile-file fixture suite through the real pipeline
- Confirm rejected and quarantined files are neither served nor orphaned
Completion contract
Follow fullstack-forge/references/shared/completion.md and the limitations below.
Known limitations
- Scanner effectiveness and storage policy need direct service evidence
1---2name: forge-uploads-33description: Audit the complete upload, processing, storage, delivery, and deletion pipeline against hostile files.4---56# forge-uploads: File uploads78Engine: Forge native910## Purpose1112Audit the complete upload, processing, storage, delivery, and deletion pipeline against hostile files.131415## Deterministic runtime composition1617Before loading any provider procedure, run:1819Resolve `../../runtime/cli/src/composition-entry.js` relative to this `SKILL.md`, then run:2021`node "<resolved-absolute-runner-path>" uploads compose --workflow audit --root "<repository-root>" --dry-run --json`2223Add one repeatable `--request <provider-or-source>` flag for each explicit user request. Add24`--condition <task-condition>` or `--risk-surface <surface>` only for a task fact you directly25proved; never infer one from generic wording. The command above is the default for this26audit-oriented module; for implementation use `--workflow build`, and for a fix, retest, or27release gate use `--workflow fix`, `verify`, or `ship` respectively. Read the JSON response,28keep the Forge contract at index zero, and resolve paths against the absolute `runtime_root`29reported in that response. Read `eager[].runtimePath` when entering the module. The full30`selected[]` list is availability/provenance; load only `deferred[].runtimePath` when the task31reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported32suppression and context budget. If `missing` is non-empty, stop and report the installation as33damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin34cache or global installation; never assume they are inside the audited repository.353637Resolve and read `../fullstack-forge/references/shared/module-contract.md` (applicability,38execution, mutation, verification, completion) and39`../fullstack-forge/references/shared/evidence-rules.md` (statuses, standards, tools, findings via40`../fullstack-forge/references/PROTOCOL.md`) relative to this module `SKILL.md` before reporting.4142Never hide failed checks or claim that an operation ran when it did not.4344## Automatic activation signals4546Activate when a request or direct repository evidence involves file uploads, when47the user explicitly names `forge-uploads`, or when discovery proves an applicable boundary.4849- Direct or presigned uploads50- Imports, attachments, avatars, media, and generated files5152## When not to activate5354- Systems with no file ingestion or user-controlled object references5556## Automated support5758Relevant discovery inputs are:5960- upload routes61- storage configuration62- processors and download paths6364Deterministic support, bounded evidence only:6566- `inspect-upload-pipeline`6768## Agent inspection procedure69701. Map the complete pipeline: entry points, validation layers, processing steps, storage destinations, and delivery paths.712. Verify server-side validation order: authorization, then count and byte limits, then decoded content and signature checks — never extension or client MIME alone.723. Trace where bytes rest at each stage; verify private-by-default quarantine before scanning and that scanner errors or timeouts fail closed.734. Inspect object keys (server-generated, unguessable), tenant separation, signed-URL scope and expiry, and delivery headers (Content-Disposition, fixed Content-Type, nosniff).745. Exercise hostile inputs where a fixture suite exists: polyglots, oversized files, archive bombs, and traversal names; verify cleanup of temporary, abandoned, and replaced objects.7576Manual inspection requirements:7778- Review provider bucket policy and malware-scanner failure mode79- Exercise polyglot, oversized, malformed, duplicate, and unauthorized objects8081Stack-specific guidance:8283- Do not trust client MIME or original filenames; validate after streaming limits8485## Evidence to collect8687Standards used as criteria:8889- OWASP File Upload Cheat Sheet90- OWASP ASVS 5.09192## Common production failures9394- Trace authorization, filename normalization, extension and MIME allowlists, signature detection, size and count limits95- Inspect archive bombs, path traversal, parser isolation, malware scanning, image re-encoding, metadata stripping, and quarantine96- Verify private storage, random object names, signed URL scope/expiry, download headers, tenant boundaries, cleanup, and orphan handling9798## Missing-control checks99100Each item needs direct evidence or one reasoned status.101102- Server-side extension allowlists103- Browser accept attributes as hints rather than proof104- MIME validation105- Magic-byte validation106- File-signature validation107- Extension and MIME mismatches108- File-count limits109- Per-file size limits110- Total request limits111- Decompressed-size limits112- Image dimensions113- Image pixel counts114- PDF page counts115- Archive entry limits116- Parser bombs117- ZIP bombs118- Decompression bombs119- Malformed documents120- Polyglot files121- Quarantine storage122- Malware scanning before release123- Scanner timeout behavior124- Scanner failure behavior that fails closed125- Scanner metadata126- File hashes127- Rescanning policy128- Malware alerts129- Permanent quarantine130- Deletion policy131- Administrative handling132- No untrusted files in executable directories or public application folders133- Server-generated object keys134- Original filenames never used as paths135- Private-by-default object storage136- Short-lived signed URLs137- Tenant and environment separation138- Authorization before signed-URL generation139- Unguessable object identifiers140- Public-indexing prevention141- Active-content rendering prevention142- Image decode and re-encode143- EXIF stripping144- Image dimension and pixel limits145- Safe thumbnails146- SVG sanitization or rejection147- Remote SVG reference prevention148- Embedded script prevention149- PDF JavaScript150- PDF embedded files151- PDF launch actions152- Document external references153- Interactive forms154- Macros and Office active content155- Sandboxed parsers and parser resource limits156- Safe preview generation157- Document normalization158- Hostile extracted text159- No execution of embedded content160- Filename normalization161- Unicode trick detection162- Control characters163- Path traversal164- Safe Content-Disposition165- Fixed Content-Type and X-Content-Type-Options nosniff166- No reflected filenames in HTML167- Unsafe formats not rendered inline168- Per-user, per-IP, and per-tenant limits169- Storage quotas170- Concurrent-upload limits171- Repeated processing attacks172- Many-small-files attacks173- Resource timeouts174- Parser isolation175- Monitoring and cleanup176- Temporary-file and abandoned-upload cleanup177- Orphan detection and replacement cleanup178- Account and tenant deletion179- Retention and backup behavior180- Log and signed-URL redaction181- Encryption182183## Commands and tools184185- Run `forge uploads audit --json` or `fullstack-forge uploads audit --json` when186 an explicit audit is requested and the CLI is installed. Normal feature work does not require it.187188## Safe fixes189190- Add explicit size/count limits and safe content-disposition191- Normalize generated object names and log redaction192193## Approval-required changes194195- Changing bucket visibility, accepted types, retention, or processing architecture196197## Verification198199- Run a hostile-file fixture suite through the real pipeline200- Confirm rejected and quarantined files are neither served nor orphaned201202## Completion contract203204Follow `fullstack-forge/references/shared/completion.md` and the limitations below.205206## Known limitations207208- Scanner effectiveness and storage policy need direct service evidence