@xenos1996/usa 2.22.0 → 2.24.0

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.
@@ -7,7 +7,7 @@
7
7
  # the single place a standard's version is recorded.
8
8
  #
9
9
  # `prefixes` are matched case-insensitively against the start of each reference
10
- # (e.g. `ASVS-2.10.4` matches the `ASVS` prefix). `usa standards` reports how
10
+ # (e.g. `ASVS-13.3.1` matches the `ASVS` prefix). `usa standards` reports how
11
11
  # many rules draw from each catalogue and how many the engine can fully decide.
12
12
  #
13
13
  # Adding a standard: give it a stable `id`, a human `name`, a `version`, and the
@@ -142,7 +142,7 @@ rules:
142
142
  flags: i
143
143
  why: 'A hardcoded production URL means the only way to run staging is to edit source.'
144
144
  remediation: 'Read every environment-specific value from configuration; keep defaults that are safe for local dev.'
145
- references: ['12-Factor:Config', 'ASVS-14.1.3']
145
+ references: ['12-Factor:Config']
146
146
 
147
147
  - id: ARCH-008
148
148
  title: Side effects are isolated and testable
@@ -87,7 +87,7 @@ rules:
87
87
  evidence: 'dev / staging / production configuration, and confirmation that dev cannot reach production data.'
88
88
  why: 'Testing in production is a slogan, not a strategy.'
89
89
  remediation: 'At minimum: local + staging + production, with separate credentials and datasets per environment.'
90
- references: ['NIST-SSDF-PO.5', 'ASVS-14.1.3']
90
+ references: ['NIST-SSDF-PO.5']
91
91
 
92
92
  - id: CICD-006
93
93
  title: Infrastructure is defined as code
@@ -37,7 +37,7 @@ rules:
37
37
  flags: i
38
38
  why: 'Hardcoded credentials leak through every clone, fork, and CI log. Rotation after exposure is mandatory, not optional.'
39
39
  remediation: 'Move to environment variables backed by a secret manager; rotate anything that was ever committed.'
40
- references: ['CWE-798', 'ASVS-2.10.4', 'OWASP-A02:2021']
40
+ references: ['CWE-798', 'ASVS-13.3.1', 'OWASP-A02:2021']
41
41
 
42
42
  - id: SEC-002
43
43
  title: Sensitive data is not written to logs
@@ -122,7 +122,7 @@ rules:
122
122
  flags: i
123
123
  why: 'String-built SQL is the oldest and most reliable way to lose a database. Parameterise or use a query builder.'
124
124
  remediation: 'Use parameterised queries ($1, ?, :name) or the ORM query API. Never interpolate user input into SQL text.'
125
- references: ['CWE-89', 'ASVS-5.3.4', 'OWASP-A03:2021']
125
+ references: ['CWE-89', 'ASVS-1.2.4', 'OWASP-A03:2021']
126
126
 
127
127
  - id: SEC-006
128
128
  title: No unsafe dynamic code execution
@@ -158,7 +158,7 @@ rules:
158
158
  exclude: ['**/*.test.*', '**/*.spec.*', '**/scripts/**']
159
159
  why: 'Command injection with user-controlled input is full remote code execution, usually unauthenticated.'
160
160
  remediation: 'Use execFile with an argument array (no shell), or a library call. If unavoidable, allowlist the inputs.'
161
- references: ['CWE-78', 'ASVS-5.3.8']
161
+ references: ['CWE-78', 'ASVS-1.2.5']
162
162
 
163
163
  - id: SEC-008
164
164
  title: User input is validated at a trust boundary
@@ -211,7 +211,7 @@ rules:
211
211
  exclude: ['**/*.test.*', '**/*.spec.*', '**/scripts/**', '**/tools/**']
212
212
  why: '`../../etc/passwd` is still the single most reliable bug class in file-serving code.'
213
213
  remediation: 'Resolve the path, then verify it is inside the intended base directory before touching the disk.'
