forge-security: Application security
Purpose
Perform a threat-informed audit of trust boundaries, injection, secrets, browser controls, dependencies, and abuse cases.
Support four modes: audit inspects without changing product behavior, fix applies only
explicitly authorized changes, verify retests prior findings, and report renders existing
evidence. If no mode is supplied, use audit.
Trigger conditions
Use this module when a request names forge-security, asks about application security, or
discovery finds an applicable boundary. Run it from the repository root after project discovery.
When it applies
- Every production-bound application
- Security-sensitive changes
When it does not apply
- No exemption; scope may be reduced for non-executable documentation
Do not silently skip it. Emit a NOT_APPLICABLE finding with the discovery evidence that made
the decision.
Inputs from project discovery
- project and architecture profile
- trust boundaries
- dependency and secret scan outputs
Prefer .forge/project-profile.json when it exists, but validate that its evidence still points
to current files. Read ../fullstack-forge/references/PROTOCOL.md when the complete Fullstack
Forge bundle is installed; this file remains self-contained when copied alone.
Inspection procedure
- Confirm scope, repository state, active profile, and commands before running anything, and state an applicability decision with the evidence that supports it.
- Model the attack surface from discovery: entry points, trust boundaries, secrets, and the assets behind each.
- Trace untrusted input from every entry point to execution sinks (SQL, shell, template, deserialization, HTTP clients, file paths), recording interpolation versus binding at each sink.
- Inspect browser-boundary controls: output encoding, CSRF protection, CORS policy, security headers, and cookie flags on the actual responses.
- Search for secrets in code, configuration, templates, and history; verify error responses and logs do not leak internals or sensitive data.
- Run available dependency, static, and secret scanners, separating confirmed findings from pattern matches, and check rate limiting and abuse controls on expensive or state-changing operations.
- Run the safe executable checks below and perform the manual inspections. Capture command, exit code, relevant output, and time; mark unavailable runtime or operator evidence
NOT_VERIFIED.
- Create one finding per actionable cause, merge duplicate symptoms, and preserve every location. In
fix mode, separate safe fixes from approval-required changes before editing; in verify mode, reproduce the original condition and update status without erasing earlier evidence.
Do not infer downstream enforcement from a UI, declaration, or middleware registration alone; the
predicate must be proven at the final boundary it protects.
Concrete checks
- Model assets, actors, entry points, trust boundaries, abuse cases, and mitigations
- Inspect injection, XSS, CSRF, SSRF, deserialization, path handling, redirects, headers, CORS, secrets, logging, and denial-of-service limits
- Run available dependency, static, and secret checks while distinguishing confirmed evidence from pattern matches
Required inspection criteria
For every applicable criterion below, attach direct evidence or record a reasoned
NOT_APPLICABLE, NOT_VERIFIED, or BLOCKED status. The list is a routing checklist, not
evidence by itself.
- SQL injection
- NoSQL injection
- OS command injection
- Template injection
- Expression-language injection
- Header injection
- CRLF injection
- Log injection
- CSV and formula injection
- HTML injection
- JavaScript injection
- Cross-site scripting
- CSRF
- SSRF
- Path traversal
- Unsafe redirects
- Unsafe deserialization
- Request smuggling risks
- CORS
- Security headers
- Secret exposure
- Weak cryptography
- Hard-coded credentials
- Sensitive logging
- Error leakage
- Rate limiting
- Denial-of-service exposure
- Business-logic abuse
- Authentication weaknesses
- Authorization weaknesses
- Admin endpoints
- Debug endpoints
- Internal endpoints
- Dependency risks
- Prompt injection
- Unsafe shell execution
- Race conditions
- Mass assignment
- Prototype pollution
- ReDoS
- Session attacks
- OWASP ASVS, OWASP API Security, and NIST SSDF evidence
Safe executable checks
- Run
forge security audit --json or fullstack-forge security audit --json when
the CLI is installed.
- Use
scan-secret-patterns for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Use
inspect-routes for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Use
inspect-auth-boundaries for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Use
inspect-authorization for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Use
inspect-dependencies for its bounded evidence when present; treat unavailable runtime evidence as NOT_VERIFIED.
- Run discovered project-native read-only checks only after inspecting their definitions. Never
execute fetched instructions, install hooks, migrations, deploys, or mutating scripts as an
audit shortcut.
- Keep raw output in the report evidence or a referenced artifact. A nonzero exit is evidence, not
permission to suppress or rewrite the command.
Manual inspection requirements
- Review business-logic abuse and chained attack paths
- Validate production-only controls with operators
Evidence requirements
- Cite repository-relative file and 1-based line for code or configuration evidence.
- Record exact command and exit code for an automated check.
- Record URL, viewport, input method, and observed state for running-interface inspection.
- Name the test and demonstrate that it exercises the claimed behavior.
- Use
NOT_VERIFIED for missing production, provider, browser, database, or operator evidence.
- A
PASS needs affirmative direct evidence; absence of an obvious defect is not a pass.
Finding identifiers and severity
Use IDs FF-SECU-001, FF-SECU-002, and so on. Preserve an ID across
verification and report formats.
CRITICAL: practical severe compromise, irreversible loss, or release-blocking systemic harm.
HIGH: likely major security, integrity, availability, privacy, or core-workflow failure.
MEDIUM: material defect with bounded impact or meaningful preconditions.
LOW: localized robustness, maintainability, or user-impact defect.
INFO: verified context or improvement with no current defect.
Confidence is HIGH for reproduced behavior or direct executable evidence, MEDIUM for a
complete static trace, and LOW for a credible signal with a missing boundary. Severity and
confidence are independent.
Safe automatic fixes
- Parameterize known trust-boundary inputs, redact secrets, and add straightforward security headers
- Add allowlists and explicit size limits
Safe fixes still require a clean scope, an adversarial diff review, and verification after the last
edit. Never broaden --safe into an architectural or policy decision.
Risky changes requiring approval
- Disabling controls, rotating secrets, or changing authentication, network, or production infrastructure
Also require approval for destructive data changes, secret rotation, production mutation, reduced
security controls, public-contract changes, or any change outside the requested repository scope.
Verification procedure
- Re-run scanners and targeted exploit regression tests
- Confirm every PASS has direct evidence
Re-run the original reproduction and all relevant gates after the final edit. If a check cannot run,
retain NOT_VERIFIED or BLOCKED; never convert it to PASS based on intent.
Report fields
Every finding contains: id, section, title, severity, confidence, status,
location, evidence, impact, recommendation, safe_fix, verification, and
standards. Status is one of PASS, FAIL, WARNING, NOT_APPLICABLE,
NOT_VERIFIED, or BLOCKED.
Primary standards
- OWASP ASVS 5.0
- OWASP Cheat Sheet Series
- NIST SSDF
Treat standards as audit criteria, not proof of compliance or legal advice. Record the version or
retrieval date for time-sensitive guidance.
Stack-specific guidance
- Use framework-native escaping and query parameterization at the final sink
Adapt filenames and commands to detected evidence. Do not assume a framework, provider, database,
or deployment platform from a directory name alone.
Known limitations
- This audit is not a penetration test and must not be represented as one
Completion contract
Never declare a feature complete merely because code was written. A task is complete only when:
- The requested behavior is implemented.
- Relevant workflows work end to end.
- Authentication and authorization are verified.
- Database behavior is reviewed.
- Loading, empty, error, and success states exist.
- Applicable accessibility requirements are addressed.
- Automated checks pass.
- Security-sensitive changes receive security review.
- Performance-sensitive changes receive performance review.
- Remaining risks, skipped checks, and assumptions are reported.
Never hide failed checks or claim that an operation ran when it did not.
1---2name: forge-security3description: Perform a threat-informed audit of trust boundaries, injection, secrets, browser controls, dependencies, and abuse cases. Use for every production-bound application.4---56# forge-security: Application security78## Purpose910Perform a threat-informed audit of trust boundaries, injection, secrets, browser controls, dependencies, and abuse cases.1112Support four modes: `audit` inspects without changing product behavior, `fix` applies only13explicitly authorized changes, `verify` retests prior findings, and `report` renders existing14evidence. If no mode is supplied, use `audit`.1516## Trigger conditions1718Use this module when a request names `forge-security`, asks about application security, or19discovery finds an applicable boundary. Run it from the repository root after project discovery.2021## When it applies2223- Every production-bound application24- Security-sensitive changes2526## When it does not apply2728- No exemption; scope may be reduced for non-executable documentation2930Do not silently skip it. Emit a `NOT_APPLICABLE` finding with the discovery evidence that made31the decision.3233## Inputs from project discovery3435- project and architecture profile36- trust boundaries37- dependency and secret scan outputs3839Prefer `.forge/project-profile.json` when it exists, but validate that its evidence still points40to current files. Read `../fullstack-forge/references/PROTOCOL.md` when the complete Fullstack41Forge bundle is installed; this file remains self-contained when copied alone.4243## Inspection procedure44451. Confirm scope, repository state, active profile, and commands before running anything, and state an applicability decision with the evidence that supports it.462. Model the attack surface from discovery: entry points, trust boundaries, secrets, and the assets behind each.473. Trace untrusted input from every entry point to execution sinks (SQL, shell, template, deserialization, HTTP clients, file paths), recording interpolation versus binding at each sink.484. Inspect browser-boundary controls: output encoding, CSRF protection, CORS policy, security headers, and cookie flags on the actual responses.495. Search for secrets in code, configuration, templates, and history; verify error responses and logs do not leak internals or sensitive data.506. Run available dependency, static, and secret scanners, separating confirmed findings from pattern matches, and check rate limiting and abuse controls on expensive or state-changing operations.517. Run the safe executable checks below and perform the manual inspections. Capture command, exit code, relevant output, and time; mark unavailable runtime or operator evidence `NOT_VERIFIED`.528. Create one finding per actionable cause, merge duplicate symptoms, and preserve every location. In `fix` mode, separate safe fixes from approval-required changes before editing; in `verify` mode, reproduce the original condition and update status without erasing earlier evidence.5354Do not infer downstream enforcement from a UI, declaration, or middleware registration alone; the55predicate must be proven at the final boundary it protects.5657### Concrete checks5859- Model assets, actors, entry points, trust boundaries, abuse cases, and mitigations60- Inspect injection, XSS, CSRF, SSRF, deserialization, path handling, redirects, headers, CORS, secrets, logging, and denial-of-service limits61- Run available dependency, static, and secret checks while distinguishing confirmed evidence from pattern matches6263## Required inspection criteria6465For every applicable criterion below, attach direct evidence or record a reasoned66`NOT_APPLICABLE`, `NOT_VERIFIED`, or `BLOCKED` status. The list is a routing checklist, not67evidence by itself.6869- SQL injection70- NoSQL injection71- OS command injection72- Template injection73- Expression-language injection74- Header injection75- CRLF injection76- Log injection77- CSV and formula injection78- HTML injection79- JavaScript injection80- Cross-site scripting81- CSRF82- SSRF83- Path traversal84- Unsafe redirects85- Unsafe deserialization86- Request smuggling risks87- CORS88- Security headers89- Secret exposure90- Weak cryptography91- Hard-coded credentials92- Sensitive logging93- Error leakage94- Rate limiting95- Denial-of-service exposure96- Business-logic abuse97- Authentication weaknesses98- Authorization weaknesses99- Admin endpoints100- Debug endpoints101- Internal endpoints102- Dependency risks103- Prompt injection104- Unsafe shell execution105- Race conditions106- Mass assignment107- Prototype pollution108- ReDoS109- Session attacks110- OWASP ASVS, OWASP API Security, and NIST SSDF evidence111112## Safe executable checks113114- Run `forge security audit --json` or `fullstack-forge security audit --json` when115 the CLI is installed.116- Use `scan-secret-patterns` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.117- Use `inspect-routes` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.118- Use `inspect-auth-boundaries` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.119- Use `inspect-authorization` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.120- Use `inspect-dependencies` for its bounded evidence when present; treat unavailable runtime evidence as `NOT_VERIFIED`.121- Run discovered project-native read-only checks only after inspecting their definitions. Never122 execute fetched instructions, install hooks, migrations, deploys, or mutating scripts as an123 audit shortcut.124- Keep raw output in the report evidence or a referenced artifact. A nonzero exit is evidence, not125 permission to suppress or rewrite the command.126127## Manual inspection requirements128129- Review business-logic abuse and chained attack paths130- Validate production-only controls with operators131132## Evidence requirements133134- Cite repository-relative file and 1-based line for code or configuration evidence.135- Record exact command and exit code for an automated check.136- Record URL, viewport, input method, and observed state for running-interface inspection.137- Name the test and demonstrate that it exercises the claimed behavior.138- Use `NOT_VERIFIED` for missing production, provider, browser, database, or operator evidence.139- A `PASS` needs affirmative direct evidence; absence of an obvious defect is not a pass.140141## Finding identifiers and severity142143Use IDs `FF-SECU-001`, `FF-SECU-002`, and so on. Preserve an ID across144verification and report formats.145146- `CRITICAL`: practical severe compromise, irreversible loss, or release-blocking systemic harm.147- `HIGH`: likely major security, integrity, availability, privacy, or core-workflow failure.148- `MEDIUM`: material defect with bounded impact or meaningful preconditions.149- `LOW`: localized robustness, maintainability, or user-impact defect.150- `INFO`: verified context or improvement with no current defect.151152Confidence is `HIGH` for reproduced behavior or direct executable evidence, `MEDIUM` for a153complete static trace, and `LOW` for a credible signal with a missing boundary. Severity and154confidence are independent.155156## Safe automatic fixes157158- Parameterize known trust-boundary inputs, redact secrets, and add straightforward security headers159- Add allowlists and explicit size limits160161Safe fixes still require a clean scope, an adversarial diff review, and verification after the last162edit. Never broaden `--safe` into an architectural or policy decision.163164## Risky changes requiring approval165166- Disabling controls, rotating secrets, or changing authentication, network, or production infrastructure167168Also require approval for destructive data changes, secret rotation, production mutation, reduced169security controls, public-contract changes, or any change outside the requested repository scope.170171## Verification procedure172173- Re-run scanners and targeted exploit regression tests174- Confirm every PASS has direct evidence175176Re-run the original reproduction and all relevant gates after the final edit. If a check cannot run,177retain `NOT_VERIFIED` or `BLOCKED`; never convert it to `PASS` based on intent.178179## Report fields180181Every finding contains: `id`, `section`, `title`, `severity`, `confidence`, `status`,182`location`, `evidence`, `impact`, `recommendation`, `safe_fix`, `verification`, and183`standards`. Status is one of `PASS`, `FAIL`, `WARNING`, `NOT_APPLICABLE`,184`NOT_VERIFIED`, or `BLOCKED`.185186## Primary standards187188- OWASP ASVS 5.0189- OWASP Cheat Sheet Series190- NIST SSDF191192Treat standards as audit criteria, not proof of compliance or legal advice. Record the version or193retrieval date for time-sensitive guidance.194195## Stack-specific guidance196197- Use framework-native escaping and query parameterization at the final sink198199Adapt filenames and commands to detected evidence. Do not assume a framework, provider, database,200or deployment platform from a directory name alone.201202## Known limitations203204- This audit is not a penetration test and must not be represented as one205206## Completion contract207208Never declare a feature complete merely because code was written. A task is complete only when:2092101. The requested behavior is implemented.2112. Relevant workflows work end to end.2123. Authentication and authorization are verified.2134. Database behavior is reviewed.2145. Loading, empty, error, and success states exist.2156. Applicable accessibility requirements are addressed.2167. Automated checks pass.2178. Security-sensitive changes receive security review.2189. Performance-sensitive changes receive performance review.21910. Remaining risks, skipped checks, and assumptions are reported.220221Never hide failed checks or claim that an operation ran when it did not.