@hoanghainh/komagu 1.8.0 → 2.0.1

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.
Files changed (210) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -1
  3. package/assess/lsa/CHANGELOG.md +6 -0
  4. package/assess/lsa/VERSION +1 -1
  5. package/assess/lsa/adapters/build_adapters.py +16 -8
  6. package/assess/lsa/adapters/codex/README.md +1 -1
  7. package/assess/lsa/adapters/generic/README.md +1 -1
  8. package/assess/lsa/examples/eval-run-4/ground-truth.json +823 -0
  9. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/ai-run-stats.json +58 -0
  10. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/coverage.json +85 -0
  11. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings/priv-privilege-001.json +822 -0
  12. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings/priv-privilege-002.json +393 -0
  13. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/findings.json +4477 -0
  14. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/mass-assignment.candidates.json +232 -0
  15. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-001.json +425 -0
  16. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-002.json +333 -0
  17. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-003.json +400 -0
  18. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-004.json +403 -0
  19. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-005.json +398 -0
  20. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/routes/routes-006.json +63 -0
  21. package/assess/lsa/examples/eval-run-4/iter0-gptoss-a/score.json +120 -0
  22. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/ai-run-stats.json +55 -0
  23. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/coverage.json +50 -0
  24. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings/priv-privilege-001.json +613 -0
  25. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings/priv-privilege-002.json +287 -0
  26. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/findings.json +4870 -0
  27. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/mass-assignment.candidates.json +232 -0
  28. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-001.json +425 -0
  29. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-002.json +333 -0
  30. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-003.json +400 -0
  31. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-004.json +403 -0
  32. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-005.json +398 -0
  33. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/routes/routes-006.json +63 -0
  34. package/assess/lsa/examples/eval-run-4/iter1-gptoss-a/score.json +107 -0
  35. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/ai-run-stats.json +58 -0
  36. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/coverage.json +92 -0
  37. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings/priv-privilege-001.json +645 -0
  38. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings/priv-privilege-002.json +222 -0
  39. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/findings.json +4859 -0
  40. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/mass-assignment.candidates.json +232 -0
  41. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-001.json +425 -0
  42. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-002.json +333 -0
  43. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-003.json +400 -0
  44. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-004.json +403 -0
  45. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-005.json +398 -0
  46. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/routes/routes-006.json +63 -0
  47. package/assess/lsa/examples/eval-run-4/iter1-gptoss-b/score.json +121 -0
  48. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/coverage.json +111 -0
  49. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings/priv-privilege-001.json +6 -0
  50. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings/priv-privilege-002.json +344 -0
  51. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/findings.json +3544 -0
  52. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/mass-assignment.candidates.json +232 -0
  53. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-001.json +425 -0
  54. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-002.json +333 -0
  55. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-003.json +400 -0
  56. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-004.json +403 -0
  57. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-005.json +398 -0
  58. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/routes/routes-006.json +63 -0
  59. package/assess/lsa/examples/eval-run-4/iter1-qwen-a-incomplete/score.json +123 -0
  60. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/ai-run-stats.json +50 -0
  61. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/coverage.json +42 -0
  62. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings/priv-privilege-001.json +540 -0
  63. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings/priv-privilege-002.json +238 -0
  64. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings.json +4383 -0
  65. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/findings.sarif +8729 -0
  66. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/mass-assignment.candidates.json +232 -0
  67. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/report.ja.md +1911 -0
  68. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/report.md +1911 -0
  69. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-001.json +425 -0
  70. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-002.json +333 -0
  71. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-003.json +400 -0
  72. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-004.json +403 -0
  73. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-005.json +398 -0
  74. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/routes/routes-006.json +63 -0
  75. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/score.json +101 -0
  76. package/assess/lsa/examples/eval-run-4/iter2-gptoss-a/stack-profile.json +226 -0
  77. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/ai-run-stats.json +54 -0
  78. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/coverage.json +66 -0
  79. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings/priv-privilege-001.json +440 -0
  80. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings/priv-privilege-002.json +229 -0
  81. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/findings.json +3424 -0
  82. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/mass-assignment.candidates.json +232 -0
  83. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-001.json +425 -0
  84. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-002.json +333 -0
  85. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-003.json +400 -0
  86. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-004.json +403 -0
  87. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-005.json +398 -0
  88. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/routes/routes-006.json +63 -0
  89. package/assess/lsa/examples/eval-run-4/iter2-gptoss-b/score.json +120 -0
  90. package/assess/lsa/examples/eval-run-5/gptoss-a/ai-run-stats.json +88 -0
  91. package/assess/lsa/examples/eval-run-5/gptoss-a/coverage.json +36 -0
  92. package/assess/lsa/examples/eval-run-5/gptoss-a/findings/priv-privilege-001.json +530 -0
  93. package/assess/lsa/examples/eval-run-5/gptoss-a/findings/priv-privilege-002.json +248 -0
  94. package/assess/lsa/examples/eval-run-5/gptoss-a/findings.json +4766 -0
  95. package/assess/lsa/examples/eval-run-5/gptoss-a/findings.sarif +9326 -0
  96. package/assess/lsa/examples/eval-run-5/gptoss-a/mass-assignment.candidates.json +232 -0
  97. package/assess/lsa/examples/eval-run-5/gptoss-a/report.ja.md +2011 -0
  98. package/assess/lsa/examples/eval-run-5/gptoss-a/report.md +2011 -0
  99. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-001.json +425 -0
  100. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-002.json +333 -0
  101. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-003.json +400 -0
  102. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-004.json +403 -0
  103. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-005.json +398 -0
  104. package/assess/lsa/examples/eval-run-5/gptoss-a/routes/routes-006.json +63 -0
  105. package/assess/lsa/examples/eval-run-5/gptoss-a/score.json +80 -0
  106. package/assess/lsa/examples/eval-run-5/gptoss-a/stack-profile.json +226 -0
  107. package/assess/lsa/examples/eval-run-5/gptoss-b/ai-run-stats.json +83 -0
  108. package/assess/lsa/examples/eval-run-5/gptoss-b/coverage.json +44 -0
  109. package/assess/lsa/examples/eval-run-5/gptoss-b/findings/priv-privilege-001.json +579 -0
  110. package/assess/lsa/examples/eval-run-5/gptoss-b/findings/priv-privilege-002.json +268 -0
  111. package/assess/lsa/examples/eval-run-5/gptoss-b/findings.json +3913 -0
  112. package/assess/lsa/examples/eval-run-5/gptoss-b/mass-assignment.candidates.json +232 -0
  113. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-001.json +425 -0
  114. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-002.json +333 -0
  115. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-003.json +400 -0
  116. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-004.json +403 -0
  117. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-005.json +398 -0
  118. package/assess/lsa/examples/eval-run-5/gptoss-b/routes/routes-006.json +63 -0
  119. package/assess/lsa/examples/eval-run-5/gptoss-b/score.json +94 -0
  120. package/assess/lsa/examples/eval-run-5/ground-truth.json +823 -0
  121. package/assess/lsa/knowledge/severity-and-cwe.md +1 -1
  122. package/assess/lsa/prompts/35-privilege-auditor.md +3 -1
  123. package/assess/lsa/scripts/baseline.py +5 -2
  124. package/assess/lsa/scripts/findings_to_sarif.py +24 -1
  125. package/assess/lsa/tests/EVAL-RESULTS.md +156 -0
  126. package/assess/lsa/tests/score_findings.py +58 -0
  127. package/assess/lsa/tests/test_adapters.py +21 -2
  128. package/assess/lsa/tests/test_baseline.py +8 -0
  129. package/assess/lsa/tests/test_contract_groundwork.py +7 -7
  130. package/assess/lsa/tests/test_eval_run_4.py +73 -0
  131. package/assess/lsa/tests/test_eval_run_5.py +73 -0
  132. package/assess/lsa/tests/test_privilege_tier2.py +30 -0
  133. package/operate/ai/anchoring.py +130 -0
  134. package/operate/ai/client.py +13 -0
  135. package/operate/ai/context.py +105 -0
  136. package/operate/ai/runner.py +197 -69
  137. package/operate/cli/__init__.py +1 -1
  138. package/operate/cli/commands/scan.py +3 -8
  139. package/operate/cli/commands/test.py +1 -1
  140. package/operate/cli/env.py +4 -20
  141. package/operate/cross_user_tester/persona_matrix.py +5 -1
  142. package/operate/devsecops/pipeline.py +5 -5
  143. package/operate/exploit/generator.py +5 -1
  144. package/operate/lsa_sarif/lsa_to_sarif.py +24 -2
  145. package/operate/lsa_sarif/sarif_findings.py +96 -0
  146. package/operate/remediator/runner.py +1 -5
  147. package/operate/remediator/strategies.py +1 -1
  148. package/operate/tests/test_ai_anchoring.py +184 -0
  149. package/operate/tests/test_cli_baseline.py +1 -9
  150. package/operate/tests/test_cli_env.py +8 -29
  151. package/operate/tests/test_cross_user_pipeline.py +2 -2
  152. package/operate/tests/test_exploit_and_virtual_patch.py +3 -3
  153. package/operate/tests/test_headless_ai.py +148 -1
  154. package/operate/tests/test_npm_package.py +2 -16
  155. package/operate/tests/test_sarif_from_scan.py +156 -0
  156. package/package.json +2 -4
  157. package/remediate/authz/README.md +1 -1
  158. package/remediate/authz/dotnet/src/Komagu.Security.Authorization/DefaultKomaguAuthorizationService.cs +1 -1
  159. package/remediate/authz/dotnet/src/Komagu.Security.Authorization/SecurityAuditEvent.cs +2 -2
  160. package/remediate/authz/golang/authz.go +1 -1
  161. package/remediate/authz/nodejs/src/service.js +1 -1
  162. package/remediate/authz/nodejs/tests/test-authz.js +1 -1
  163. package/remediate/authz/patcher.py +3 -4
  164. package/remediate/authz/python/komagu_authz/models.py +2 -2
  165. package/remediate/authz/python/tests/test_fastapi_adapter.py +1 -1
  166. package/remediate/authz/python/tests/test_fastapi_d5_crosstest.py +1 -1
  167. package/remediate/authz/python/tests/test_python_authz.py +3 -3
  168. package/remediate/authz/spring/src/main/kotlin/io/komagu/security/authorization/DefaultKomaguSecurityManager.kt +1 -1
  169. package/remediate/authz/spring/src/main/kotlin/io/komagu/security/authorization/SecurityAuditEvent.kt +1 -2
  170. package/remediate/authz/tests/test_bola_patcher.py +1 -1
  171. package/remediate/edge/coraza/rules/coraza-crs-custom.conf +3 -4
  172. package/remediate/edge/coraza/virtual_patcher.py +4 -6
  173. package/remediate/edge/docker-compose.yml +1 -1
  174. package/remediate/ekyc/server/jpki_verifier.py +2 -8
  175. package/remediate/ekyc/server/tokenization.py +2 -8
  176. package/remediate/identity/README.md +5 -5
  177. package/remediate/identity/dotnet/src/Komagu.Security.Identity/KomaguOidcOptions.cs +2 -2
  178. package/remediate/identity/dotnet/tests/Komagu.Security.Identity.Tests/TestTokenGenerator.cs +1 -1
  179. package/remediate/identity/dotnet/tests/Komagu.Security.Identity.Tests/TokenValidationTests.cs +1 -1
  180. package/remediate/identity/python/komagu_identity/oidc_validator.py +2 -8
  181. package/remediate/identity/python/tests/test_oidc_validator.py +1 -1
  182. package/remediate/identity/spring/src/main/kotlin/io/komagu/security/identity/KomaguOidcProperties.kt +2 -2
  183. package/remediate/identity/spring/src/test/kotlin/io/komagu/security/identity/KomaguIdentityAutoConfigurationTest.kt +2 -2
  184. package/remediate/identity/spring/src/test/kotlin/io/komagu/security/identity/TestJwtFactory.kt +1 -1
  185. package/remediate/identity/spring/src/test/kotlin/io/komagu/security/identity/TokenValidationIntegrationTest.kt +1 -1
  186. package/remediate/identity/test-env/realm-komagu.json +1 -1
  187. package/remediate/legacy_shims/coldfusion/KomaguSecurityShim.cfc +5 -5
  188. package/remediate/query/README.md +1 -1
  189. package/remediate/query/dotnet/src/Komagu.Security.Query.Analyzers/DiagnosticIds.cs +1 -1
  190. package/remediate/query/dotnet/src/Komagu.Security.Query.Analyzers/Komagu.Security.Query.Analyzers.csproj +1 -1
  191. package/remediate/query/spring/src/main/kotlin/io/komagu/security/query/detekt/KomaguRuleSetProvider.kt +1 -1
  192. package/remediate/resilience/dr/dr_manager.py +2 -8
  193. package/remediate/resilience/dr/runbook.md +2 -2
  194. package/remediate/resilience/terraform/variables.tf +1 -1
  195. package/remediate/tenancy/audit/audit_trail.py +2 -8
  196. package/remediate/tenancy/crypto/byok_manager.py +2 -8
  197. package/remediate/tenancy/middleware/tenant_context.py +2 -8
  198. package/remediate/tenancy/sql/rls_isolation.sql +11 -11
  199. package/remediate/tenancy/sql/schema_per_tenant.sql +7 -7
  200. package/remediate/tenancy/test_sql_postgres.py +1 -1
  201. package/remediate/tenancy/tests/test_tenancy.py +4 -4
  202. package/bin/komainu +0 -16
  203. package/bin/komainu-legacy.js +0 -16
  204. package/remediate/ekyc/tests/test_legacy_env.py +0 -33
  205. package/remediate/identity/python/tests/test_legacy_env.py +0 -33
  206. package/remediate/identity/spring/src/main/kotlin/io/komagu/security/identity/LegacyKomainuPropertiesPostProcessor.kt +0 -60
  207. package/remediate/identity/spring/src/main/resources/META-INF/spring.factories +0 -2
  208. package/remediate/identity/spring/src/test/kotlin/io/komagu/security/identity/LegacyKomainuPropertiesPostProcessorTest.kt +0 -86
  209. package/remediate/resilience/tests/test_legacy_env.py +0 -33
  210. package/remediate/tenancy/tests/test_legacy_env.py +0 -49
