← State of open source

What the scanners find

Every rule, measured on 10,007 public repositories. No project names, paths or code are published — only aggregates.

sourcetestsdocs & examplesconfigCIvendoredrepo-level

Old TODO / FIXME

warning
46%
of repos
179,216
findings
7
median per affected repo

91% confirmed in a hand check of 101

How to fix

Do it, delete it, or move it to an issue tracker and link it — a years-old TODO is a decision nobody made.

Before
// TODO: handle timeouts
const res = await fetch(url)
After
// Timeouts: see #482
const res = await fetch(url, { signal: AbortSignal.timeout(10_000) })

Old single-author file

info
63%
of repos
103,170
findings
15
median per affected repo

85% confirmed in a hand check of 33

How to fix

Have a second person review or touch this file, and add a short comment or doc explaining what it does and why.

Duplicated block

info
66%
of repos
63,682
findings
12
median per affected repo

72% confirmed in a hand check of 54

How to fix

Extract the repeated block into one function and call it from both places.

Before
const a = items.filter(i => i.active).map(i => i.id)
// … elsewhere
const b = users.filter(u => u.active).map(u => u.id)
After
const activeIds = <T extends { active: boolean; id: string }>(xs: T[]) =>
  xs.filter(x => x.active).map(x => x.id)
const a = activeIds(items)
const b = activeIds(users)

First-party action pinned to a mutable tag

info
56%
of repos
49,621
findings
6
median per affected repo

99% confirmed in a hand check of 120

How to fix

Pin the action to a full commit SHA and keep the tag as a comment; Dependabot or Renovate will keep it updated.

Before
- uses: actions/checkout@v4
After
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

Export nothing imports

info
18%
of repos
25,774
findings
3
median per affected repo

85% confirmed in a hand check of 20

How to fix

Delete the export (or the whole symbol) if nothing uses it; if it is public API, document it as such.

Before
export function formatLegacyDate(d: Date) { … }
After
// removed: no imports anywhere in the repo

Third-party action pinned to a mutable tag

warning
45%
of repos
21,392
findings
3
median per affected repo

99% confirmed in a hand check of 124

How to fix

A third-party tag can be moved to malicious code at any time. Pin to a full commit SHA.

Before
- uses: some-org/deploy-action@v2
After
- uses: some-org/deploy-action@3f1c2a9e0b7d4c5a6e8f9b0c1d2e3f4a5b6c7d8e # v2.1.0

Commented-out code

info
27%
of repos
20,995
findings
3
median per affected repo

55% confirmed in a hand check of 206

How to fix

Delete it — git history keeps the old version.

Before
// const total = items.reduce((s, i) => s + i.price, 0)
const total = sum(items)
After
const total = sum(items)

Broken relative link in docs

warning
17%
of repos
13,590
findings
2
median per affected repo

66% confirmed in a hand check of 47

How to fix

Point the link at the file's new path, or remove it.

Before
See [setup](docs/setup.md).
After
See [setup](docs/getting-started/setup.md).

Workflow token permissions not restricted

warning
47%
of repos
10,235
findings
1
median per affected repo

100% confirmed in a hand check of 86

How to fix

Declare the minimum token permissions at the top of the workflow and widen per job only where needed.

Before
on: [push]
jobs:
  test:
After
on: [push]
permissions:
  contents: read
jobs:
  test:

Skipped or focused test

info
6%
of repos
4,007
findings
3
median per affected repo

81% confirmed in a hand check of 27

How to fix

Fix and re-enable the test, or delete it; a .only silently skips the rest of the suite.

Before
it.skip('parses dates', () => { … })
After
it('parses dates', () => { … })

End-of-life Node.js version

warning
12%
of repos
3,357
findings
1
median per affected repo

97% confirmed in a hand check of 37

How to fix

Move to a supported LTS line in CI, engines and Dockerfiles.

Before
- uses: actions/setup-node@…
  with:
    node-version: 16
After
- uses: actions/setup-node@…
  with:
    node-version: 22

No tests

warning
28%
of repos
2,751
findings
1
median per affected repo

55% confirmed in a hand check of 11

How to fix

Start with one test of the most important function, and run it in CI.

After
import { test, expect } from "vitest"
import { parse } from "../src/parse"

test("parses a basic input", () => {
  expect(parse("a=1")).toEqual({ a: "1" })
})

No CI

info
26%
of repos
2,608
findings
1
median per affected repo

71% confirmed in a hand check of 14

How to fix

Add a minimal workflow that installs and runs the tests on every pull request.

After
# .github/workflows/ci.yml
on: [push, pull_request]
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@<sha>
      - run: npm ci && npm test

