@agenticcli/shipguard 0.10.0 → 0.12.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.
- package/README.md +16 -6
- package/dist/checksum-manifest.json +5 -5
- package/dist/{chunk-E4Z2MZ5J.js → chunk-IPNOC7JF.js} +15 -1
- package/dist/{chunk-KGIK7XNK.js → chunk-RVDTQ2FR.js} +3 -3
- package/dist/{chunk-6XMYOF3N.js → chunk-WMGOTWCL.js} +403 -52
- package/dist/cli-facts.json +18 -10
- package/dist/cli.js +522 -86
- package/dist/{config-generator-S5KFHKGQ.js → config-generator-BNFR3LZR.js} +2 -2
- package/dist/{dist-YSE6YNXH.js → dist-5SSCBJRC.js} +1 -1
- package/dist/{pro-scanner-TPNDJ6L6.js → pro-scanner-NSDJLVII.js} +2 -2
- package/docs/llms.txt +16 -4
- package/package.json +21 -7
- package/rules/free-bundle.json +295 -9
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
DEFAULT_MAX_FILES,
|
|
3
3
|
DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
4
4
|
DEFAULT_MAX_TOTAL_BYTES
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IPNOC7JF.js";
|
|
6
6
|
import "./chunk-NC5RELTG.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-RVDTQ2FR.js";
|
|
8
8
|
|
|
9
9
|
// src/core/config-generator.ts
|
|
10
10
|
import { writeFileSync, existsSync } from "fs";
|
|
@@ -7,9 +7,9 @@ import {
|
|
|
7
7
|
runProRules,
|
|
8
8
|
runProRulesWithDispatch,
|
|
9
9
|
validateBundleCompile
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WMGOTWCL.js";
|
|
11
11
|
import "./chunk-NC5RELTG.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-RVDTQ2FR.js";
|
|
13
13
|
export {
|
|
14
14
|
NoRulesAppliedError,
|
|
15
15
|
ProFetchError,
|
package/docs/llms.txt
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
# ShipGuard CLI
|
|
2
|
-
>
|
|
2
|
+
> The deterministic, local security and config check that runs inside your agent loop: same diff, same verdict, a real exit code your agent can read. One command checks a project for leaked secrets, unprotected routes, destructive database migrations, unverified payment webhooks and risky deploy settings. It runs locally, gives the same answer every time, and your code never leaves your machine.
|
|
3
3
|
|
|
4
|
-
ShipGuard
|
|
4
|
+
ShipGuard is not a code reviewer and not a general security scanner. It uses plain pattern rules (no AI model). It informs: the verdict is in the JSON `recommendation` field (SAFE_TO_SHIP, REVIEW_BEFORE_SHIP, DO_NOT_SHIP). The exit code is 0 whenever the scan completes; add --strict to make it exit 1 on a blocking result.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
|
+
npx @agenticcli/shipguard scan
|
|
7
8
|
npm install -g @agenticcli/shipguard
|
|
8
9
|
|
|
9
10
|
## Commands
|
|
10
11
|
shipguard init — initialize policy file
|
|
11
12
|
shipguard scan — scan project for risks
|
|
12
|
-
shipguard scan --changed — scan only changed files
|
|
13
|
-
shipguard scan --strict — exit code 1 on
|
|
13
|
+
shipguard scan --changed — scan only changed files (not for CI: a clean checkout has nothing to compare)
|
|
14
|
+
shipguard scan --strict — exit code 1 on a blocking result or an unfinished scan (opt-in hard gate, free on every plan)
|
|
14
15
|
shipguard scan --report — generate Markdown report
|
|
15
16
|
shipguard scan --json — machine-readable output (schemaVersion 6; the `coverage` object says how many files were discovered, scanned and skipped, and why)
|
|
16
17
|
shipguard scan --check-regressions — exit code 1 if a previously-passing rule now fails
|
|
18
|
+
shipguard hook — install the gate as a git hook (--target claude or --target ci for Claude Code or GitHub Actions)
|
|
17
19
|
shipguard history — show recent local scan history for this repo (read-only)
|
|
20
|
+
shipguard schema --json — the machine-readable contract: verdicts, exit codes, limits
|
|
18
21
|
|
|
19
22
|
## Risk Categories
|
|
20
23
|
- Secrets: hardcoded API keys, committed .env files, frontend exposure
|
|
@@ -26,6 +29,15 @@ shipguard history — show recent local scan history for this repo (read-only)
|
|
|
26
29
|
## Target Users
|
|
27
30
|
Solo SaaS builders, indie hackers, small dev teams using Claude Code, Codex, Cursor, or Lovable
|
|
28
31
|
|
|
32
|
+
## License
|
|
33
|
+
Elastic License 2.0 (source-available, free to use commercially, may not be offered as a hosted service).
|
|
34
|
+
|
|
35
|
+
## Docs
|
|
36
|
+
- Getting started: https://github.com/agenticcli/shipguard/blob/main/docs/getting-started.md
|
|
37
|
+
- FAQ: https://github.com/agenticcli/shipguard/blob/main/docs/faq.md
|
|
38
|
+
- Product page: https://agenticcli.dev/shipguard
|
|
39
|
+
- Docs: https://agenticcli.dev/shipguard/docs
|
|
40
|
+
|
|
29
41
|
## GitHub
|
|
30
42
|
https://github.com/agenticcli/shipguard
|
|
31
43
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticcli/shipguard",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "The security scanner your coding agent runs before every commit. Runs locally, same code same answer: checks for leaked secrets, unprotected routes, risky migrations, unverified payment webhooks and unsafe deploy settings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|
|
7
7
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"fast-glob": "^3.3.0",
|
|
22
22
|
"jose": "^6.2.13",
|
|
23
23
|
"minimatch": "^11.0.1",
|
|
24
|
-
"re2js": "2.8.
|
|
24
|
+
"re2js": "2.8.7",
|
|
25
25
|
"yaml": "^2.9.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -32,13 +32,14 @@
|
|
|
32
32
|
"tsup": "^8.5.1",
|
|
33
33
|
"typescript": "^5.8.0",
|
|
34
34
|
"vitest": "^4.1.11",
|
|
35
|
-
"@agenticcli/
|
|
36
|
-
"@agenticcli/
|
|
35
|
+
"@agenticcli/shared": "0.1.0",
|
|
36
|
+
"@agenticcli/matcher-contract": "0.5.1"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"shipguard",
|
|
40
40
|
"agenticcli",
|
|
41
41
|
"release-gate",
|
|
42
|
+
"security-scanner",
|
|
42
43
|
"ai-code",
|
|
43
44
|
"cli",
|
|
44
45
|
"ai-agents",
|
|
@@ -47,10 +48,23 @@
|
|
|
47
48
|
"codex",
|
|
48
49
|
"agentic",
|
|
49
50
|
"pre-deploy-check",
|
|
50
|
-
"llm-generated-code"
|
|
51
|
+
"llm-generated-code",
|
|
52
|
+
"vibe-coding",
|
|
53
|
+
"ai-generated-code",
|
|
54
|
+
"pre-commit",
|
|
55
|
+
"github-actions",
|
|
56
|
+
"ci",
|
|
57
|
+
"pre-deploy",
|
|
58
|
+
"stripe-webhook",
|
|
59
|
+
"env-files",
|
|
60
|
+
"nextjs",
|
|
61
|
+
"release-checklist"
|
|
51
62
|
],
|
|
52
63
|
"license": "Elastic-2.0",
|
|
53
|
-
"author":
|
|
64
|
+
"author": {
|
|
65
|
+
"name": "AgenticCLI",
|
|
66
|
+
"url": "https://agenticcli.dev"
|
|
67
|
+
},
|
|
54
68
|
"repository": {
|
|
55
69
|
"type": "git",
|
|
56
70
|
"url": "git+https://github.com/agenticcli/shipguard.git"
|
package/rules/free-bundle.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"description": "Offline free rule bundle compiled from rule-corpus/*/rule.yaml where bundleEligible=true and enabled=true. Governed by rules.md §4/§5/§9. Generated by scripts/build-free-bundle.ts — never hand-edited.",
|
|
4
|
-
"corpusVersion":
|
|
5
|
-
"corpusHash": "sha256:
|
|
6
|
-
"ruleCount":
|
|
7
|
-
"contentHash": "sha256:
|
|
4
|
+
"corpusVersion": 28,
|
|
5
|
+
"corpusHash": "sha256:260d041653902d294ec4dcb9ee654113604738bcf0e355d241fd81baaec69a98",
|
|
6
|
+
"ruleCount": 36,
|
|
7
|
+
"contentHash": "sha256:8ead9a382dcb1ea6c62929622dfc2d7815942bee5d548bf70464d97c9d9e4b8c",
|
|
8
8
|
"rules": [
|
|
9
9
|
{
|
|
10
10
|
"id": "generic.auth.jwt-none-algorithm",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"severity": "high",
|
|
148
148
|
"confidence": "MEDIUM",
|
|
149
149
|
"action": "warn",
|
|
150
|
-
"version":
|
|
150
|
+
"version": 6,
|
|
151
151
|
"status": "experimental",
|
|
152
152
|
"cwe": [
|
|
153
153
|
"CWE-942",
|
|
@@ -163,7 +163,8 @@
|
|
|
163
163
|
"Access-Control-Allow-Origin[^\\n]{0,40}req\\.(headers|get)\\s*\\(\\s*['\"]origin['\"]",
|
|
164
164
|
"setHeader\\s*\\(\\s*['\"]Access-Control-Allow-Origin['\"]\\s*,[^\\n]{0,60}origin",
|
|
165
165
|
"res\\.header\\s*\\(\\s*['\"]Access-Control-Allow-Origin['\"]\\s*,[^\\n]{0,60}req\\.headers\\.origin",
|
|
166
|
-
"response\\.setHeader\\s*\\(\\s*['\"]Access-Control-Allow-Origin['\"]\\s*,[^\\n]{0,60}request\\.headers"
|
|
166
|
+
"response\\.setHeader\\s*\\(\\s*['\"]Access-Control-Allow-Origin['\"]\\s*,[^\\n]{0,60}request\\.headers",
|
|
167
|
+
"\\.headers\\s*\\.\\s*(?:set|append)\\s*\\(\\s*['\"]Access-Control-Allow-Origin['\"]\\s*,\\s*(?:(?:origin|requestOrigin|reqOrigin)\\b|[\\w$.?!]{0,40}headers(?:\\.origin\\b|\\.get\\(\\s*['\"]origin['\"]\\s*\\)|\\[\\s*['\"]origin['\"]\\s*\\]))"
|
|
167
168
|
],
|
|
168
169
|
"antiPatterns": [
|
|
169
170
|
"\\btest\\b|\\bspec\\b|__tests__|__fixtures__",
|
|
@@ -504,6 +505,49 @@
|
|
|
504
505
|
"https://cwe.mitre.org/data/definitions/78.html"
|
|
505
506
|
]
|
|
506
507
|
},
|
|
508
|
+
{
|
|
509
|
+
"id": "generic.injection.child-process-exec-variable",
|
|
510
|
+
"framework": [
|
|
511
|
+
"generic"
|
|
512
|
+
],
|
|
513
|
+
"category": "injection",
|
|
514
|
+
"tier": "free",
|
|
515
|
+
"severity": "high",
|
|
516
|
+
"confidence": "MEDIUM",
|
|
517
|
+
"action": "warn",
|
|
518
|
+
"version": 1,
|
|
519
|
+
"status": "experimental",
|
|
520
|
+
"cwe": [
|
|
521
|
+
"CWE-78"
|
|
522
|
+
],
|
|
523
|
+
"owasp": [
|
|
524
|
+
"A03:2021"
|
|
525
|
+
],
|
|
526
|
+
"matcher": {
|
|
527
|
+
"type": "pattern",
|
|
528
|
+
"fileGlob": "**/*.{ts,js,tsx,jsx}",
|
|
529
|
+
"patterns": [
|
|
530
|
+
"(?:^|[^\\w$.]|child_process\\.|\\bcp\\.)(?:exec|execSync)\\s*\\(\\s*(?:cmd|command|cmdLine|cmdline|commandLine|shellCmd|shellCommand|fullCmd|script)\\s*[,)]",
|
|
531
|
+
"(?:^|[^\\w$.]|child_process\\.|\\bcp\\.)(?:exec|execSync)\\s*\\(\\s*req(?:uest)?\\.(?:body|query|params)\\b"
|
|
532
|
+
],
|
|
533
|
+
"antiPatterns": [
|
|
534
|
+
"(?:const|let|var)\\s+(?:cmd|command|cmdLine|cmdline|commandLine|shellCmd|shellCommand|fullCmd|script)(?::\\s?\\w{1,10})?\\s?=\\s?(?:\"[^\"$+\\n]{0,120}\"|'[^'$+\\n]{0,120}');?[ \\t]*\\n",
|
|
535
|
+
"\\.test\\.|\\bspec\\b|__tests__|__fixtures__",
|
|
536
|
+
"eslint-disable"
|
|
537
|
+
],
|
|
538
|
+
"flags": "",
|
|
539
|
+
"antiPatternScope": "file"
|
|
540
|
+
},
|
|
541
|
+
"explanation": "Node.js child_process.exec() or execSync() is called with a command held in a variable (or taken straight from the request) instead of a fixed string. exec() runs the command through the system shell (/bin/sh), so any part of that variable that comes from user input can add its own commands (for example \"; rm -rf\" or \"$(curl ...)\"). AI-written route handlers often build the command in a variable first and pass it to exec() on the next line.",
|
|
542
|
+
"recommendation": "Use execFile() or spawn() with the command and its arguments as separate values; they do not start a shell, so user input cannot add commands. If a shell is unavoidable, validate the input against a strict allowlist first.",
|
|
543
|
+
"fix": "Replace `const cmd = \"tool \" + input; exec(cmd)` with `execFile(\"tool\", [input])`.",
|
|
544
|
+
"findingType": "vulnerability",
|
|
545
|
+
"aiCodeTarget": true,
|
|
546
|
+
"references": [
|
|
547
|
+
"https://cwe.mitre.org/data/definitions/78.html",
|
|
548
|
+
"https://cheatsheetseries.owasp.org/cheatsheets/OS_Command_Injection_Defense_Cheat_Sheet.html"
|
|
549
|
+
]
|
|
550
|
+
},
|
|
507
551
|
{
|
|
508
552
|
"id": "generic.injection.eval-user-input",
|
|
509
553
|
"framework": [
|
|
@@ -637,6 +681,48 @@
|
|
|
637
681
|
"https://github.com/PyCQA/bandit"
|
|
638
682
|
]
|
|
639
683
|
},
|
|
684
|
+
{
|
|
685
|
+
"id": "generic.injection.sql-string-built",
|
|
686
|
+
"framework": [
|
|
687
|
+
"generic"
|
|
688
|
+
],
|
|
689
|
+
"category": "injection",
|
|
690
|
+
"tier": "free",
|
|
691
|
+
"severity": "high",
|
|
692
|
+
"confidence": "MEDIUM",
|
|
693
|
+
"action": "warn",
|
|
694
|
+
"version": 1,
|
|
695
|
+
"status": "experimental",
|
|
696
|
+
"cwe": [
|
|
697
|
+
"CWE-89"
|
|
698
|
+
],
|
|
699
|
+
"owasp": [
|
|
700
|
+
"A03:2021"
|
|
701
|
+
],
|
|
702
|
+
"matcher": {
|
|
703
|
+
"type": "pattern",
|
|
704
|
+
"fileGlob": "**/*.{ts,js,tsx,jsx,mjs,cjs}",
|
|
705
|
+
"patterns": [
|
|
706
|
+
"\"(?:select\\s[\\w.*,() ]{1,100}\\sfrom|insert\\s+into|update\\s+[\\w.]+\\s+set|delete\\s+from)\\s[^\"\\n]{0,200}\"\\s*\\+",
|
|
707
|
+
"'(?:select\\s[\\w.*,\"() ]{1,100}\\sfrom|insert\\s+into|update\\s+[\\w.]+\\s+set|delete\\s+from)\\s[^'\\n]{0,200}'\\s*\\+",
|
|
708
|
+
"(?:^|[^\\w$`])`\\s*(?:select\\s[\\w.*,\"() ]{1,100}\\sfrom|insert\\s+into|update\\s+[\\w.]+\\s+set|delete\\s+from)\\s[^`]{0,200}\\$\\{",
|
|
709
|
+
"\\b(?:sql|query|queryText|stmt|statement)\\s*\\+=\\s*(?:\"[^\"\\n]{0,120}\"|'[^'\\n]{0,120}')\\s*\\+"
|
|
710
|
+
],
|
|
711
|
+
"antiPatterns": [
|
|
712
|
+
"//\\s*shipguard-ignore"
|
|
713
|
+
],
|
|
714
|
+
"flags": "im"
|
|
715
|
+
},
|
|
716
|
+
"explanation": "A SQL statement is built by joining strings or by putting ${...} into a template string, and the result is sent to the database. If any part of it comes from a user (a search box, a URL parameter, a form field), the user can change the meaning of the query: read other people's rows, skip a login check, or delete data. This includes a search written as \"... ILIKE '%\" + q + \"%'\" and a statement kept in a variable that is later passed to pool.query(sql).",
|
|
717
|
+
"recommendation": "Send values as parameters, never inside the SQL text. With node-postgres write pool.query(\"SELECT ... WHERE title ILIKE $1\", [\"%\" + q + \"%\"]); with postgres.js use its tagged template sql`SELECT ... WHERE title ILIKE ${\"%\" + q + \"%\"}`, which sends ${...} as a parameter. Table and column names cannot be parameters: pick them from a fixed list in your code.",
|
|
718
|
+
"fix": "Replace the joined string with a parameterized query: pool.query('SELECT ... WHERE col = $1', [value]).",
|
|
719
|
+
"findingType": "vulnerability",
|
|
720
|
+
"aiCodeTarget": true,
|
|
721
|
+
"references": [
|
|
722
|
+
"https://cwe.mitre.org/data/definitions/89.html",
|
|
723
|
+
"https://node-postgres.com/features/queries"
|
|
724
|
+
]
|
|
725
|
+
},
|
|
640
726
|
{
|
|
641
727
|
"id": "generic.injection.unsafe-deserialization-python",
|
|
642
728
|
"framework": [
|
|
@@ -1106,6 +1192,49 @@
|
|
|
1106
1192
|
"https://github.com/gitleaks/gitleaks"
|
|
1107
1193
|
]
|
|
1108
1194
|
},
|
|
1195
|
+
{
|
|
1196
|
+
"id": "generic.secrets.resend-api-key",
|
|
1197
|
+
"framework": [
|
|
1198
|
+
"generic"
|
|
1199
|
+
],
|
|
1200
|
+
"category": "secrets",
|
|
1201
|
+
"tier": "local",
|
|
1202
|
+
"severity": "critical",
|
|
1203
|
+
"confidence": "HIGH",
|
|
1204
|
+
"action": "block",
|
|
1205
|
+
"version": 2,
|
|
1206
|
+
"status": "experimental",
|
|
1207
|
+
"cwe": [
|
|
1208
|
+
"CWE-798"
|
|
1209
|
+
],
|
|
1210
|
+
"owasp": [
|
|
1211
|
+
"A07:2021"
|
|
1212
|
+
],
|
|
1213
|
+
"matcher": {
|
|
1214
|
+
"type": "pattern",
|
|
1215
|
+
"fileGlob": "**/*.{ts,js,tsx,jsx,py,rb,go,yaml,yml,json,conf,ini,env}",
|
|
1216
|
+
"patterns": [
|
|
1217
|
+
"\\bre_[A-Za-z0-9]{6,12}_[A-Za-z0-9]{20,40}\\b"
|
|
1218
|
+
],
|
|
1219
|
+
"antiPatterns": [
|
|
1220
|
+
"re_x{6,}|re_123456789|YOUR_RESEND|REPLACE_ME|example|placeholder",
|
|
1221
|
+
"process\\.env\\.[A-Za-z0-9_]+!?\\s*(?:[,;)}\\]]|$)",
|
|
1222
|
+
"os\\.environ(?:\\.get\\([A-Za-z0-9_'\". :/+=@-]{0,64}\\)|\\[[A-Za-z0-9_'\". :/+=@-]{0,64}\\])?(?:[,;)}\\]]|$)",
|
|
1223
|
+
"ENV\\[[A-Za-z0-9_'\". :/+=@-]{0,64}\\](?:[,;)}\\]]|$)",
|
|
1224
|
+
"\\.test\\.|\\bspec\\b|__tests__"
|
|
1225
|
+
],
|
|
1226
|
+
"flags": ""
|
|
1227
|
+
},
|
|
1228
|
+
"explanation": "A hardcoded Resend API key (re_ prefix) was detected in source. Anyone who can read the repository can send email as your domain through your Resend account (phishing, spam, password-reset abuse) until the key is revoked.",
|
|
1229
|
+
"recommendation": "Remove the key from source and revoke it in the Resend dashboard under API Keys. Store the replacement in an environment variable (RESEND_API_KEY) loaded at runtime. Never commit live API keys to version control.",
|
|
1230
|
+
"fix": "Replace the literal with `process.env.RESEND_API_KEY` and add RESEND_API_KEY to .env.local (gitignored). Revoke the exposed key.",
|
|
1231
|
+
"findingType": "vulnerability",
|
|
1232
|
+
"aiCodeTarget": true,
|
|
1233
|
+
"references": [
|
|
1234
|
+
"https://cwe.mitre.org/data/definitions/798.html",
|
|
1235
|
+
"https://resend.com/docs/dashboard/api-keys/introduction"
|
|
1236
|
+
]
|
|
1237
|
+
},
|
|
1109
1238
|
{
|
|
1110
1239
|
"id": "generic.secrets.slack-token",
|
|
1111
1240
|
"framework": [
|
|
@@ -1161,7 +1290,7 @@
|
|
|
1161
1290
|
"severity": "critical",
|
|
1162
1291
|
"confidence": "HIGH",
|
|
1163
1292
|
"action": "block",
|
|
1164
|
-
"version":
|
|
1293
|
+
"version": 7,
|
|
1165
1294
|
"status": "experimental",
|
|
1166
1295
|
"cwe": [
|
|
1167
1296
|
"CWE-798"
|
|
@@ -1173,7 +1302,7 @@
|
|
|
1173
1302
|
"type": "pattern",
|
|
1174
1303
|
"fileGlob": "**/*.{ts,js,tsx,jsx,py,rb,go,yaml,yml,json,conf,ini,env}",
|
|
1175
1304
|
"patterns": [
|
|
1176
|
-
"
|
|
1305
|
+
"(?:sk|rk)_live_[a-zA-Z0-9]{20,64}"
|
|
1177
1306
|
],
|
|
1178
1307
|
"antiPatterns": [
|
|
1179
1308
|
"sk_live_xxxx|YOUR_STRIPE_KEY|REPLACE_ME",
|
|
@@ -1186,7 +1315,7 @@
|
|
|
1186
1315
|
],
|
|
1187
1316
|
"flags": ""
|
|
1188
1317
|
},
|
|
1189
|
-
"explanation": "A hardcoded Stripe live secret key (sk_live_ prefix) was detected in source.
|
|
1318
|
+
"explanation": "A hardcoded Stripe live secret key (sk_live_ prefix) or live restricted key (rk_live_ prefix) was detected in source. A secret key grants full access to the Stripe account including charges, refunds, customer data, and payouts; a restricted key grants whatever permissions it was created with. Either one is a live payment-account credential.",
|
|
1190
1319
|
"recommendation": "Remove the key immediately and roll it in the Stripe dashboard under Developers > API Keys. Store the key in an environment variable (STRIPE_SECRET_KEY) loaded at runtime. Never commit live API keys to version control.",
|
|
1191
1320
|
"fix": "Replace with `process.env.STRIPE_SECRET_KEY` and add it to .env.local (gitignored). Rotate the exposed key immediately.",
|
|
1192
1321
|
"findingType": "vulnerability",
|
|
@@ -1285,6 +1414,45 @@
|
|
|
1285
1414
|
"https://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification"
|
|
1286
1415
|
]
|
|
1287
1416
|
},
|
|
1417
|
+
{
|
|
1418
|
+
"id": "nextjs.secrets.env-public-prefix-secret",
|
|
1419
|
+
"framework": [
|
|
1420
|
+
"nextjs"
|
|
1421
|
+
],
|
|
1422
|
+
"category": "secrets",
|
|
1423
|
+
"tier": "free",
|
|
1424
|
+
"severity": "high",
|
|
1425
|
+
"confidence": "HIGH",
|
|
1426
|
+
"action": "block",
|
|
1427
|
+
"version": 3,
|
|
1428
|
+
"status": "experimental",
|
|
1429
|
+
"cwe": [
|
|
1430
|
+
"CWE-312"
|
|
1431
|
+
],
|
|
1432
|
+
"owasp": [
|
|
1433
|
+
"A02:2021"
|
|
1434
|
+
],
|
|
1435
|
+
"matcher": {
|
|
1436
|
+
"type": "pattern",
|
|
1437
|
+
"fileGlob": "**/*.{ts,tsx,js,jsx,env}",
|
|
1438
|
+
"patterns": [
|
|
1439
|
+
"NEXT_PUBLIC_(SECRET_KEY|PRIVATE_KEY|AUTH_SECRET|AUTH_TOKEN|CLIENT_SECRET|DB_PASSWORD|DATABASE_PASSWORD|OPENAI_API_KEY|STRIPE_SECRET|SENDGRID_API_KEY|TWILIO_AUTH_TOKEN|JWT_SECRET|WEBHOOK_SECRET|SUPABASE_SERVICE_ROLE)"
|
|
1440
|
+
],
|
|
1441
|
+
"antiPatterns": [
|
|
1442
|
+
"NEXT_PUBLIC_SUPABASE_URL",
|
|
1443
|
+
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
1444
|
+
"NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY",
|
|
1445
|
+
"NEXT_PUBLIC_GA_",
|
|
1446
|
+
"NEXT_PUBLIC_POSTHOG_KEY"
|
|
1447
|
+
],
|
|
1448
|
+
"flags": "i"
|
|
1449
|
+
},
|
|
1450
|
+
"explanation": "An environment variable prefixed with NEXT_PUBLIC_ and a sensitive name (SECRET, KEY, TOKEN, PASSWORD, API_KEY, etc.) is exposed to the client-side JavaScript bundle at build time. Next.js statically inlines all NEXT_PUBLIC_ variables into the browser bundle, making secrets visible to any user who inspects the page source or network traffic.",
|
|
1451
|
+
"recommendation": "Remove the NEXT_PUBLIC_ prefix so the variable stays server-side only. Access sensitive values only in Server Components, API routes, or Server Actions where they remain private. For values genuinely needed on the client (e.g. publishable keys), use vendor-specific public-safe key formats and verify they carry no elevated privileges.",
|
|
1452
|
+
"fix": "Rename NEXT_PUBLIC_SECRET_KEY to SECRET_KEY and access it only in server-side code.",
|
|
1453
|
+
"findingType": "vulnerability",
|
|
1454
|
+
"aiCodeTarget": true
|
|
1455
|
+
},
|
|
1288
1456
|
{
|
|
1289
1457
|
"id": "postgresql.auth.trust-auth-method",
|
|
1290
1458
|
"framework": [
|
|
@@ -1322,6 +1490,124 @@
|
|
|
1322
1490
|
"fix": "Replace 'trust' with 'scram-sha-256' in pg_hba.conf and set POSTGRES_PASSWORD in your Docker configuration.",
|
|
1323
1491
|
"findingType": "vulnerability",
|
|
1324
1492
|
"aiCodeTarget": true
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
"id": "react.xss.dangerouslysetinnerhtml-unsanitized",
|
|
1496
|
+
"framework": [
|
|
1497
|
+
"react"
|
|
1498
|
+
],
|
|
1499
|
+
"category": "injection",
|
|
1500
|
+
"tier": "free",
|
|
1501
|
+
"severity": "high",
|
|
1502
|
+
"confidence": "MEDIUM",
|
|
1503
|
+
"action": "warn",
|
|
1504
|
+
"version": 4,
|
|
1505
|
+
"status": "experimental",
|
|
1506
|
+
"cwe": [
|
|
1507
|
+
"CWE-79"
|
|
1508
|
+
],
|
|
1509
|
+
"owasp": [
|
|
1510
|
+
"A03:2021"
|
|
1511
|
+
],
|
|
1512
|
+
"matcher": {
|
|
1513
|
+
"type": "pattern",
|
|
1514
|
+
"fileGlob": "**/*.{tsx,jsx,ts,js}",
|
|
1515
|
+
"patterns": [
|
|
1516
|
+
"__html\\s*:\\s*`[^`]*\\$\\{",
|
|
1517
|
+
"__html\\s*:\\s*[A-Za-z_$][\\w$.]*\\s*(?:\\}|,|\\?\\?|\\|\\||\\?|!|\\bas\\s)",
|
|
1518
|
+
"__html\\s*:\\s*[A-Za-z_$][\\w$.]*\\s*\\+",
|
|
1519
|
+
"__html\\s*:\\s*[\\'\"][^\\'\"]*[\\'\"]\\s*\\+",
|
|
1520
|
+
"__html\\s*:\\s*[A-Za-z_$][\\w$.]*\\.(?:replace|replaceAll|trim|toString|slice|substring|concat|join|toLowerCase|toUpperCase)\\s*\\(",
|
|
1521
|
+
"dangerouslySetInnerHTML\\s*=\\s*\\{\\s*[A-Za-z_$][\\w$.]*\\s*\\}",
|
|
1522
|
+
"dangerouslySetInnerHTML\\s*=\\s*\\{\\s*\\{\\s*\\.\\.\\."
|
|
1523
|
+
],
|
|
1524
|
+
"antiPatterns": [
|
|
1525
|
+
"__html\\s*:\\s*(?:await\\s+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)\\s*\\(",
|
|
1526
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+clean[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nn]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nn]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*clean[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1527
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+cleanHtml[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*cleanHtml[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1528
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+cleanContent[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*cleanContent[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1529
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+cleanMarkup[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*cleanMarkup[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1530
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+cleanBody[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*cleanBody[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1531
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+cleanText[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*cleanText[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1532
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safe[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ne]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ne]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safe[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1533
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safeHtml[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safeHtml[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1534
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safeContent[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safeContent[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1535
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safeMarkup[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safeMarkup[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1536
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safeBody[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safeBody[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1537
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+safeText[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*safeText[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1538
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitized[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitized[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1539
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitizedHtml[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitizedHtml[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1540
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitizedContent[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitizedContent[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1541
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitizedMarkup[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitizedMarkup[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1542
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitizedBody[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitizedBody[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1543
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+sanitizedText[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*sanitizedText[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1544
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purified[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purified[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1545
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purifiedHtml[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purifiedHtml[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1546
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purifiedContent[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purifiedContent[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1547
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purifiedMarkup[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purifiedMarkup[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1548
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purifiedBody[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purifiedBody[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1549
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+purifiedText[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*purifiedText[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1550
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escaped[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nd]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escaped[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1551
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escapedHtml[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nl]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escapedHtml[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1552
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escapedContent[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escapedContent[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1553
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escapedMarkup[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\np]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escapedMarkup[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1554
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escapedBody[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\ny]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escapedBody[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])",
|
|
1555
|
+
"^[ \\t]*(?:const|let|var)[ \\t]+escapedText[ \\t]*=[ \\t]*(?:await[ \\t]+)?(?:DOMPurify\\.sanitize|purify\\.sanitize|sanitize[A-Za-z_]{0,12}|escapeHtml|xss)[ \\t]*\\([^\\n]{0,100}\\n(?:(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}\\n){0,3}(?:[^=\\n]|[^=\\nt]=[{\"\\']){0,100}__html[ \\t]*:[ \\t]*escapedText[ \\t]*(?:\\}|,|(?:\\?\\?|\\|\\|)[ \\t]*(?:\"\"|'')[ \\t]*[,}])"
|
|
1556
|
+
],
|
|
1557
|
+
"flags": "m",
|
|
1558
|
+
"antiPatternScope": {
|
|
1559
|
+
"lines": 3
|
|
1560
|
+
}
|
|
1561
|
+
},
|
|
1562
|
+
"explanation": "dangerouslySetInnerHTML is given a value built at run time (a variable, a property, or a string with ${...} or + parts in it) and the file shows no sanitizer. React does not escape this value, so if any of it comes from a user (a comment, a profile bio, a URL parameter, a database row somebody else wrote), an attacker can run JavaScript in other visitors' browsers and steal their session.",
|
|
1563
|
+
"recommendation": "Run the value through a sanitizer such as DOMPurify.sanitize() before it reaches __html, or render the content as text, or use a Markdown component that does not need dangerouslySetInnerHTML. A fixed string you wrote yourself, or JSON.stringify(...) for JSON-LD, is fine and is not reported.",
|
|
1564
|
+
"fix": "Use `{ __html: DOMPurify.sanitize(value) }` after `npm i dompurify`.",
|
|
1565
|
+
"findingType": "vulnerability",
|
|
1566
|
+
"aiCodeTarget": true
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
"id": "supabase.rls.permissive-policy-using-true",
|
|
1570
|
+
"framework": [
|
|
1571
|
+
"supabase"
|
|
1572
|
+
],
|
|
1573
|
+
"category": "database",
|
|
1574
|
+
"tier": "free",
|
|
1575
|
+
"severity": "high",
|
|
1576
|
+
"confidence": "MEDIUM",
|
|
1577
|
+
"action": "warn",
|
|
1578
|
+
"version": 3,
|
|
1579
|
+
"status": "experimental",
|
|
1580
|
+
"cwe": [
|
|
1581
|
+
"CWE-284",
|
|
1582
|
+
"CWE-732"
|
|
1583
|
+
],
|
|
1584
|
+
"owasp": [
|
|
1585
|
+
"A01:2021"
|
|
1586
|
+
],
|
|
1587
|
+
"matcher": {
|
|
1588
|
+
"type": "pattern",
|
|
1589
|
+
"fileGlob": "**/*.sql",
|
|
1590
|
+
"patterns": [
|
|
1591
|
+
"with\\s+check\\s*\\(\\s*true\\s*\\)",
|
|
1592
|
+
"for\\s+(?:insert|update|delete|all)\\s+(?:to\\s+[\\w,]+\\s+)?using\\s*\\(\\s*true\\s*\\)",
|
|
1593
|
+
"\\bon\\s+[\\w.\"]+\\s+(?:to\\s+\\w+\\s+)?using\\s*\\(\\s*true\\s*\\)"
|
|
1594
|
+
],
|
|
1595
|
+
"antiPatterns": [
|
|
1596
|
+
"-- public catalog",
|
|
1597
|
+
"-- intentionally open",
|
|
1598
|
+
"-- read-only public",
|
|
1599
|
+
"__tests__|test_migration"
|
|
1600
|
+
],
|
|
1601
|
+
"flags": "i",
|
|
1602
|
+
"antiPatternScope": {
|
|
1603
|
+
"lines": 5
|
|
1604
|
+
}
|
|
1605
|
+
},
|
|
1606
|
+
"explanation": "A row-level security policy that can change data (INSERT, UPDATE, DELETE, or no FOR clause, which means ALL commands) uses USING (true) or WITH CHECK (true). That grants every row to every role the policy names, which is the same as having no row-level security on writes: any signed-in or anonymous user can modify or delete other people's rows.",
|
|
1607
|
+
"recommendation": "Replace true with a condition that ties the row to the user, such as USING (auth.uid() = user_id) and WITH CHECK (auth.uid() = user_id). A SELECT policy of USING (true) on a public table is a legitimate choice and is not reported. If a write policy is open on purpose (a waitlist or contact form that only inserts), add the comment `-- intentionally open` above it.",
|
|
1608
|
+
"fix": "Replace USING (true) / WITH CHECK (true) with USING (auth.uid() = user_id) / WITH CHECK (auth.uid() = user_id).",
|
|
1609
|
+
"findingType": "vulnerability",
|
|
1610
|
+
"aiCodeTarget": true
|
|
1325
1611
|
}
|
|
1326
1612
|
]
|
|
1327
1613
|
}
|