214
- references: ['CWE-22', 'ASVS-12.5.1']
214
+ references: ['CWE-22', 'ASVS-13.4.7']
215
215
 
216
216
  # ------------------------------------------------------------------ auth
217
217
  - id: SEC-011
@@ -348,7 +348,7 @@ rules:
348
348
  flags: i
349
349
  why: '`Access-Control-Allow-Origin: *` lets any site read authenticated responses from your API.'
350
350
  remediation: 'Allowlist exact origins; only use * for genuinely public, unauthenticated assets.'
351
- references: ['CWE-942', 'ASVS-14.5.3']
351
+ references: ['CWE-942', 'ASVS-3.4.2']
352
352
 
353
353
  - id: SEC-018
354
354
  title: Security headers are set
@@ -367,7 +367,7 @@ rules:
367
367
  flags: i
368
368
  why: 'Four headers turn whole classes of browser attack off. They cost about six lines.'
369
369
  remediation: 'Use helmet (Node) or equivalent; add HSTS (max-age ≥31536000; includeSubDomains), X-Content-Type-Options: nosniff, Referrer-Policy, and a CSP.'
370
- references: ['ASVS-14.4.3', 'OWASP-Secure-Headers']
370
+ references: ['ASVS-3.4.3', 'OWASP-Secure-Headers']
371
371
 
372
372
  - id: SEC-019
373
373
  title: CSRF protection for cookie-based sessions
@@ -435,7 +435,7 @@ rules:
435
435
  An upload endpoint that trusts the client's Content-Type is a remote code execution endpoint with extra steps.
436
436
  evidence: 'Upload handler: allowed MIME allowlist, max size, and where the file is written (outside the web root).'
437
437
  remediation: 'Allowlist extensions AND sniff content; cap size; store outside the served directory; serve from a separate origin.'
438
- references: ['CWE-434', 'ASVS-12.5.2']
438
+ references: ['CWE-434', 'ASVS-5.3.1']
439
439
 
440
440
  - id: SEC-023
441
441
  title: PII is identified and protected at rest
@@ -534,7 +534,7 @@ rules:
534
534
  assert: { rule: SEC-014, status: [PASS] }
535
535
  why: 'Sound tokens with expiry but no rate limiting leave a credential-stuffing window: each token check passes, the login endpoint still takes unlimited guesses.'
536
536
  remediation: 'Rate-limit failed authentication (see SEC-014) on every endpoint that accepts these tokens.'
537
- references: ['CWE-307', 'ASVS-2.2.4']
537
+ references: ['CWE-307', 'ASVS-6.3.3']
538
538
 
539
539
  - id: INV-SEC-003
540
540
  title: Validated input is also encoded on output
@@ -26,7 +26,7 @@ rules:
26
26
  flags: i
27
27
  why: 'Without a version in the path or header, every breaking change is a coordinated deploy across every client.'
28
28
  remediation: 'Prefix routes with /v1 (or use a version header); never break an existing version in place.'
29
- references: ['ASVS-14.1.3', 'API-Design']
29
+ references: ['API-Design']
30
30
 
31
31
  - id: API-002
32
32
  title: Request timeouts are configured
@@ -20,7 +20,7 @@ rules:
20
20
  exclude: ['**/node_modules/**']
21
21
  why: 'A root process inside the container is one kernel exploit away from root on the host.'
22
22
  remediation: 'Add `USER node` (or a dedicated non-root uid) and `securityContext.runAsNonRoot: true` in Kubernetes.'
23
- references: ['CWE-250', 'CIS-Docker-4.1', 'ASVS-14.1.3']
23
+ references: ['CWE-250', 'CIS-Docker-4.1']
24
24
 
25
25
  - id: CTNR-002
26
26
  title: Multi-stage builds are used
@@ -46,7 +46,7 @@ rules:
46
46
  flags: i
47
47
  why: 'Relations enforced only in application code are relations that drift out of sync the first time someone writes a script.'
48
48
  remediation: 'Declare constraints at the DB level; add a periodic orphan-row check if you cannot.'