End-of-life Python version

warning
7%
of repos
1,677
findings
1
median per affected repo

89% confirmed in a hand check of 35

How to fix

Move to a supported Python version and update requires-python.

Before
python-version: "3.7"
After
python-version: "3.12"

No LICENSE

info
11%
of repos
1,119
findings
1
median per affected repo

75% confirmed in a hand check of 12

SQL built by string interpolation

critical
1%
of repos
647
findings
2
median per affected repo

30% confirmed in a hand check of 94 · 4,727 more hidden as low confidence

How to fix

Use a parameterised query; never build SQL from strings.

Before
db.query(`SELECT * FROM users WHERE id = ${req.params.id}`)
After
db.query("SELECT * FROM users WHERE id = $1", [req.params.id])

Two configs, one ignored

info
5%
of repos
575
findings
1
median per affected repo

95% confirmed in a hand check of 20

How to fix

Keep one config file and delete the one the tool ignores.

Base image uses :latest

warning
2%
of repos
476
findings
1
median per affected repo

60% confirmed in a hand check of 15

How to fix

Pin the base image to a version (or a digest) so builds are reproducible.

Before
FROM node:latest
After
FROM node:22.11-alpine

No lockfile committed

warning
4%
of repos
441
findings
1
median per affected repo

90% confirmed in a hand check of 20

How to fix

Commit the lockfile your package manager generates, and install with it in CI.

Before
- run: npm install
After
- run: npm ci   # package-lock.json committed

CI does not run on pull requests

info
4%
of repos
378
findings
1
median per affected repo

56% confirmed in a hand check of 9

Badge points at something gone

warning
2%
of repos
310
findings
1
median per affected repo

85% confirmed in a hand check of 13

Password hashed with MD5/SHA-1

critical
1%
of repos
221
findings
2
median per affected repo

81% confirmed in a hand check of 36

Admin/database port open to the internet

critical
0%
of repos
214
findings
1
median per affected repo

83% confirmed in a hand check of 35

How to fix

Restrict the source range to your VPN or bastion, never 0.0.0.0/0.

Before
from_port   = 22
cidr_blocks = ["0.0.0.0/0"]
After
from_port   = 22
cidr_blocks = [var.office_cidr]

End-of-life CI runner image

critical
1%
of repos
174
findings
1
median per affected repo

100% confirmed in a hand check of 17

Unused UI kit

info
2%
of repos
158
findings
1
median per affected repo

60% confirmed in a hand check of 5

Shell command built from variables

critical
1%
of repos
154
findings
2
median per affected repo

16% confirmed in a hand check of 31 · 2,364 more hidden as low confidence

How to fix

Call the program with an argument array and no shell, so input cannot become a command.

Before
exec(`convert ${file} out.png`)
After
execFile("convert", [file, "out.png"])

ADD downloads a remote URL

info
1%
of repos
148
findings
2
median per affected repo

83% confirmed in a hand check of 6

Self-hosted runner on public triggers

warning
0%
of repos
138
findings
2
median per affected repo

50% confirmed in a hand check of 4

Docs mention a missing script

warning
1%
of repos
121
findings
2
median per affected repo

63% confirmed in a hand check of 8

Request input echoed unescaped

warning
0%
of repos
117
findings
2
median per affected repo

67% confirmed in a hand check of 6 · 14 more hidden as low confidence

Server fetches a URL from a variable (SSRF)

critical
1%
of repos
108
findings
1
median per affected repo

6% confirmed in a hand check of 82 · 12,199 more hidden as low confidence

CI job disabled

warning
1%
of repos
98
findings
1
median per affected repo

91% confirmed in a hand check of 11

No README

warning
1%
of repos
94
findings
1
median per affected repo

not hand-checked yet

Docker socket mounted into a container

warning
1%
of repos
94
findings
1
median per affected repo

69% confirmed in a hand check of 13

Publicly readable storage bucket

critical
0%
of repos
89
findings
2
median per affected repo

50% confirmed in a hand check of 22

eval() on a dynamic value

critical
0%
of repos
82
findings
2
median per affected repo

18% confirmed in a hand check of 11 · 679 more hidden as low confidence

Password in infrastructure code

critical
0%
of repos
69
findings
1
median per affected repo

not hand-checked yet

Rust TLS server verification disabled

critical
0%
of repos
52
findings
2
median per affected repo

60% confirmed in a hand check of 5

Lockfile out of sync with manifest

warning
0%
of repos
47
findings
1
median per affected repo

not hand-checked yet

innerHTML set from a variable

warning
0%
of repos
44
findings
1
median per affected repo

0% confirmed in a hand check of 15 · 1,055 more hidden as low confidence