@@ -0,0 +1,530 @@
1
+ {
2
+ "batch_id": "privilege-001",
3
+ "findings": [
4
+ {
5
+ "finding_id": "BFLA-R-0003-1",
6
+ "category": "bfla",
7
+ "subtype": "missing_role_check",
8
+ "title": "Unrestricted member deletion in classic\u2011ASP",
9
+ "route_id": "R-0003",
10
+ "location": {
11
+ "file": "classic-asp/shop/member.asp",
12
+ "start_line": 9
13
+ },
14
+ "evidence": [
15
+ {
16
+ "file": "classic-asp/shop/member.asp",
17
+ "line": 10,
18
+ "why": "DELETE statement executed without admin check"
19
+ },
20
+ {
21
+ "file": "classic-asp/shop/member.asp",
22
+ "line": 1,
23
+ "why": "only session login check, no role verification"
24
+ }
25
+ ],
26
+ "impact": "Any authenticated user can delete any member record",
27
+ "severity": "critical",
28
+ "confidence": "high",
29
+ "cwe": [
30
+ "CWE-285"
31
+ ],
32
+ "recommendation": "Add an admin role check before executing the DELETE",
33
+ "status": "unverified"
34
+ },
35
+ {
36
+ "finding_id": "BFLA-R-0007-1",
37
+ "category": "bfla",
38
+ "subtype": "missing_role_check",
39
+ "title": "Unrestricted user deletion in ASP.NET MVC",
40
+ "route_id": "R-0007",
41
+ "location": {
42
+ "file": "dotnet-legacy/Web/Controllers/AdminController.cs",
43
+ "start_line": 12
44
+ },
45
+ "evidence": [
46
+ {
47
+ "file": "dotnet-legacy/Web/Controllers/AdminController.cs",
48
+ "line": 12,
49
+ "why": "DeleteUser action lacks [Authorize(Roles=\"Admin\")]"
50
+ }
51
+ ],
52
+ "impact": "Any authenticated user can delete any user account",
53
+ "severity": "critical",
54
+ "confidence": "high",
55
+ "cwe": [
56
+ "CWE-285"
57
+ ],
58
+ "recommendation": "Add [Authorize(Roles=\"Admin\")] to DeleteUser action",
59
+ "status": "unverified"
60
+ },
61
+ {
62
+ "finding_id": "BFLA-R-0009-1",
63
+ "category": "bfla",
64
+ "subtype": "role_from_request",
65
+ "title": "Export endpoint controlled by request parameter",
66
+ "route_id": "R-0009",
67
+ "location": {
68
+ "file": "dotnet-legacy/Web/Controllers/AdminController.cs",
69
+ "start_line": 30
70
+ },
71
+ "evidence": [
72
+ {
73
+ "file": "dotnet-legacy/Web/Controllers/AdminController.cs",
74
+ "line": 32,
75
+ "why": "Request.QueryString[\"isAdmin\"] == \"true\" allows export"
76
+ },
77
+ {
78
+ "file": "dotnet-legacy/Web/Controllers/AdminController.cs",
79
+ "line": 30,
80
+ "why": "no server\u2011side role check"
81
+ }
82
+ ],
83
+ "impact": "Any authenticated user can export all user data",
84
+ "severity": "critical",
85
+ "confidence": "high",
86
+ "cwe": [
87
+ "CWE-285"
88
+ ],
89
+ "recommendation": "Validate admin role from session before allowing export",
90
+ "status": "unverified"
91
+ },
92
+ {
93
+ "finding_id": "BFLA-R-0023-1",
94
+ "category": "bfla",
95
+ "subtype": "missing_role_check",
96
+ "title": "Unrestricted user deletion in Spring MVC",
97
+ "route_id": "R-0023",
98
+ "location": {
99
+ "file": "java-legacy/src/com/acme/web/AdminUserController.java",
100
+ "start_line": 13
101
+ },
102
+ "evidence": [
103
+ {
104
+ "file": "java-legacy/src/com/acme/web/AdminUserController.java",
105
+ "line": 13,
106
+ "why": "delete method lacks @PreAuthorize"
107
+ },
108
+ {
109
+ "file": "java-legacy/src/com/acme/web/AdminUserController.java",
110
+ "line": 19,
111
+ "why": "other actions have @PreAuthorize, but not this one"
112
+ }
113
+ ],
114
+ "impact": "Any authenticated user can delete any user",
115
+ "severity": "critical",
116
+ "confidence": "high",
117
+ "cwe": [
118
+ "CWE-285"
119
+ ],
120
+ "recommendation": "Add @PreAuthorize(\"hasRole('ADMIN')\") to delete method",
121
+ "status": "unverified"
122
+ },
123
+ {
124
+ "finding_id": "BFLA-R-0030-1",
125
+ "category": "bfla",
126
+ "subtype": "missing_role_check",
127
+ "title": "Unrestricted user deletion in Express.js",
128
+ "route_id": "R-0030",
129
+ "location": {
130
+ "file": "node-express/routes/admin.js",
131
+ "start_line": 8
132
+ },
133
+ "evidence": [
134
+ {
135
+ "file": "node-express/routes/admin.js",
136
+ "line": 8,
137
+ "why": "no requireAdmin middleware applied"
138
+ }
139
+ ],
140
+ "impact": "Any authenticated user can delete any user",
141
+ "severity": "critical",
142
+ "confidence": "high",
143
+ "cwe": [
144
+ "CWE-285"
145
+ ],
146
+ "recommendation": "Add requireAdmin middleware to the delete route",
147
+ "status": "unverified"
148
+ },
149
+ {
150
+ "finding_id": "BFLA-R-0032-1",
151
+ "category": "bfla",
152
+ "subtype": "role_from_request",
153
+ "title": "Export endpoint controlled by query parameter in Express.js",
154
+ "route_id": "R-0032",
155
+ "location": {
156
+ "file": "node-express/routes/admin.js",
157
+ "start_line": 16
158
+ },
159
+ "evidence": [
160
+ {
161
+ "file": "node-express/routes/admin.js",
162
+ "line": 17,
163
+ "why": "req.query.isAdmin === 'true' allows export"
164
+ },
165
+ {
166
+ "file": "node-express/routes/admin.js",
167
+ "line": 16,
168
+ "why": "no role check before export"
169
+ }
170
+ ],
171
+ "impact": "Any authenticated user can export all user data",
172
+ "severity": "critical",
173
+ "confidence": "high",
174
+ "cwe": [
175
+ "CWE-285"
176
+ ],
177
+ "recommendation": "Validate admin role from session before allowing export",
178
+ "status": "unverified"
179
+ },
180
+ {
181
+ "finding_id": "BFLA-R-0057-1",
182
+ "category": "bfla",
183
+ "subtype": "missing_role_check",
184
+ "title": "Unrestricted user view in PHP",
185
+ "route_id": "R-0057",
186
+ "location": {
187
+ "file": "php-plain/admin.php",
188
+ "start_line": 6
189
+ },
190
+ "evidence": [
191
+ {
192
+ "file": "php-plain/admin.php",
193
+ "line": 6,
194
+ "why": "SELECT * FROM users WHERE id = ... executed without admin check"
195
+ },
196
+ {
197
+ "file": "php-plain/admin.php",
198
+ "line": 2,
199
+ "why": "only session login check, no role verification"
200
+ }
201
+ ],
202
+ "impact": "Any authenticated user can view any user record",
203
+ "severity": "critical",
204
+ "confidence": "high",
205
+ "cwe": [
206
+ "CWE-285"
207
+ ],
208
+ "recommendation": "Add admin role check before executing the SELECT",
209
+ "status": "unverified"
210
+ },
211
+ {
212
+ "finding_id": "BFLA-R-0058-1",
213
+ "category": "bfla",
214
+ "subtype": "missing_role_check",
215
+ "title": "Unrestricted user deletion in PHP",
216
+ "route_id": "R-0058",
217
+ "location": {
218
+ "file": "php-plain/admin.php",
219
+ "start_line": 10
220
+ },
221
+ "evidence": [
222
+ {
223
+ "file": "php-plain/admin.php",
224
+ "line": 10,
225
+ "why": "DELETE executed without admin check"
226
+ },
227
+ {
228
+ "file": "php-plain/admin.php",
229
+ "line": 2,
230
+ "why": "only session login check, no role verification"
231
+ }
232
+ ],
233
+ "impact": "Any authenticated user can delete any user record",
234
+ "severity": "critical",
235
+ "confidence": "high",
236
+ "cwe": [
237
+ "CWE-285"
238
+ ],
239
+ "recommendation": "Add admin role check before executing the DELETE",
240
+ "status": "unverified"
241
+ },
242
+ {
243
+ "finding_id": "BFLA-R-0066-1",
244
+ "category": "bfla",
245
+ "subtype": "missing_role_check",
246
+ "title": "Unrestricted user deletion in PHP",
247
+ "route_id": "R-0066",
248
+ "location": {
249
+ "file": "php-plain/admin/delete_user.php",
250
+ "start_line": 1
251
+ },
252
+ "evidence": [
253
+ {
254
+ "file": "php-plain/admin/delete_user.php",
255
+ "line": 6,
256
+ "why": "DELETE executed without admin check"
257
+ },
258
+ {
259
+ "file": "php-plain/admin/delete_user.php",
260
+ "line": 2,
261
+ "why": "only session login check, no role verification"
262
+ }
263
+ ],
264
+ "impact": "Any authenticated user can delete any user record",
265
+ "severity": "critical",
266
+ "confidence": "high",
267
+ "cwe": [
268
+ "CWE-285"
269
+ ],
270
+ "recommendation": "Add admin role check before executing the DELETE",
271
+ "status": "unverified"
272
+ },
273
+ {
274
+ "finding_id": "BFLA-R-0067-1",
275
+ "category": "bfla",
276
+ "subtype": "role_from_request",
277
+ "title": "Privilege escalation via role promotion in PHP",
278
+ "route_id": "R-0067",
279
+ "location": {
280
+ "file": "php-plain/admin/promote.php",
281
+ "start_line": 1
282
+ },
283
+ "evidence": [
284
+ {
285
+ "file": "php-plain/admin/promote.php",
286
+ "line": 5,
287
+ "why": "role set from $_POST['is_admin'] without admin check"
288
+ },
289
+ {
290
+ "file": "php-plain/admin/promote.php",
291
+ "line": 2,
292
+ "why": "only session login check, no role verification"
293
+ }
294
+ ],
295
+ "impact": "Any authenticated user can promote themselves to admin",
296
+ "severity": "critical",
297
+ "confidence": "high",
298
+ "cwe": [
299
+ "CWE-285"
300
+ ],
301
+ "recommendation": "Validate admin role from session before allowing role changes",
302
+ "status": "unverified"
303
+ },
304
+ {
305
+ "finding_id": "BFLA-R-0059-1",
306
+ "category": "bfla",
307
+ "subtype": "client_side_role_check",
308
+ "title": "Client\u2011side admin check allows user deletion in PHP",
309
+ "route_id": "R-0059",
310
+ "location": {
311
+ "file": "php-plain/manage_users.php",
312
+ "start_line": 1
313
+ },
314
+ "evidence": [
315
+ {
316
+ "file": "php-plain/manage_users.php",
317
+ "line": 5,
318
+ "why": "DELETE executed without server\u2011side admin check"
319
+ },
320
+ {
321
+ "file": "php-plain/manage_users.php",
322
+ "line": 11,
323
+ "why": "role check only in HTML, not in handler"
324
+ }
325
+ ],
326
+ "impact": "Any authenticated user can delete any user record",
327
+ "severity": "critical",
328
+ "confidence": "high",
329
+ "cwe": [
330
+ "CWE-285"
331
+ ],
332
+ "recommendation": "Add server\u2011side admin check before executing the DELETE",
333
+ "status": "unverified"
334
+ },
335
+ {
336
+ "finding_id": "BFLA-R-0063-1",
337
+ "category": "bfla",
338
+ "subtype": "role_from_request",
339
+ "title": "Privilege escalation via role field in profile update",
340
+ "route_id": "R-0063",
341
+ "location": {
342
+ "file": "php-plain/profile.php",
343
+ "start_line": 1
344
+ },
345
+ "evidence": [
346
+ {
347
+ "file": "php-plain/profile.php",
348
+ "line": 10,
349
+ "why": "role set from $_POST['role'] without admin check"
350
+ },
351
+ {
352
+ "file": "php-plain/profile.php",
353
+ "line": 2,
354
+ "why": "only session login check, no role verification"
355
+ }
356
+ ],
357
+ "impact": "Any authenticated user can change their own role",
358
+ "severity": "critical",
359
+ "confidence": "high",
360
+ "cwe": [
361
+ "CWE-285"
362
+ ],
363
+ "recommendation": "Validate role changes against allowed values and enforce admin checks",
364
+ "status": "unverified"
365
+ },
366
+ {
367
+ "finding_id": "MASS-M-0003-1",
368
+ "category": "mass_assignment",
369
+ "subtype": "privileged_field_writable",
370
+ "title": "Unrestricted role binding in Spring MVC",
371
+ "candidate_id": "M-0003",
372
+ "location": {
373
+ "file": "java-legacy/src/com/acme/web/AccountController.java",
374
+ "start_line": 14
375
+ },
376
+ "evidence": [
377
+ {
378
+ "file": "java-legacy/src/com/acme/web/AccountController.java",
379
+ "line": 14,
380
+ "why": "Location taken from the Tier 1 inventory"
381
+ }
382
+ ],
383
+ "impact": "Any authenticated user can set the role field of an Account",
384
+ "severity": "critical",
385
+ "confidence": "high",
386
+ "cwe": [
387
+ "CWE-915"
388
+ ],
389
+ "recommendation": "Bind only allowed fields or set role server\u2011side",
390
+ "status": "unverified"
391
+ },
392
+ {
393
+ "finding_id": "MASS-M-0004-1",
394
+ "category": "mass_assignment",
395
+ "subtype": "privileged_field_writable",
396
+ "title": "Unrestricted role binding in Spring MVC (duplicate)",
397
+ "candidate_id": "M-0004",
398
+ "location": {
399
+ "file": "java-legacy/src/com/acme/web/AccountController.java",
400
+ "start_line": 27
401
+ },
402
+ "evidence": [
403
+ {
404
+ "file": "java-legacy/src/com/acme/web/AccountController.java",
405
+ "line": 27,
406
+ "why": "Location taken from the Tier 1 inventory"
407
+ }
408
+ ],
409
+ "impact": "Any authenticated user can set the role field of an Account",
410
+ "severity": "critical",
411
+ "confidence": "high",
412
+ "cwe": [
413
+ "CWE-915"
414
+ ],
415
+ "recommendation": "Bind only allowed fields or set role server\u2011side",
416
+ "status": "unverified"
417
+ },
418
+ {
419
+ "finding_id": "MASS-M-0005-1",
420
+ "category": "mass_assignment",
421
+ "subtype": "privileged_field_writable",
422
+ "title": "Unrestricted role binding via BeanUtils in Java Servlet",
423
+ "candidate_id": "M-0005",
424
+ "location": {
425
+ "file": "java-legacy/src/com/acme/web/ProfileServlet.java",
426
+ "start_line": 12
427
+ },
428
+ "evidence": [
429
+ {
430
+ "file": "java-legacy/src/com/acme/web/ProfileServlet.java",
431
+ "line": 12,
432
+ "why": "BeanUtils.populate binds all request parameters including role"
433
+ },
434
+ {
435
+ "file": "java-legacy/src/com/acme/web/ProfileServlet.java",
436
+ "line": 10,
437
+ "why": "no field filtering or role check"
438
+ }
439
+ ],
440
+ "impact": "Any authenticated user can set the role field of an Account",
441
+ "severity": "critical",
442
+ "confidence": "high",
443
+ "cwe": [
444
+ "CWE-915"
445
+ ],
446
+ "recommendation": "Bind only allowed fields or set role server\u2011side",
447
+ "status": "unverified"
448
+ }
449
+ ],
450
+ "privilege_route_verdicts": [
451
+ {
452
+ "route_id": "R-0003",
453
+ "verdict": "vulnerable"
454
+ },
455
+ {
456
+ "route_id": "R-0007",
457
+ "verdict": "vulnerable"
458
+ },
459
+ {
460
+ "route_id": "R-0009",
461
+ "verdict": "vulnerable"
462
+ },
463
+ {
464
+ "route_id": "R-0023",
465
+ "verdict": "vulnerable"
466
+ },
467
+ {
468
+ "route_id": "R-0030",
469
+ "verdict": "vulnerable"
470
+ },
471
+ {
472
+ "route_id": "R-0032",
473
+ "verdict": "vulnerable"
474
+ },
475
+ {
476
+ "route_id": "R-0057",
477
+ "verdict": "vulnerable"
478
+ },
479
+ {
480
+ "route_id": "R-0058",
481
+ "verdict": "vulnerable"
482
+ },
483
+ {
484
+ "route_id": "R-0066",
485
+ "verdict": "vulnerable"
486
+ },
487
+ {
488
+ "route_id": "R-0067",
489
+ "verdict": "vulnerable"
490
+ },
491
+ {
492
+ "route_id": "R-0059",
493
+ "verdict": "vulnerable"
494
+ },
495
+ {
496
+ "route_id": "R-0063",
497
+ "verdict": "vulnerable"
498
+ }
499
+ ],
500
+ "candidate_verdicts": [
501
+ {
502
+ "candidate_id": "M-0011",
503
+ "verdict": "needs_review"
504
+ },
505
+ {
506
+ "candidate_id": "M-0012",
507
+ "verdict": "needs_review"
508
+ },
509
+ {
510
+ "candidate_id": "M-0001",
511
+ "verdict": "needs_review"
512
+ },
513
+ {
514
+ "candidate_id": "M-0002",
515
+ "verdict": "needs_review"
516
+ },
517
+ {
518
+ "candidate_id": "M-0003",
519
+ "verdict": "vulnerable"
520
+ },
521
+ {
522
+ "candidate_id": "M-0004",
523
+ "verdict": "vulnerable"
524
+ },
525
+ {
526
+ "candidate_id": "M-0005",
527
+ "verdict": "vulnerable"
528
+ }
529
+ ]
530
+ }