49
- references: ['ASVS-5.3.4']
49
+ references: ['ASVS-1.2.4']
50
50
 
51
51
  - id: DATA-003
52
52
  title: Indexes exist on queried columns
@@ -118,7 +118,7 @@ rules:
118
118
  flags: i
119
119
  why: 'A half-applied write is worse than a failed one: the data looks fine until someone reconciles it.'
120
120
  remediation: 'Wrap related writes in a transaction; make the operation idempotent so retries are safe.'
121
- references: ['ASVS-5.3.4']
121
+ references: ['ASVS-1.2.4']
122
122
 
123
123
  - id: DATA-008
124
124
  title: No SELECT * in hot paths
@@ -115,7 +115,7 @@ rules:
115
115
  flags: i
116
116
  why: 'Sprintf-built SQL is textbook injection.'
117
117
  remediation: 'Use placeholders: db.QueryContext(ctx, "SELECT ... WHERE id = $1", id).'
118
- references: ['CWE-89', 'ASVS-5.3.4']
118
+ references: ['CWE-89', 'ASVS-1.2.4']
119
119
 
120
120
  - id: GO-008
121
121
  title: HTTP servers set timeouts
@@ -25,7 +25,7 @@ rules:
25
25
  exclude: ['**/node_modules/**']
26
26
  why: 'This is the single most common cause of cloud data breaches, and it is one line of config.'
27
27
  remediation: 'Default to private; allowlist specific principals/CIDRs; add an automated check (Checkov/tfsec) in CI.'
28
- references: ['CWE-284', 'CIS-AWS-2.1.5', 'ASVS-14.1.3']
28
+ references: ['CWE-284', 'CIS-AWS-2.1.5']
29
29
 
30
30
  - id: IAC-002
31
31
  title: Encryption at rest is enabled
@@ -80,7 +80,7 @@ rules:
80
80
  flags: i
81
81
  why: 'String-concatenated JPQL is exactly as injectable as raw SQL.'
82
82
  remediation: 'Use named parameters (:name) or the Criteria API. Never build a query string from input.'
83
- references: ['CWE-89', 'ASVS-5.3.4']
83
+ references: ['CWE-89', 'ASVS-1.2.4']
84
84
 
85
85
  - id: JVM-005
86
86
  title: Nullability is explicit
@@ -131,7 +131,7 @@ rules:
131
131
  exclude: ['**/src/test/**', '**/test/**']
132
132
  why: 'Java deserialisation gadget chains are one of the most reliable RCE vectors in existence.'
133
133
  remediation: 'Use JSON with an explicit schema and no polymorphic default typing; validate before binding.'
134
- references: ['CWE-502', 'ASVS-5.5.1']
134
+ references: ['CWE-502', 'ASVS-1.5.2']
135
135
 
136
136
  - id: JVM-008
137
137
  title: JVM/container memory limits are respected
@@ -111,7 +111,7 @@ rules:
111
111
  exclude: ['**/tests/**']
112
112
  why: 'pickle.load on untrusted input is remote code execution by design. yaml.load without SafeLoader is the same class of bug.'
113
113
  remediation: 'Use json, yaml.safe_load, or torch.load(weights_only=True). Never deserialise untrusted pickle.'
114
- references: ['CWE-502', 'ASVS-5.5.1']
114
+ references: ['CWE-502', 'ASVS-1.5.2']
115
115
 
116
116
  - id: PY-007
117
117
  title: Subprocess calls do not use shell=True
@@ -99,4 +99,4 @@ rules:
99
99
  include: ['**/*.swift']
100
100
  why: 'Missing security headers exposes the app to clickjacking, MIME sniffing, and other browser attacks.'
101
101
  remediation: 'Add SecurityHeadersMiddleware to the middleware chain with appropriate policies.'
102
- references: ['ASVS-14.4.3', 'OWASP-Secure-Headers']
102
+ references: ['ASVS-3.4.3', 'OWASP-Secure-Headers']