How to fix

Use textContent, or sanitise HTML with DOMPurify.

Before
el.innerHTML = comment.body
After
el.textContent = comment.body

Secret signed with plain MD5/SHA-1

warning
0%
of repos
41
findings
1
median per affected repo

80% confirmed in a hand check of 10

CI errors swallowed

warning
0%
of repos
37
findings
1
median per affected repo

60% confirmed in a hand check of 5

PHP unserialize() of a variable

warning
0%
of repos
36
findings
2
median per affected repo

20% confirmed in a hand check of 10 · 338 more hidden as low confidence

libcurl TLS server verification disabled

critical
0%
of repos
33
findings
2
median per affected repo

not hand-checked yet

File included from request input

critical
0%
of repos
27
findings
2
median per affected repo

not hand-checked yet · 10 more hidden as low confidence

dangerouslySetInnerHTML

warning
0%
of repos
22
findings
1
median per affected repo

11% confirmed in a hand check of 19 · 953 more hidden as low confidence

new Function() on a dynamic value

critical
0%
of repos
22
findings
1
median per affected repo

25% confirmed in a hand check of 12 · 257 more hidden as low confidence

Value marked as trusted HTML in a Go template

warning
0%
of repos
21
findings
3
median per affected repo

0% confirmed in a hand check of 8 · 218 more hidden as low confidence

Python eval()/exec()

critical
0%
of repos
19
findings
1
median per affected repo

0% confirmed in a hand check of 20 · 750 more hidden as low confidence

subprocess with shell=True

critical
0%
of repos
18
findings
1
median per affected repo

11% confirmed in a hand check of 9 · 569 more hidden as low confidence

How to fix

Pass a list of arguments and drop shell=True.

Before
subprocess.run(f"git clone {url}", shell=True)
After
subprocess.run(["git", "clone", url], check=True)

os.system() call

critical
0%
of repos
12
findings
1
median per affected repo

0% confirmed in a hand check of 10 · 389 more hidden as low confidence

pickle.load() of untrusted data

warning
0%
of repos
11
findings
1
median per affected repo

10% confirmed in a hand check of 21 · 584 more hidden as low confidence

Java native deserialisation

warning
0%
of repos
6
findings
2
median per affected repo

33% confirmed in a hand check of 6 · 354 more hidden as low confidence

Marshal / unsafe YAML load

warning
0%
of repos
5
findings
1
median per affected repo

0% confirmed in a hand check of 5 · 108 more hidden as low confidence

Unsafe yaml.load()

critical
0%
of repos
3
findings
1
median per affected repo

0% confirmed in a hand check of 4 · 52 more hidden as low confidence

How to fix

Use yaml.safe_load.

Before
data = yaml.load(f)
After
data = yaml.safe_load(f)

Unsafe .NET deserialiser

warning
0%
of repos
1
findings
1
median per affected repo

not hand-checked yet · 94 more hidden as low confidence

Env var used but not in .env.example

0%
of repos
0
findings
0
median per affected repo

14% confirmed in a hand check of 7 · 14,325 more hidden as low confidence

How to fix

Add the variable to .env.example with a placeholder and a comment.

Before
# .env.example
DATABASE_URL=
After
# .env.example
DATABASE_URL=
# Stripe secret key (sk_test_… locally)
STRIPE_SECRET_KEY=

Leftover debug statement

0%
of repos
0
findings
0
median per affected repo

27% confirmed in a hand check of 15 · 9,718 more hidden as low confidence

Large or binary file in git

0%
of repos
0
findings
0
median per affected repo

47% confirmed in a hand check of 17 · 8,910 more hidden as low confidence

How to fix

Remove the file from the repo and keep it in Git LFS, a release asset or object storage; add it to .gitignore.

Before
git add assets/demo.mp4
After
git lfs track "*.mp4"
git add .gitattributes assets/demo.mp4

Container runs as root

0%
of repos
0
findings
0
median per affected repo

24% confirmed in a hand check of 17 · 3,984 more hidden as low confidence

How to fix

Switch to an unprivileged user before the final command.

Before
COPY . /app
CMD ["node", "server.js"]
After
COPY --chown=node:node . /app
USER node
CMD ["node", "server.js"]

Provider credential (AWS, Stripe, GitHub…)

0%
of repos
0
findings
0
median per affected repo

0% confirmed in a hand check of 14 · 3,836 more hidden as low confidence

How to fix

Revoke the key at the provider first, then read it from the environment or a secret manager. Removing it from the file alone is not enough.

Before
const stripe = new Stripe("sk_live_51H…")
After
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!)

High-entropy secret assignment

