torusguard 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.torusguard/runs/report-latest.html +3 -3
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-115-9a059e/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-115-9a059e/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-115-9a059e/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-119-61557c/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-119-61557c/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-119-61557c/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-265-996ca3/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-265-996ca3/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-265-996ca3/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-503-d11cf8/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-503-d11cf8/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-503-d11cf8/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-79-91f41f/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-79-91f41f/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-db-004-79-91f41f/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-107-516a40/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-107-516a40/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-107-516a40/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-128-7809a1/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-128-7809a1/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-128-7809a1/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-256-c8a22e/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-256-c8a22e/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-002-256-c8a22e/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-003-53-d167b4/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-003-53-d167b4/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-input-003-53-d167b4/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-platform-001-183-47fd5e/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-platform-001-183-47fd5e/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-platform-001-183-47fd5e/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-209-4f6424/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-209-4f6424/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-209-4f6424/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-257-89bf34/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-257-89bf34/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-257-89bf34/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-341-ce228c/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-341-ce228c/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-341-ce228c/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-355-7b190b/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-355-7b190b/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-355-7b190b/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-64-5af31a/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-64-5af31a/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-64-5af31a/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-9-f51467/metadata.json +15 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-9-f51467/minimal_patch_plan.md +21 -0
- package/.torusguard/runs/run-20260910-120238-audit/bundles/bnd-tg-sec-001-9-f51467/patch.diff +9 -0
- package/.torusguard/runs/run-20260910-120238-audit/findings.json +1520 -0
- package/.torusguard/runs/run-20260910-120238-audit/findings.md +560 -0
- package/.torusguard/runs/run-20260910-120238-audit/manifest.json +13 -0
- package/.torusguard/runs/run-20260910-120238-audit/recheck.md +86 -0
- package/.torusguard/runs/run-20260910-120238-audit/remediation.md +262 -0
- package/.torusguard/runs/run-20260910-120238-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260910-121238-audit/findings.json +794 -0
- package/.torusguard/runs/run-20260910-121238-audit/findings.md +344 -0
- package/.torusguard/runs/run-20260910-121238-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260910-121238-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260910-130454-audit/findings.json +893 -0
- package/.torusguard/runs/run-20260910-130454-audit/findings.md +386 -0
- package/.torusguard/runs/run-20260910-130454-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260910-130454-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260910-130519-audit/findings.json +563 -0
- package/.torusguard/runs/run-20260910-130519-audit/findings.md +246 -0
- package/.torusguard/runs/run-20260910-130519-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260910-130519-audit/summary.md +5 -0
- package/.torusguard/scripts/__pycache__/audit_runner.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/diff_guard.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/html_reporter.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/rules_sync.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/stack_detect.cpython-311.pyc +0 -0
- package/.torusguard/scripts/__pycache__/term_ui.cpython-311.pyc +0 -0
- package/.torusguard/scripts/apply_runner.py +138 -100
- package/.torusguard/scripts/audit_runner.py +219 -116
- package/.torusguard/scripts/harden_runner.py +144 -64
- package/.torusguard/scripts/recheck_runner.py +80 -63
- package/.torusguard/scripts/recipes_runner.py +38 -31
- package/.torusguard/scripts/term_ui.py +162 -0
- package/.torusguard/skills/torusguard/SKILL.md +61 -31
- package/.torusguard/skills/torusguard-apply/SKILL.md +80 -46
- package/.torusguard/skills/torusguard-audit/SKILL.md +83 -70
- package/.torusguard/skills/torusguard-authorize/SKILL.md +5 -4
- package/.torusguard/skills/torusguard-exploit-check/SKILL.md +6 -5
- package/.torusguard/skills/torusguard-full/SKILL.md +1 -1
- package/.torusguard/skills/torusguard-harden/SKILL.md +94 -63
- package/.torusguard/skills/torusguard-init/SKILL.md +64 -52
- package/.torusguard/skills/torusguard-recheck/SKILL.md +77 -53
- package/.torusguard/skills/torusguard-report/SKILL.md +72 -54
- package/.torusguard/skills/torusguard-status/SKILL.md +58 -42
- package/.torusguard/skills/torusguard-verify/SKILL.md +8 -7
- package/.torusguard/skills/torusguard-web-validate/SKILL.md +8 -7
- package/README.md +4 -3
- package/bin/torusguard.js +544 -437
- package/package.json +1 -1
- package/skills/torusguard/SKILL.md +61 -31
- package/skills/torusguard/payload/scripts/apply_runner.py +138 -100
- package/skills/torusguard/payload/scripts/audit_runner.py +219 -116
- package/skills/torusguard/payload/scripts/harden_runner.py +144 -64
- package/skills/torusguard/payload/scripts/recheck_runner.py +80 -63
- package/skills/torusguard/payload/scripts/recipes_runner.py +38 -31
- package/skills/torusguard/payload/scripts/term_ui.py +162 -0
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +61 -31
- package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +80 -46
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +83 -70
- package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +5 -4
- package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +6 -5
- package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +94 -63
- package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +64 -52
- package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +77 -53
- package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +72 -54
- package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +58 -42
- package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +8 -7
- package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +8 -7
- package/skills/torusguard-apply/SKILL.md +80 -48
- package/skills/torusguard-audit/SKILL.md +83 -75
- package/skills/torusguard-authorize/SKILL.md +1 -1
- package/skills/torusguard-exploit-check/SKILL.md +1 -1
- package/skills/torusguard-full/SKILL.md +1 -1
- package/skills/torusguard-harden/SKILL.md +94 -67
- package/skills/torusguard-init/SKILL.md +64 -53
- package/skills/torusguard-recheck/SKILL.md +77 -54
- package/skills/torusguard-report/SKILL.md +72 -55
- package/skills/torusguard-status/SKILL.md +58 -43
- package/skills/torusguard-verify/SKILL.md +1 -1
- package/skills/torusguard-web-validate/SKILL.md +1 -1
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
# TorusGuard Static Security Audit Report
|
|
2
|
+
**Run ID:** `run-20260910-120238-audit`
|
|
3
|
+
**Timestamp:** `2026-09-10 12:02:38 IST`
|
|
4
|
+
**Target:** `C:\Users\Admin\Desktop\TorusGuard`
|
|
5
|
+
**Total Findings:** `46`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
## Findings Catalog
|
|
9
|
+
|
|
10
|
+
### [TG-INPUT-003] Unsafe Dynamic Code or HTML Execution
|
|
11
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
12
|
+
- **File:** `examples/vulnerable-react-express/client/src/App.jsx:53` | **Cluster:** `cluster-injection`
|
|
13
|
+
- **Description:** React dangerouslySetInnerHTML rendering raw unescaped HTML
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
{/* TG-INPUT-003: Unsafe HTML rendering */}
|
|
17
|
+
<div dangerouslySetInnerHTML={{ __html: bio }} />
|
|
18
|
+
|
|
19
|
+
<button onClick={fetchUser}>Fetch user (IDOR demo)</button>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
23
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
24
|
+
- **File:** `examples/vulnerable-react-express/server/index.js:9` | **Cluster:** `cluster-credentials-exposure`
|
|
25
|
+
- **Description:** Hardcoded JWT signing secret
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
// TG-SEC-001: Hardcoded JWT secret
|
|
29
|
+
const JWT_SECRET = 'FAKE_DEMO_JWT_SECRET_NOT_FOR_PRODUCTION';
|
|
30
|
+
|
|
31
|
+
// TG-PLATFORM-001: Wildcard CORS with credentials
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
35
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
36
|
+
- **File:** `examples/vulnerable-react-express/server/index.js:18` | **Cluster:** `cluster-credentials-exposure`
|
|
37
|
+
- **Description:** Hardcoded credential or API secret string
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
const users = [
|
|
41
|
+
{ id: '1', email: 'alice@demo.local', password: 'password123', name: 'Alice' },
|
|
42
|
+
{ id: '2', email: 'bob@demo.local', password: 'secret456', name: 'Bob' },
|
|
43
|
+
];
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
47
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
48
|
+
- **File:** `harness/engine/fixture_manager.py:224` | **Cluster:** `cluster-tenant-isolation`
|
|
49
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
50
|
+
```
|
|
51
|
+
vulnerable_variant=FixtureVariant(
|
|
52
|
+
relative_path="examples/python/django-vuln",
|
|
53
|
+
code_pattern="tenant_id = request.headers.get('X-Tenant-ID')\nrecord = Invoice.objects.get(id=invoice_id)",
|
|
54
|
+
expected_findings_count=2,
|
|
55
|
+
),
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
59
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
60
|
+
- **File:** `harness/engine/fixture_manager.py:128` | **Cluster:** `cluster-injection`
|
|
61
|
+
- **Description:** Python f-string interpolation in raw SQL query
|
|
62
|
+
```
|
|
63
|
+
vulnerable_variant=FixtureVariant(
|
|
64
|
+
relative_path="examples/python/sqlalchemy-vuln",
|
|
65
|
+
code_pattern="session.execute(f'SELECT * FROM items WHERE name LIKE {q}')",
|
|
66
|
+
expected_findings_count=4,
|
|
67
|
+
),
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
71
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
72
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:107` | **Cluster:** `cluster-auth-bypass`
|
|
73
|
+
- **Description:** Session cookie secure flag disabled in Django settings
|
|
74
|
+
```
|
|
75
|
+
"expected_orm": "SQLAlchemy",
|
|
76
|
+
"ecosystem": "Python",
|
|
77
|
+
"test_bypass": ("python", "SESSION_COOKIE_SECURE = False", "auth_bypass"),
|
|
78
|
+
"test_tenant": ("python", "tenant_id"),
|
|
79
|
+
},
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
83
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
84
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:96` | **Cluster:** `cluster-auth-bypass`
|
|
85
|
+
- **Description:** Decorator disabling route-level authentication or CSRF protection
|
|
86
|
+
```
|
|
87
|
+
"expected_orm": "Django ORM",
|
|
88
|
+
"ecosystem": "Python",
|
|
89
|
+
"test_bypass": ("python", "@csrf_exempt", "auth_bypass"),
|
|
90
|
+
"test_tenant": ("python", "tenant"),
|
|
91
|
+
},
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
95
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
96
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:239` | **Cluster:** `cluster-auth-bypass`
|
|
97
|
+
- **Description:** Attribute disabling ASP.NET authentication
|
|
98
|
+
```
|
|
99
|
+
"expected_orm": "Entity Framework Core",
|
|
100
|
+
"ecosystem": "C#",
|
|
101
|
+
"test_bypass": ("csharp", "[AllowAnonymous]", "auth_bypass"),
|
|
102
|
+
"test_tenant": ("csharp", ".Where(x => x.TenantId == tenantId)"),
|
|
103
|
+
},
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
107
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
108
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:74` | **Cluster:** `cluster-transport-security`
|
|
109
|
+
- **Description:** Disabled TLS certificate verification (verify=False)
|
|
110
|
+
```
|
|
111
|
+
"expected_orm": "SQLAlchemy",
|
|
112
|
+
"ecosystem": "Python",
|
|
113
|
+
"test_bypass": ("python", "verify=False", "auth_bypass"),
|
|
114
|
+
"test_tenant": ("python", "tenant_id"),
|
|
115
|
+
},
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
119
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
120
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:151` | **Cluster:** `cluster-transport-security`
|
|
121
|
+
- **Description:** Disabled Go TLS certificate verification (InsecureSkipVerify: true)
|
|
122
|
+
```
|
|
123
|
+
"expected_orm": "GORM",
|
|
124
|
+
"ecosystem": "Go",
|
|
125
|
+
"test_bypass": ("go", "InsecureSkipVerify: true", "tls_bypass"),
|
|
126
|
+
"test_tenant": ("go", '.Where("tenant_id = ?", tenantID)'),
|
|
127
|
+
},
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
131
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
132
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:129` | **Cluster:** `cluster-transport-security`
|
|
133
|
+
- **Description:** Disabled Node.js TLS rejectUnauthorized
|
|
134
|
+
```
|
|
135
|
+
"expected_orm": "Mongoose",
|
|
136
|
+
"ecosystem": "JavaScript",
|
|
137
|
+
"test_bypass": ("javascript", "rejectUnauthorized: false", "tls_bypass"),
|
|
138
|
+
"test_tenant": ("javascript", "author: req.user.id"),
|
|
139
|
+
},
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
143
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
144
|
+
- **File:** `harness/evaluate_portfolio_polyglot.py:261` | **Cluster:** `cluster-transport-security`
|
|
145
|
+
- **Description:** Disabled PHP curl SSL verification
|
|
146
|
+
```
|
|
147
|
+
"expected_orm": "Eloquent",
|
|
148
|
+
"ecosystem": "PHP",
|
|
149
|
+
"test_bypass": ("php", "CURLOPT_SSL_VERIFYPEER => false", "tls_bypass"),
|
|
150
|
+
"test_tenant": ("php", 'where("tenant_id", $tenantId)'),
|
|
151
|
+
},
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
155
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
156
|
+
- **File:** `harness/master_validation.py:257` | **Cluster:** `cluster-credentials-exposure`
|
|
157
|
+
- **Description:** Hardcoded credential or API secret string
|
|
158
|
+
```
|
|
159
|
+
self.log("Redaction", "JWT Token Redaction", "Bearer ***REDACTED_JWT***" in masked_jwt and "doNotLeakSignature" not in masked_jwt)
|
|
160
|
+
|
|
161
|
+
masked_pwd = mask_sensitive_data("DB_PASSWORD = 'super_secret_database_password_123'")
|
|
162
|
+
self.log("Redaction", "Password Variable Redaction", "***REDACTED***" in masked_pwd and "super_secret_database_password_123" not in masked_pwd)
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
167
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
168
|
+
- **File:** `harness/runner.py:209` | **Cluster:** `cluster-credentials-exposure`
|
|
169
|
+
- **Description:** Hardcoded credential or API secret string
|
|
170
|
+
```
|
|
171
|
+
type=EvidenceType.SOURCE,
|
|
172
|
+
location="server/auth.py:42",
|
|
173
|
+
raw_snippet="SECRET_KEY = 'super_secret_jwt_key'",
|
|
174
|
+
rationale="Hardcoded secret credential.",
|
|
175
|
+
confidence_level=ConfidenceBand.CONFIRMED,
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
179
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
180
|
+
- **File:** `harness/runner.py:503` | **Cluster:** `cluster-tenant-isolation`
|
|
181
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
# 2. Stable Finding Identity
|
|
185
|
+
code_a = "def view():\n return Item.objects.get(id=id)"
|
|
186
|
+
code_b = "# Shifted comment\ndef view():\n return Item.objects.get(id=id)"
|
|
187
|
+
fp1 = IdentityEngine.generate_identity("TG-DB-004", "views.py", code_a, sink_signature="Item.objects.get")
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
191
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
192
|
+
- **File:** `harness/runner.py:256` | **Cluster:** `cluster-injection`
|
|
193
|
+
- **Description:** Python f-string interpolation in raw SQL query
|
|
194
|
+
```
|
|
195
|
+
framework_pattern=FrameworkPattern(
|
|
196
|
+
framework="Django",
|
|
197
|
+
unsafe_snippet="User.objects.raw(f'SELECT * FROM users WHERE name = {name}')",
|
|
198
|
+
safe_snippet="User.objects.raw('SELECT * FROM users WHERE name = %s', [name])",
|
|
199
|
+
),
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
203
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
204
|
+
- **File:** `harness/validate_e2e.py:355` | **Cluster:** `cluster-credentials-exposure`
|
|
205
|
+
- **Description:** Hardcoded credential or API secret string
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
def _create_sample_finding(self, rule_id: str, target_path: str, secret_test: bool = False) -> Finding:
|
|
209
|
+
raw_code = "API_KEY = 'sk_live_998877665544332211'\nAuthorization = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.doNotLeakSignature'" if secret_test else f"# Unsafe logic for {rule_id}\nrole = request.headers.get('X-User-Role')"
|
|
210
|
+
|
|
211
|
+
ev = Evidence(
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
215
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
216
|
+
- **File:** `harness/validate_qa_v0_6_0.py:64` | **Cluster:** `cluster-credentials-exposure`
|
|
217
|
+
- **Description:** Hardcoded credential or API secret string
|
|
218
|
+
```
|
|
219
|
+
"tiny-repo": {
|
|
220
|
+
"vulnerable": {
|
|
221
|
+
"app.py": 'DEBUG = True\nSECRET_KEY = "sk_live_1234567890"\n\ndef index():\n return "Welcome"\n'
|
|
222
|
+
},
|
|
223
|
+
"hardened": {
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
227
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
228
|
+
- **File:** `harness/validate_qa_v0_6_0.py:101` | **Cluster:** `cluster-tenant-isolation`
|
|
229
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
230
|
+
```
|
|
231
|
+
"django-app": {
|
|
232
|
+
"vulnerable": {
|
|
233
|
+
"views.py": 'from django.shortcuts import render\nfrom django.utils.safestring import mark_safe\nfrom .models import Invoice\n\ndef invoice_detail(request, invoice_id):\n # IDOR Vulnerability: Missing tenant filter\n invoice = Invoice.objects.get(id=invoice_id)\n # Template autoescaping bypass\n rendered = mark_safe(f"<h1>{invoice.title}</h1>")\n return render(request, "detail.html", {"content": rendered})\n',
|
|
234
|
+
"models.py": 'from django.db import models\n\nclass Invoice(models.Model):\n title = models.CharField(max_length=200)\n tenant_id = models.CharField(max_length=50)\n'
|
|
235
|
+
},
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
239
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
240
|
+
- **File:** `harness/validate_v0_6_1_scale.py:115` | **Cluster:** `cluster-tenant-isolation`
|
|
241
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
242
|
+
```
|
|
243
|
+
"severity": "High",
|
|
244
|
+
"target": {"file_path": "apps/django_core/billing/views.py", "line_start": 42, "line_end": 42},
|
|
245
|
+
"evidence": {"code_snippet": "Invoice.objects.get(id=inv_id)"},
|
|
246
|
+
},
|
|
247
|
+
# FastAPI Microservice
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
251
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
252
|
+
- **File:** `harness/validate_v0_6_2_modern_stacks.py:341` | **Cluster:** `cluster-credentials-exposure`
|
|
253
|
+
- **Description:** Hardcoded credential or API secret string
|
|
254
|
+
```
|
|
255
|
+
COPY . .
|
|
256
|
+
# Running as root user & hardcoding secrets
|
|
257
|
+
ENV DATABASE_PASSWORD="secret_in_docker"
|
|
258
|
+
CMD ["python", "main.py"]
|
|
259
|
+
""", encoding="utf-8")
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
263
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
264
|
+
- **File:** `harness/validate_v0_6_3_hardening.py:119` | **Cluster:** `cluster-tenant-isolation`
|
|
265
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
266
|
+
```
|
|
267
|
+
snippet_v1 = """def process_invoice(req, inv_id):
|
|
268
|
+
# Retrieve invoice
|
|
269
|
+
inv = Invoice.objects.get(id=inv_id)
|
|
270
|
+
return inv
|
|
271
|
+
"""
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
275
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
276
|
+
- **File:** `harness/validate_v0_9_2_diff_and_monorepo.py:58` | **Cluster:** `cluster-transport-security`
|
|
277
|
+
- **Description:** Disabled TLS certificate verification (verify=False)
|
|
278
|
+
```
|
|
279
|
+
def authenticate_user(token):
|
|
280
|
+
+ # TODO: bypass auth check for debugging
|
|
281
|
+
+ verify = False
|
|
282
|
+
return True
|
|
283
|
+
"""
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
287
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
288
|
+
- **File:** `harness/validate_v1_0_0_memory.py:265` | **Cluster:** `cluster-tenant-isolation`
|
|
289
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
290
|
+
```
|
|
291
|
+
- return Bill.objects.filter(id=id, tenant=tenant)
|
|
292
|
+
+def get_bill(id):
|
|
293
|
+
+ return Bill.objects.get(id=id)
|
|
294
|
+
"""
|
|
295
|
+
res_reg = diff_guard.audit_diff(regression_diff, check_memory=True, root_dir=test_root)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
299
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
300
|
+
- **File:** `harness/validate_v1_1_0_advanced_memory.py:107` | **Cluster:** `cluster-injection`
|
|
301
|
+
- **Description:** Python f-string interpolation in raw SQL query
|
|
302
|
+
```
|
|
303
|
+
memory_engine.ensure_memory_structure(root_dir=test_root)
|
|
304
|
+
|
|
305
|
+
valid_before = "cursor.execute(f'SELECT * FROM users WHERE id = {uid}')"
|
|
306
|
+
valid_after = "cursor.execute('SELECT * FROM users WHERE id = %s', (uid,))"
|
|
307
|
+
valid_diff = "- cursor.execute(f'SELECT * FROM users WHERE id = {uid}')\n+ cursor.execute('SELECT * FROM users WHERE id = %s', (uid,))"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
311
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
312
|
+
- **File:** `harness/validate_v1_3_0_polyglot.py:18` | **Cluster:** `cluster-auth-bypass`
|
|
313
|
+
- **Description:** Attribute disabling ASP.NET authentication
|
|
314
|
+
```
|
|
315
|
+
- Go (InsecureSkipVerify: true)
|
|
316
|
+
- Java (csrf().disable())
|
|
317
|
+
- C# ([AllowAnonymous])
|
|
318
|
+
- PHP (CURLOPT_SSL_VERIFYPEER => false)
|
|
319
|
+
- Rust (unsafe { ... })
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
323
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
324
|
+
- **File:** `harness/validate_v1_3_0_polyglot.py:193` | **Cluster:** `cluster-auth-bypass`
|
|
325
|
+
- **Description:** Spring Security CSRF protection explicitly disabled
|
|
326
|
+
```
|
|
327
|
+
+++ b/SecurityConfig.java
|
|
328
|
+
@@ -20,3 +20,4 @@
|
|
329
|
+
+ http.csrf().disable();
|
|
330
|
+
"""
|
|
331
|
+
viol_java = diff_guard.check_diff_content(diff_java, "SecurityConfig.java")
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
335
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
336
|
+
- **File:** `harness/validate_v1_3_0_polyglot.py:16` | **Cluster:** `cluster-transport-security`
|
|
337
|
+
- **Description:** Disabled Go TLS certificate verification (InsecureSkipVerify: true)
|
|
338
|
+
```
|
|
339
|
+
- File extension census fallback (no manifest)
|
|
340
|
+
2. Polyglot Diff Guard bypass detection across:
|
|
341
|
+
- Go (InsecureSkipVerify: true)
|
|
342
|
+
- Java (csrf().disable())
|
|
343
|
+
- C# ([AllowAnonymous])
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
347
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
348
|
+
- **File:** `harness/validate_v1_3_0_polyglot.py:19` | **Cluster:** `cluster-transport-security`
|
|
349
|
+
- **Description:** Disabled PHP curl SSL verification
|
|
350
|
+
```
|
|
351
|
+
- Java (csrf().disable())
|
|
352
|
+
- C# ([AllowAnonymous])
|
|
353
|
+
- PHP (CURLOPT_SSL_VERIFYPEER => false)
|
|
354
|
+
- Rust (unsafe { ... })
|
|
355
|
+
3. Polyglot Tenant Scoping Patterns across GORM, LINQ, and Prisma
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### [TG-INPUT-003] Unsafe Dynamic Code or HTML Execution
|
|
359
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
360
|
+
- **File:** `skills/torusguard/payload/scripts/audit_runner.py:155` | **Cluster:** `cluster-injection`
|
|
361
|
+
- **Description:** Direct eval() execution on untrusted input
|
|
362
|
+
```
|
|
363
|
+
"cluster": "cluster-injection",
|
|
364
|
+
"patterns": [
|
|
365
|
+
(re.compile(r'\beval\s*\('), "Direct eval() execution on untrusted input"),
|
|
366
|
+
(re.compile(r'\bexec\s*\('), "Direct exec() execution on untrusted input"),
|
|
367
|
+
(re.compile(r'\bdangerouslySetInnerHTML\s*='), "React dangerouslySetInnerHTML rendering raw unescaped HTML"),
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### [TG-INPUT-003] Unsafe Dynamic Code or HTML Execution
|
|
371
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
372
|
+
- **File:** `skills/torusguard/payload/scripts/audit_runner.py:156` | **Cluster:** `cluster-injection`
|
|
373
|
+
- **Description:** Direct exec() execution on untrusted input
|
|
374
|
+
```
|
|
375
|
+
"patterns": [
|
|
376
|
+
(re.compile(r'\beval\s*\('), "Direct eval() execution on untrusted input"),
|
|
377
|
+
(re.compile(r'\bexec\s*\('), "Direct exec() execution on untrusted input"),
|
|
378
|
+
(re.compile(r'\bdangerouslySetInnerHTML\s*='), "React dangerouslySetInnerHTML rendering raw unescaped HTML"),
|
|
379
|
+
(re.compile(r'\.innerHTML\s*='), "Direct DOM innerHTML assignment vulnerable to XSS")
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
383
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
384
|
+
- **File:** `skills/torusguard/payload/scripts/audit_runner.py:195` | **Cluster:** `cluster-transport-security`
|
|
385
|
+
- **Description:** Disabled TLS certificate verification (verify=False)
|
|
386
|
+
```
|
|
387
|
+
"cluster": "cluster-transport-security",
|
|
388
|
+
"patterns": [
|
|
389
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
390
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
391
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
395
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
396
|
+
- **File:** `skills/torusguard/payload/scripts/audit_runner.py:196` | **Cluster:** `cluster-transport-security`
|
|
397
|
+
- **Description:** Disabled Go TLS certificate verification (InsecureSkipVerify: true)
|
|
398
|
+
```
|
|
399
|
+
"patterns": [
|
|
400
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
401
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
402
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
403
|
+
(re.compile(r'\brejectUnauthorized\s*:\s*false\b'), "Disabled Node.js TLS rejectUnauthorized"),
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
407
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
408
|
+
- **File:** `skills/torusguard/payload/scripts/audit_runner.py:197` | **Cluster:** `cluster-transport-security`
|
|
409
|
+
- **Description:** Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)
|
|
410
|
+
```
|
|
411
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
412
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
413
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
414
|
+
(re.compile(r'\brejectUnauthorized\s*:\s*false\b'), "Disabled Node.js TLS rejectUnauthorized"),
|
|
415
|
+
(re.compile(r'\bCURLOPT_SSL_VERIFYPEER\s*(?:=>|,)\s*(?:false|0)\b', re.IGNORECASE), "Disabled PHP curl SSL verification")
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
419
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
420
|
+
- **File:** `skills/torusguard/payload/scripts/diff_guard.py:20` | **Cluster:** `cluster-transport-security`
|
|
421
|
+
- **Description:** Disabled TLS certificate verification (verify=False)
|
|
422
|
+
```
|
|
423
|
+
(re.compile(r'(?:#|//|/\*)\s*(?:TODO\s*:?\s*)?(?:bypass|skip|disable)[_\s]*(?:auth|security|check|guard|filter|csrf|tenant)', re.IGNORECASE), "Suspicious authentication or security check bypass comment"),
|
|
424
|
+
# TLS / Certificate validation bypasses across Python, Go, Node, Java, C#, PHP, Rust
|
|
425
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
426
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
427
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
431
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
432
|
+
- **File:** `skills/torusguard/payload/scripts/diff_guard.py:21` | **Cluster:** `cluster-transport-security`
|
|
433
|
+
- **Description:** Disabled Go TLS certificate verification (InsecureSkipVerify: true)
|
|
434
|
+
```
|
|
435
|
+
# TLS / Certificate validation bypasses across Python, Go, Node, Java, C#, PHP, Rust
|
|
436
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
437
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
438
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
439
|
+
(re.compile(r'\brejectUnauthorized\s*:\s*false\b'), "Disabled Node.js TLS rejectUnauthorized"),
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
443
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
444
|
+
- **File:** `skills/torusguard/payload/scripts/diff_guard.py:22` | **Cluster:** `cluster-transport-security`
|
|
445
|
+
- **Description:** Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)
|
|
446
|
+
```
|
|
447
|
+
(re.compile(r'\bverify\s*=\s*False\b'), "Disabled TLS certificate verification (verify=False)"),
|
|
448
|
+
(re.compile(r'\bInsecureSkipVerify\s*:\s*true\b'), "Disabled Go TLS certificate verification (InsecureSkipVerify: true)"),
|
|
449
|
+
(re.compile(r'\bNODE_TLS_REJECT_UNAUTHORIZED\s*=\s*[\'"]?0[\'"]?'), "Disabled Node.js TLS verification (NODE_TLS_REJECT_UNAUTHORIZED=0)"),
|
|
450
|
+
(re.compile(r'\brejectUnauthorized\s*:\s*false\b'), "Disabled Node.js TLS rejectUnauthorized"),
|
|
451
|
+
(re.compile(r'\b(?:TrustAllStrategy|NoopHostnameVerifier|DangerousAcceptAnyServerCertificateValidator)\b'), "Disabled Java / C# TLS certificate validation"),
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
455
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
456
|
+
- **File:** `skills/torusguard/payload/scripts/diff_guard.py:26` | **Cluster:** `cluster-transport-security`
|
|
457
|
+
- **Description:** Disabled PHP curl SSL verification
|
|
458
|
+
```
|
|
459
|
+
(re.compile(r'\b(?:TrustAllStrategy|NoopHostnameVerifier|DangerousAcceptAnyServerCertificateValidator)\b'), "Disabled Java / C# TLS certificate validation"),
|
|
460
|
+
(re.compile(r'\bServerCertificateCustomValidationCallback\s*=\s*(?:\([^)]*\)\s*=>\s*true|HttpClientHandler\.DangerousAcceptAnyServerCertificateValidator)'), "Disabled C# TLS certificate callback"),
|
|
461
|
+
(re.compile(r'\bCURLOPT_SSL_VERIFYPEER\s*(?:=>|,)\s*(?:false|0)\b', re.IGNORECASE), "Disabled PHP curl SSL verification (CURLOPT_SSL_VERIFYPEER => false)"),
|
|
462
|
+
(re.compile(r'\bdanger_accept_invalid_certs\s*\(\s*true\s*\)'), "Disabled Rust reqwest TLS certificate validation"),
|
|
463
|
+
# Auth & CSRF bypasses
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
### [TG-PLATFORM-001] Wildcard Permissive CORS Configuration with Credentials
|
|
467
|
+
- **Severity:** `High` | **Confidence:** `55/100 (Medium Confidence)`
|
|
468
|
+
- **File:** `skills/torusguard/payload/scripts/harden_runner.py:183` | **Cluster:** `cluster-auth-bypass`
|
|
469
|
+
- **Description:** Wildcard CORS origin enabled across entire application
|
|
470
|
+
```
|
|
471
|
+
# Strategy 5: Permissive CORS with Credentials (TG-PLATFORM-001)
|
|
472
|
+
elif rule_id == "TG-PLATFORM-001":
|
|
473
|
+
if "CORS_ALLOW_ALL_ORIGINS = True" in target_line:
|
|
474
|
+
replacement = f'{indent}CORS_ALLOWED_ORIGINS = [os.environ.get("ALLOWED_ORIGIN", "https://app.example.com")]'
|
|
475
|
+
new_lines[line_number - 1] = replacement
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
479
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
480
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:180` | **Cluster:** `cluster-auth-bypass`
|
|
481
|
+
- **Description:** Decorator disabling route-level authentication or CSRF protection
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
if not bypass_guards:
|
|
485
|
+
bypass_rule = "4. **No Security Bypasses:** Never insert `# nosec`, `verify=False`, `@csrf_exempt`, or `bypass_auth=True`."
|
|
486
|
+
else:
|
|
487
|
+
bypass_rule = f"4. **No Security Bypasses:** Never insert `# nosec`, `verify=False`, or {', '.join(bypass_guards[:2])}."
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
### [TG-AUTH-004] Insecure Session Cookie or Disabled CSRF Protection
|
|
491
|
+
- **Severity:** `High` | **Confidence:** `70/100 (High Confidence)`
|
|
492
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:166` | **Cluster:** `cluster-auth-bypass`
|
|
493
|
+
- **Description:** Attribute disabling ASP.NET authentication
|
|
494
|
+
```
|
|
495
|
+
if "c#" in stack_lower or "dotnet" in stack_lower:
|
|
496
|
+
sql_guards.append("EF Core LINQ / `FromSqlInterpolated`")
|
|
497
|
+
bypass_guards.append("`[AllowAnonymous]`")
|
|
498
|
+
if "php" in stack_lower:
|
|
499
|
+
sql_guards.append("PDO prepared statements / Eloquent")
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
503
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
504
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:180` | **Cluster:** `cluster-transport-security`
|
|
505
|
+
- **Description:** Disabled TLS certificate verification (verify=False)
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
if not bypass_guards:
|
|
509
|
+
bypass_rule = "4. **No Security Bypasses:** Never insert `# nosec`, `verify=False`, `@csrf_exempt`, or `bypass_auth=True`."
|
|
510
|
+
else:
|
|
511
|
+
bypass_rule = f"4. **No Security Bypasses:** Never insert `# nosec`, `verify=False`, or {', '.join(bypass_guards[:2])}."
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
515
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
516
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:157` | **Cluster:** `cluster-transport-security`
|
|
517
|
+
- **Description:** Disabled Go TLS certificate verification (InsecureSkipVerify: true)
|
|
518
|
+
```
|
|
519
|
+
if "go" in stack_lower:
|
|
520
|
+
sql_guards.append("`db.Query(..., args)` / GORM")
|
|
521
|
+
bypass_guards.append("`InsecureSkipVerify: true`")
|
|
522
|
+
if "rust" in stack_lower:
|
|
523
|
+
sql_guards.append("`sqlx::query!` / Diesel")
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
527
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
528
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:172` | **Cluster:** `cluster-transport-security`
|
|
529
|
+
- **Description:** Disabled Node.js TLS rejectUnauthorized
|
|
530
|
+
```
|
|
531
|
+
if "typescript" in stack_lower or "javascript" in stack_lower or "next" in stack_lower or "express" in stack_lower:
|
|
532
|
+
sql_guards.append("Prisma / Drizzle binders")
|
|
533
|
+
bypass_guards.append("`rejectUnauthorized: false`")
|
|
534
|
+
|
|
535
|
+
if not sql_guards:
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
### [TG-DIFF-001] Disabled TLS / SSL Certificate Validation
|
|
539
|
+
- **Severity:** `Critical` | **Confidence:** `70/100 (High Confidence)`
|
|
540
|
+
- **File:** `skills/torusguard/payload/scripts/rules_sync.py:169` | **Cluster:** `cluster-transport-security`
|
|
541
|
+
- **Description:** Disabled PHP curl SSL verification
|
|
542
|
+
```
|
|
543
|
+
if "php" in stack_lower:
|
|
544
|
+
sql_guards.append("PDO prepared statements / Eloquent")
|
|
545
|
+
bypass_guards.append("`CURLOPT_SSL_VERIFYPEER => false`")
|
|
546
|
+
if "typescript" in stack_lower or "javascript" in stack_lower or "next" in stack_lower or "express" in stack_lower:
|
|
547
|
+
sql_guards.append("Prisma / Drizzle binders")
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
551
|
+
- **Severity:** `Low` | **Confidence:** `40/100 (Needs Review)`
|
|
552
|
+
- **File:** `tests/test_v0_6_0_governed_remediation.py:79` | **Cluster:** `cluster-tenant-isolation`
|
|
553
|
+
- **Description:** Django ORM .get(id=...) query lacking explicit tenant scope filter
|
|
554
|
+
```
|
|
555
|
+
def get_invoice(request, invoice_id):
|
|
556
|
+
# Fetch invoice directly without tenant filter
|
|
557
|
+
invoice = Invoice.objects.get(id=invoice_id)
|
|
558
|
+
return JsonResponse({"id": invoice.id})
|
|
559
|
+
"""
|
|
560
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"run_id": "run-20260910-120238-audit",
|
|
3
|
+
"command": "audit",
|
|
4
|
+
"target_name": "TorusGuard",
|
|
5
|
+
"created_at": "2026-09-10 12:02:38 IST",
|
|
6
|
+
"created_at_iso": "2026-09-10T12:02:38.760060+05:30",
|
|
7
|
+
"status": "recheck_completed",
|
|
8
|
+
"torusguard_version": "1.3.0",
|
|
9
|
+
"findings_count": 46,
|
|
10
|
+
"confirmed_fixed_count": 0,
|
|
11
|
+
"regressed_count": 0,
|
|
12
|
+
"remediation_bundles_count": 16
|
|
13
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# TorusGuard Differential Recheck Report
|
|
2
|
+
**Run ID:** `run-20260910-120238-audit`
|
|
3
|
+
**Timestamp:** `2026-09-10 12:04:44 IST`
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
## Recheck Transition Catalog
|
|
7
|
+
|
|
8
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
9
|
+
- **File:** `harness/validate_v0_6_1_scale.py`
|
|
10
|
+
- **Outcome:** `Unresolved`
|
|
11
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
12
|
+
|
|
13
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
14
|
+
- **File:** `harness/validate_v0_6_3_hardening.py`
|
|
15
|
+
- **Outcome:** `Unresolved`
|
|
16
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
17
|
+
|
|
18
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
19
|
+
- **File:** `harness/validate_v1_0_0_memory.py`
|
|
20
|
+
- **Outcome:** `Unresolved`
|
|
21
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
22
|
+
|
|
23
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
24
|
+
- **File:** `harness/runner.py`
|
|
25
|
+
- **Outcome:** `Unresolved`
|
|
26
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
27
|
+
|
|
28
|
+
### [TG-DB-004] Missing Multi-Tenant Isolation in Scoped Query
|
|
29
|
+
- **File:** `tests/test_v0_6_0_governed_remediation.py`
|
|
30
|
+
- **Outcome:** `Unresolved`
|
|
31
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
32
|
+
|
|
33
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
34
|
+
- **File:** `harness/validate_v1_1_0_advanced_memory.py`
|
|
35
|
+
- **Outcome:** `Unresolved`
|
|
36
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
37
|
+
|
|
38
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
39
|
+
- **File:** `harness/engine/fixture_manager.py`
|
|
40
|
+
- **Outcome:** `Unresolved`
|
|
41
|
+
- **Verification Timestamp:** 2026-09-10 12:04:44 IST
|
|
42
|
+
|
|
43
|
+
### [TG-INPUT-002] Unescaped Raw SQL Query Concatenation
|
|
44
|
+
- **File:** `harness/runner.py`
|
|
45
|
+
- **Outcome:** `Unresolved`
|
|
46
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
47
|
+
|
|
48
|
+
### [TG-INPUT-003] Unsafe Dynamic Code or HTML Execution
|
|
49
|
+
- **File:** `examples/vulnerable-react-express/client/src/App.jsx`
|
|
50
|
+
- **Outcome:** `Unresolved`
|
|
51
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
52
|
+
|
|
53
|
+
### [TG-PLATFORM-001] Wildcard Permissive CORS Configuration with Credentials
|
|
54
|
+
- **File:** `skills/torusguard/payload/scripts/harden_runner.py`
|
|
55
|
+
- **Outcome:** `Unresolved`
|
|
56
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
57
|
+
|
|
58
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
59
|
+
- **File:** `harness/runner.py`
|
|
60
|
+
- **Outcome:** `Unresolved`
|
|
61
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
62
|
+
|
|
63
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
64
|
+
- **File:** `harness/master_validation.py`
|
|
65
|
+
- **Outcome:** `Unresolved`
|
|
66
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
67
|
+
|
|
68
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
69
|
+
- **File:** `harness/validate_v0_6_2_modern_stacks.py`
|
|
70
|
+
- **Outcome:** `Unresolved`
|
|
71
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
72
|
+
|
|
73
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
74
|
+
- **File:** `harness/validate_e2e.py`
|
|
75
|
+
- **Outcome:** `Unresolved`
|
|
76
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
77
|
+
|
|
78
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
79
|
+
- **File:** `harness/validate_qa_v0_6_0.py`
|
|
80
|
+
- **Outcome:** `Unresolved`
|
|
81
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|
|
82
|
+
|
|
83
|
+
### [TG-SEC-001] Hardcoded Secret or API Key in Tracked Source
|
|
84
|
+
- **File:** `examples/vulnerable-react-express/server/index.js`
|
|
85
|
+
- **Outcome:** `Unresolved`
|
|
86
|
+
- **Verification Timestamp:** 2026-09-10 12:04:45 IST
|