Skip to content

fix(scan): exempt the metasyntactic credential pair in a DSN - #107

Merged
ralyodio merged 1 commit into
masterfrom
worktree-placeholder-dsn
Aug 12, 2026
Merged

fix(scan): exempt the metasyntactic credential pair in a DSN#107
ralyodio merged 1 commit into
masterfrom
worktree-placeholder-dsn

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Closes #105.

postgres://user:pass@localhost/db is how every database driver documents its connection string, and secret-database-url reported each one as high / CWE-798. On thecodearcher/limen that was 8 of the 10 high findings, every one inside a fenced code block in a README.

Why this is not the AWS case the list already refuses

The comment above KNOWN_PLACEHOLDERS deliberately declines to exempt AKIAIOSFODNN7EXAMPLE, because it is a real credential format carrying a fake value: it arrives by way of a pasted credentials template, and the remediation is the same as for a live key. That reasoning is right and it does not transfer. user:pass is the English words sitting where a credential goes.

The safety property

Both halves must be metasyntactic. root:hunter2@ is still reported, because a real password beside a common username is exactly the case this must not swallow. Three tests pin that.

Tests

  • text.test.ts — the exemption, and that a real password beside root, user and admin is still high.
  • limen-regression.test.ts — limen's README block copied verbatim scans to 0 findings, and the same file with a real DSN appended still reports exactly 1.

pnpm test in packages/scan: 162 passing. pnpm typecheck clean. Pre-commit hook (full CLI + landing page build) passed.

`postgres://user:pass@localhost/db` is how every database driver documents
its connection string, and secret-database-url reported each one as high with
CWE-798. On thecodearcher/limen that was eight of the ten high findings, all
of them inside fenced code blocks in a README.

This is not the AWS example-key case the list above it deliberately refuses.
`AKIAIOSFODNN7EXAMPLE` is a real credential format carrying a fake value, so
it arrives by way of a pasted template and the remediation is the same as for
a live key. `user:pass` is the English words in the position a credential
goes.

Both halves have to be metasyntactic, so `root:hunter2@` is still reported:
a real password beside a common username is the case this must not swallow.

Closes #105
@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

67 finding(s)

HIGH/CRITICAL: 11 | MEDIUM: 55 | LOW: 1

Severity Rule Location
HIGH secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
HIGH sh-eval-expansion .githooks/pre-commit:26
HIGH sh-remote-script-execution apps/web/public/install.sh:272
HIGH sh-remote-script-execution apps/web/public/install.sh:320
HIGH secret-generic-credential modules/spend-guard/config/example.conf.toml:13
HIGH secret-generic-credential modules/spend-guard/README.md:84
HIGH secret-generic-credential PRD.md:268
HIGH tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:121
HIGH tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:122
HIGH sh-remote-script-execution scripts/smoke-test.sh:46
HIGH sh-remote-script-execution scripts/smoke-test.sh:47
MEDIUM insecure-temp-file .githooks/commit-msg:16
MEDIUM insecure-temp-file .githooks/post-commit:20
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/init.ts:70
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/init.ts:79
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/service.ts:88
MEDIUM js-shell-exec-interpolation apps/cli/src/commands/service.ts:111
MEDIUM sql-template-interpolation apps/cli/src/core/state.ts:121
MEDIUM sql-template-interpolation apps/cli/src/core/state.ts:125
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:31
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:33
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:34
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:35
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:36
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:43
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:49
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:56
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:63
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:82
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:84
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:85
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:93
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:98
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:105
MEDIUM js-shell-exec-interpolation apps/cli/src/daemon/firewall/adapters.ts:112
MEDIUM js-shell-exec-interpolation apps/cli/src/index.ts:419
MEDIUM js-unescaped-html-sink apps/web/src/app/about/page.tsx:180
MEDIUM js-unescaped-html-sink apps/web/src/app/about/page.tsx:184
MEDIUM js-open-redirect apps/web/src/app/auth/login/page.tsx:50
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:125
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:153
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:157
MEDIUM js-unescaped-html-sink apps/web/src/app/get-whitepaper/page.tsx:346
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:211
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:215
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:219
MEDIUM js-unescaped-html-sink apps/web/src/app/page.tsx:120
MEDIUM js-unescaped-html-sink apps/web/src/app/store/[slug]/page.tsx:107
MEDIUM js-open-redirect apps/web/src/components/funding/FundingClient.tsx:97
MEDIUM manifest-install-lifecycle-script package.json:24

…and 17 more. Full results in the Security tab.

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit eb6bf5e into master Aug 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

secret-database-url fires high/CWE-798 on user:pass@ placeholders in READMEs

1 participant