0%
of repos
0
findings
0
median per affected repo

11% confirmed in a hand check of 9 · 2,985 more hidden as low confidence

How to fix

Rotate the value and load it from the environment.

Before
API_TOKEN = "9f8e7d6c5b4a39281706f5e4d3c2b1a0"
After
API_TOKEN = os.environ["API_TOKEN"]

Unused dependency

0%
of repos
0
findings
0
median per affected repo

8% confirmed in a hand check of 13 · 2,677 more hidden as low confidence

Env var documented but never used

0%
of repos
0
findings
0
median per affected repo

20% confirmed in a hand check of 10 · 1,651 more hidden as low confidence

CI never runs the tests

0%
of repos
0
findings
0
median per affected repo

0% confirmed in a hand check of 10 · 1,285 more hidden as low confidence

Base image has no tag

0%
of repos
0
findings
0
median per affected repo

36% confirmed in a hand check of 11 · 960 more hidden as low confidence

torch.load / shelve / dill on a file

0%
of repos
0
findings
0
median per affected repo

not hand-checked yet · 747 more hidden as low confidence

Go query builder handed a formatted string

0%
of repos
0
findings
0
median per affected repo

not hand-checked yet · 629 more hidden as low confidence

CI step failures silenced

0%
of repos
0
findings
0
median per affected repo

36% confirmed in a hand check of 11 · 532 more hidden as low confidence

How to fix

Let the step fail. If it is truly optional, say so with continue-on-error and a comment.

Before
- run: npm test || true
After
- run: npm test

Secret still in git history

0%
of repos
0
findings
0
median per affected repo

6% confirmed in a hand check of 16 · 514 more hidden as low confidence

How to fix

The secret is in past commits: revoke it. Rewriting history (git filter-repo) only helps after revocation.

TLS verification disabled

0%
of repos
0
findings
0
median per affected repo

7% confirmed in a hand check of 27 · 500 more hidden as low confidence

Secret in localStorage

0%
of repos
0
findings
0
median per affected repo

17% confirmed in a hand check of 12 · 441 more hidden as low confidence

How to fix

Keep session tokens in an HttpOnly, Secure cookie set by the server, out of reach of page scripts.

Before
localStorage.setItem("token", jwt)
After
res.cookie("session", jwt, { httpOnly: true, secure: true, sameSite: "lax" })

No .env.example

0%
of repos
0
findings
0
median per affected repo

8% confirmed in a hand check of 12 · 375 more hidden as low confidence

Java XML parser open to XXE

0%
of repos
0
findings
0
median per affected repo

27% confirmed in a hand check of 15 · 341 more hidden as low confidence

Weak hash (MD5/SHA-1)

0%
of repos
0
findings
0
median per affected repo

0% confirmed in a hand check of 5 · 214 more hidden as low confidence

Container shares host network/PID

0%
of repos
0
findings
0
median per affected repo

11% confirmed in a hand check of 44 · 156 more hidden as low confidence

Python XML parsed without entity protection

0%
of repos
0
findings
0
median per affected repo

not hand-checked yet · 150 more hidden as low confidence

Privileged container

0%
of repos
0
findings
0
median per affected repo

21% confirmed in a hand check of 38 · 109 more hidden as low confidence

Math.random() for a secret

0%
of repos
0
findings
0
median per affected repo

13% confirmed in a hand check of 8 · 81 more hidden as low confidence

Container configured to run as root

0%
of repos
0
findings
0
median per affected repo

10% confirmed in a hand check of 21 · 68 more hidden as low confidence

Docs use the wrong package manager

0%
of repos
0
findings
0
median per affected repo

17% confirmed in a hand check of 6 · 66 more hidden as low confidence

pull_request_target checks out PR code

0%
of repos
0
findings
0
median per affected repo

29% confirmed in a hand check of 7 · 62 more hidden as low confidence

Script injection in a workflow

0%
of repos
0
findings
0
median per affected repo

22% confirmed in a hand check of 9 · 61 more hidden as low confidence

How to fix

Pass the untrusted expression through an environment variable instead of splicing it into the script.

Before
- run: echo "${{ github.event.issue.title }}"
After
- run: echo "$TITLE"
  env:
    TITLE: ${{ github.event.issue.title }}

Expression engine evaluates a computed string

0%
of repos
0
findings
0
median per affected repo

not hand-checked yet · 42 more hidden as low confidence

Security value from Python's random module

0%
of repos
0
findings
0
median per affected repo

not hand-checked yet · 29 more hidden as low confidence

Dangerous Linux capability added

0%
of repos
0
findings
0
median per affected repo

17% confirmed in a hand check of 6 · 20 more hidden as low confidence