Project FORGE is engineered with a Security-First philosophy. Every autonomously generated codebase is audited against multi-vector static security scanners and dependency vulnerability databases before delivery.
[Project Specification]
β
βΌ
[Security-Aware Prompts]
β’ Strict typed input validation
β’ Parameterized SQL bindings (no string concatenation)
β’ Stack trace shielding on error responses
β’ Secure defaults & least privilege access
β’ CSRF & Security Headers (CSP, X-Frame-Options)
β
βΌ
[Generated Codebase]
β
βΌ
[OutputSecurityScanner]
(Runs BEFORE standard verification battery)
β
βββββββββββββββββββββ¬ββββββββββββββ΄ββββββββββββββ¬ββββββββββββββββββββ
βΌ βΌ βΌ βΌ
[Secrets Scan] [Dangerous AST] [Injection Checks] [CVE Dependency Scan]
β’ AWS / OpenAI β’ eval() / exec() β’ SQL f-strings β’ Local CVE DB match
β’ Private keys β’ os.system() β’ SQL concat β’ requirements.txt
β’ Database URIs β’ shell=True β’ DOM innerHTML β’ package.json
β’ Redacted logs β’ pickle.loads() β’ React dangerously β’ Auto-remediation
β
βΌ
[Severity Gating Engine]
β’ CRITICAL / HIGH βββΊ Blocks Delivery & Triggers Re-Synthesis
β’ MEDIUM / LOW βββΊ Documented in verification_manifest.json
| Severity | Definition | Delivery Impact | Action Required |
|---|---|---|---|
CRITICAL |
Direct remote code execution, SQL injection, exposed high-value private keys, or known critical CVEs. | π« BLOCKS DELIVERY | Must be remediated before completion. Triggers automatic re-synthesis attempt. |
HIGH |
Command injection risks, insecure deserialization (pickle), shell invocations, or missing authentication on state-changing endpoints. |
π« BLOCKS DELIVERY | Must be remediated before completion. |
MEDIUM |
Information disclosure (e.g. stack trace leaks), potential XSS vectors (dangerouslySetInnerHTML), unpinned dependencies. |
Documented as warnings in verification_manifest.json. |
|
LOW |
Informational security notices, recommended security headers, style warnings. | βΉοΈ INFORMATIONAL | Documented in manifest. |
- Patterns Detected: AWS access keys (
AKIA...), OpenAI API keys (sk-...), Anthropic tokens, GitHub PATs, RSA/OpenSSH private keys, plaintext database connection URIs with passwords, and generic password assignments. - Automatic Redaction: All evidence and log outputs automatically mask matched secrets with
***REDACTED***to prevent accidental credential leakage in reports.
- Python AST Inspection:
eval()andexec(): Flagged asCRITICAL.subprocess.*(..., shell=True): Flagged asCRITICAL.os.system(...): Flagged asHIGH.pickle.loads(...)on untrusted input: Flagged asHIGH.yaml.load(...)withoutLoader=SafeLoader: Flagged asHIGH.
- JavaScript AST Inspection:
- Dynamic
eval(): Flagged asCRITICAL. child_process.exec(): Flagged asHIGH.
- Dynamic
- SQL Injection:
- Detects f-strings in queries:
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}") - Detects string concatenation in queries:
cursor.execute("SELECT * FROM users WHERE name = '" + name + "'") - Detects string formatting
%or.format()in SQL.
- Detects f-strings in queries:
- Cross-Site Scripting (XSS):
- Detects unescaped assignments to
.innerHTML. - Detects React
dangerouslySetInnerHTMLusage.
- Detects unescaped assignments to
- Knowledge Base: Embedded database mapping popular packages (
urllib3,requests,flask,jinja2,pillow,pyyaml,cryptography,lodash,express,jsonwebtoken,axios) to published CVE IDs and safe patched versions. - Auto-Remediation: The engine automatically updates
requirements.txt/package.jsonto the secure patched version and produces verified lockfiles (requirements.lock,package-lock.json).
- Detects unauthenticated state-changing routes (
POST,PUT,DELETE) in administrative/management controllers. - Detects leaked stack traces (
traceback.format_exc()) in client error responses.
- Insecure:
API_KEY = "<REDACTED_SECRET_EXAMPLE>"
- Secure:
import os API_KEY = os.getenv("FORGE_API_KEY", "")
- Insecure:
cursor.execute(f"SELECT * FROM accounts WHERE username = '{username}'")
- Secure:
cursor.execute("SELECT * FROM accounts WHERE username = ?", (username,))
- Insecure:
result = eval(user_expression)
- Secure:
import ast result = ast.literal_eval(user_expression) # or json.loads()
- Insecure:
document.getElementById("user-bio").innerHTML = userInput;
- Secure:
document.getElementById("user-bio").textContent = userInput;
All security scan findings are included in verification_manifest.json:
{
"name": "[CRITICAL] SQL Injection Pattern (f-string)",
"category": "security",
"status": "fail",
"evidence": {
"file": "app/db.py",
"line": 42,
"snippet": "cursor.execute(f\"SELECT * FROM users WHERE id = {user_id}\")",
"description": "SQL query constructed via f-string interpolation rather than parameterized query."
},
"fix_suggestions": [
"Use parameterized query placeholders (?, %s, or :param) with parameter bindings tuple."
]
}Maintained by Project FORGE Engineering & Security Architecture.