Find the holes before someone else does. A fast, 100% Rust vulnerability scanner: XSS, SQL injection, leaked secrets, dependency CVEs and AI agent setups.
Rust ai-agentsclaude-codeclaude-code-pluginclicodexcursordevsecopsmcposvowasprustsastsecret-scanningsecretssecuritysecurity-scannersql-injectionvulnerabilityvulnerability-scannerxss
Read Pipfile.lock for the dependency check (#124)
Prashant08ea48f06868
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex be75497..a910440 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -95,6 +95,7 @@`list_rules` tool include each rule's `fix`.- CLI: `safe-anything --help` now shows a few examples, including `safe-anything mcp`, and how to ignore a finding (`safe-anything:ignore` or `.safe-anything-ignore`).- Secrets: new rule `secret.google-oauth-secret` (high) for Google OAuth client secrets (`GOCSPX-` followed by 28 letters, digits, `_` or `-`).+- Dependencies: `Pipfile.lock` is read, so Pipenv projects are checked against OSV.dev (`PyPI` ecosystem), `default` and `develop` packages alike. Entries from git, a path or an editable install are skipped.## 1.0.2 (2026-11-23)diff --git a/README.md b/README.mdindex 490dc60..f847ec1 100644--- a/README.md+++ b/README.md@@ -114,7 +114,7 @@ The full list is in [docs/rules.md](docs/rules.md).| **Agent setups** | `bypassPermissions` and `--dangerously-skip-permissions`, pre-approved `Bash`, `enableAllProjectMcpServers`, MCP servers run with unpinned `npx`/`uvx`/`docker`, MCP tokens in plain text, remote MCP over `http://`, `curl \| sh` in hooks and skills, prompt-injection text, skills that read `~/.ssh` or cloud credentials, invisible Unicode in instructions. [More](docs/agent-setups.md) || **Mobile** | Android `debuggable`, `allowBackup`, cleartext traffic, exported content providers, WebView file access and JS bridges, world-readable files; iOS ATS turned off; tokens in UserDefaults, SharedPreferences, AsyncStorage or localStorage || **Config** | Docker (unpinned base, root, secrets in `ENV`, `ADD <url>`), `curl \| sh` in scripts, Dockerfiles and workflow `run:` steps, GitHub Actions (`pull_request_target`, `write-all`, actions on `@main`, script injection from PR titles), privileged containers, `hostNetwork`, Terraform (open ingress, public buckets, S3 public access blocks turned off, public or unencrypted databases), nginx autoindex, TLS 1.0/1.1 |-| **Dependencies** | every locked version in `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, `pnpm-lock.yaml`, `Cargo.lock`, `requirements*.txt`, `poetry.lock`, `uv.lock`, `pdm.lock`, `go.mod`, `Gemfile.lock`, `composer.lock` and `pubspec.lock`, checked against [OSV.dev](https://osv.dev), with the nearest fixed version |+| **Dependencies** | every locked version in `package-lock.json`, `npm-shrinkwrap.json`, `yarn.lock`, `pnpm-lock.yaml`, `Cargo.lock`, `requirements*.txt`, `poetry.lock`, `uv.lock`, `pdm.lock`, `Pipfile.lock`, `go.mod`, `Gemfile.lock`, `composer.lock` and `pubspec.lock`, checked against [OSV.dev](https://osv.dev), with the nearest fixed version |<p align="center"><img src="docs/assets/nextjs-public-env.gif" alt="safe-anything on the with-mqtt-js example from the Next.js repository: 2 high findings, an MQTT password read from a NEXT_PUBLIC_ variable in app/page.tsx and environment.d.ts, which Next.js ships in the client bundle." width="820">diff --git a/src/deps.rs b/src/deps.rsindex 03f54a4..c7fde87 100644--- a/src/deps.rs+++ b/src/deps.rs@@ -48,6 +48,7 @@ pub fn parse_lockfile(file: &FileInfo, text: &str) -> Vec<Package> {"go.mod" => go_mod(file, text),"gemfile.lock" => gemfile_lock(file, text),"composer.lock" => composer_lock(file, text),+ "pipfile.lock" => pipfile_lock(file, text),"pubspec.lock" => pubspec_lock(file, text),n if n.starts_with("requirements") && n.ends_with(".txt") => requirements(file, text),_ => Vec::new(),@@ -277,6 +278,36 @@ fn composer_lock(file: &FileInfo, text: &str) -> Vec<Package> {out}+fn pipfile_lock(file: &FileInfo, text: &str) -> Vec<Package> {+ let Ok(json) = serde_json::from_str::<Value>(text) else {+ return Vec::new();+ };+ let mut out = Vec::new();+ for key in ["default", "develop"] {+ let Some(map) = json.get(key).and_then(Value::as_object) else {+ continue;+ };+ let mut cursor = text.find(&format!("\"{key}\"")).unwrap_or(0);+ for (n, p) in map {+ let at = find_from(text, &mut cursor, &format!("\"{n}\""));+ // A git, path, file or editable entry is not fetched from PyPI.+ let local = ["git", "path", "file", "editable"]+ .iter()+ .any(|k| p.get(k).is_some());+ if let (Some(v), false) = (p.get("version").and_then(Value::as_str), local) {+ out.push(pkg(+ "PyPI",+ n,+ v,+ file,+ line_of(text, find_after(text, at, "\"version\"")),+ ));+ }+ }+ }+ out+}+fn pubspec_lock(file: &FileInfo, text: &str) -> Vec<Package> {let mut out = Vec::new();let mut sdk = HashSet::new();diff --git a/tests/fixtures/deps/EXPECTED b/tests/fixtures/deps/EXPECTEDindex c642bf6..c3ddcb2 100644--- a/tests/fixtures/deps/EXPECTED+++ b/tests/fixtures/deps/EXPECTED@@ -9,3 +9,4 @@ uv/uv.lock:6 dependency.known-vulnerabilitydart/pubspec.lock:24 dependency.known-vulnerabilityyarn/yarn.lock:6 dependency.known-vulnerabilitypy/poetry.lock:5 dependency.known-vulnerability+pipenv/Pipfile.lock:22 dependency.known-vulnerabilitydiff --git a/tests/fixtures/deps/pipenv/Pipfile.lock b/tests/fixtures/deps/pipenv/Pipfile.locknew file mode 100644index 0000000..c4f7bfc--- /dev/null+++ b/tests/fixtures/deps/pipenv/Pipfile.lock@@ -0,0 +1,38 @@+{+ "_meta": {+ "hash": {+ "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"+ },+ "pipfile-spec": 6,+ "requires": {+ "python_version": "3.8"+ },+ "sources": [+ {+ "name": "pypi",+ "url": "https://pypi.org/simple",+ "verify_ssl": true+ }+ ]+ },+ "default": {+ "requests": {+ "hashes": [],+ "index": "pypi",+ "version": "==2.19.0"+ }+ },+ "develop": {+ "pytest": {+ "hashes": [],+ "index": "pypi",+ "version": "==7.4.0"+ },+ "requests": {+ "editable": true,+ "git": "https://github.com/psf/requests.git",+ "ref": "0e322af87745eff34caffe4df68456ebc20d9068",+ "version": "==2.19.0"+ }+ }+}diff --git a/tests/scan.rs b/tests/scan.rsindex d2be4f0..398bd11 100644--- a/tests/scan.rs+++ b/tests/scan.rs@@ -273,7 +273,8 @@ fn deps() {};// Entries that are not fetched from a registry must be skipped (not counted// as a dependency): the `my-app@workspace:.` entry in web/yarn.lock, and the- // gems in the `GIT` and `PATH` sections of rb/Gemfile.lock. Only the gems in- // its two `GEM` sections count.- check_with("deps", options, Some(25));+ // gems in the `GIT` and `PATH` sections of rb/Gemfile.lock, and the editable+ // git checkout of `requests` in pipenv/Pipfile.lock. Only the gems in its two+ // `GEM` sections count.+ check_with("deps", options, Some(27));}