Commit 199fa44
feat: add OSV.dev dependency vulnerability analyzer (--use-osv) (#135)
* fix: recognize current ngrok tunnel domains and add bore.pub/serveo.net/localtunnel.me
ngrok migrated off ngrok.io to ngrok-free.dev / ngrok.app, so exfil to a
current ngrok endpoint slipped past the suspicious-domain checks. Add the
modern ngrok domains plus bore.pub, serveo.net and localtunnel.me to:
- ContextExtractor.SUSPICIOUS_DOMAINS (Python string-literal URL classification)
- tool_chaining_abuse_generic.yara / command_injection_generic.yara exfil dests
- cross_skill_scanner exfil pattern list
Add regression tests for the new domains (YARA true-positives + ContextExtractor).
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(static): flag unpinned dependencies in scanned skill packages
Skill packages are end-user applications, so unpinned dependencies
(requests>=2 or a bare requests) let a later, potentially compromised
release be pulled in at install time -- a supply-chain risk. Only the LLM
prompt mentioned this previously; there was no deterministic check.
Add StaticAnalyzer._check_dependency_pinning() which parses requirements*.txt
files and a manifest metadata "dependencies" list, emitting
SUPPLY_CHAIN_UNPINNED_DEPENDENCY (MEDIUM for open ranges/bare names, LOW for
==x.* wildcard pins). Skips when a lockfile (uv.lock/poetry.lock/...) is
present, since versions are already resolved -- this is why the scanner's own
library pinning policy (ranges in pyproject.toml) is not affected.
Register the rule in the core pack.yaml, document the new pass in the
static-analyzer docs and threat taxonomy, and add unit tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(static): classify URLs in config files via shared url_classifier
The suspicious/legitimate domain lists and matching logic previously lived
inside ContextExtractor and only ran over Python AST string literals, so a
tunnel/proxy endpoint hidden in a config value (e.g. base_url in config.yaml)
was never classified.
Refactor (behavior-preserving): extract SUSPICIOUS_DOMAINS/LEGITIMATE_DOMAINS
and the classification into skill_scanner/core/static_analysis/url_classifier.py
(classify_url + extract_urls). ContextExtractor imports from it and keeps the
lists as class attributes for backward compatibility; existing suspicious-URL
behavior is unchanged (covered by refactor-safety tests).
New pass: StaticAnalyzer._scan_config_files() parses config.yaml/.yml/.json,
settings.*, and *.toml (regex fallback on parse failure), runs each URL through
the shared classifier, and emits CONFIG_SUSPICIOUS_URL (HIGH). Registered in
the core pack.yaml.
Docs updated (static-analyzer, behavioral-analyzer). Adds unit tests plus a
labeled config-routed exfil eval sample; benchmark stays at 100% P/R.
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(static): scan config files via raw URL extraction
Collapse the structured YAML/JSON/TOML parse-and-walk in config URL
scanning down to a single raw-text extract_urls() pass. The raw scan is
simpler, drops the json/yaml/tomllib imports and the _iter_string_values
recursion, and additionally catches suspicious URLs hidden in config
comments. classify_url() still only flags known tunnel/exfil domains, so
false-positive risk stays low.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(static): scan more manifest formats for unpinned dependencies
Extend the unpinned-dependency check beyond requirements*.txt and
manifest metadata to also read pyproject.toml ([project] dependencies
and optional-dependencies), setup.cfg ([options] install_requires /
extras), setup.py (install_requires literals via AST), and Pipfile
([packages]/[dev-packages]). All sources are normalized to requirement
strings and run through the existing classifier, so a lockfile still
suppresses findings and pinned specs stay clean.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat: add OSV dependency vulnerability analyzer (--use-osv)
Add an opt-in external analyzer that checks a skill's pinned Python
dependencies against the free, open OSV.dev vulnerability database. Follows
the established external-analyzer pattern (like VirusTotal): no API key, and
it fails open so a network error never breaks a scan.
- OSVAnalyzer parses requirements*.txt and manifest metadata dependencies,
queries only exact (==) pins via OSV querybatch, and emits
SUPPLY_CHAIN_KNOWN_VULNERABILITY (HIGH) with advisory IDs/links.
- Wire use_osv through analyzer_factory, the CLI (--use-osv), the API router
(use_osv on JSON + upload endpoints), and the setup wizard.
- Uses httpx (already a dependency): zero new runtime dependencies.
Tests mock all OSV HTTP calls (no live network). Adds a deep-dive doc and
updates the analyzer selection guide, analyzer index, CLI/API references, and
configuration/dependency references.
Co-authored-by: Cursor <cursoragent@cursor.com>
* feat(osv): collect pinned dependencies from more manifest formats
Extend OSV pin collection beyond requirements*.txt and manifest metadata
to also read pyproject.toml, setup.cfg, setup.py (install_requires via
AST), and Pipfile. Only exact == pins are queried against OSV; ranges are
left to the static unpinned-dependency check.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(llm): allow Vertex AI to use ambient Application Default Credentials
ProviderConfig.validate() required a truthy credential for every provider
except Bedrock and Ollama, and the only credential source it checked for
Vertex was GOOGLE_APPLICATION_CREDENTIALS. This blocked ambient auth via
a GCE/Cloud Run attached service account or Workload Identity, even though
LiteLLM/google-auth already fall back to it automatically when no explicit
credential is passed -- the same pattern already supported for Bedrock's
IAM role. Excludes is_vertex from the check, mirroring the Bedrock/Ollama
precedent, and documents the fallback.
* Bumps to resolve security findings
* fix(llm): don't leak Vertex ADC credential path into GEMINI_API_KEY
- _resolve_api_key() now returns None for Vertex instead of the
GOOGLE_APPLICATION_CREDENTIALS path, since vertex_ai/gemini-* models
set both is_vertex and is_gemini, which was causing the file path to
be written into GEMINI_API_KEY.
- Regenerated configuration-reference.md via generate_reference_docs.py
instead of hand-editing, and updated the underlying descriptions so
the doc doesn't drift on next regeneration.
Addresses CodeRabbit review feedbak on #144.
* revert unrelated cli-command-reference.md regeneration
* fix(static): classify suspicious URLs by hostname
* fix(static): tolerate malformed setup.py input
* docs(static): correct analyzer pass count
* fix(static): validate suspicious URL schemes
* docs(vertex): clarify conditional ADC configuration
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: gyrospectre <7224858+gyrospectre@users.noreply.github.com>
Co-authored-by: Vineeth Sai Narajala <vnarajal@cisco.com>1 parent 0f44aff commit 199fa44
15 files changed
Lines changed: 697 additions & 3 deletions
File tree
- docs
- architecture/analyzers
- reference
- skill_scanner
- api
- cli
- core
- analyzers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
108 | 121 | | |
| 122 | + | |
109 | 123 | | |
110 | | - | |
| 124 | + | |
111 | 125 | | |
112 | 126 | | |
113 | 127 | | |
| |||
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
| 145 | + | |
131 | 146 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
| 161 | + | |
159 | 162 | | |
160 | 163 | | |
161 | 164 | | |
| |||
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| 274 | + | |
| 275 | + | |
271 | 276 | | |
272 | 277 | | |
273 | 278 | | |
| |||
384 | 389 | | |
385 | 390 | | |
386 | 391 | | |
| 392 | + | |
| 393 | + | |
387 | 394 | | |
388 | 395 | | |
389 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
| |||
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| 255 | + | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
| |||
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| 302 | + | |
300 | 303 | | |
301 | 304 | | |
302 | 305 | | |
| |||
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| 319 | + | |
316 | 320 | | |
317 | 321 | | |
318 | 322 | | |
| |||
425 | 429 | | |
426 | 430 | | |
427 | 431 | | |
| 432 | + | |
428 | 433 | | |
429 | 434 | | |
430 | 435 | | |
| |||
505 | 510 | | |
506 | 511 | | |
507 | 512 | | |
| 513 | + | |
508 | 514 | | |
509 | 515 | | |
510 | 516 | | |
| |||
598 | 604 | | |
599 | 605 | | |
600 | 606 | | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
684 | 691 | | |
685 | 692 | | |
686 | 693 | | |
| 694 | + | |
687 | 695 | | |
688 | 696 | | |
689 | 697 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
946 | 949 | | |
947 | 950 | | |
948 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
949 | 957 | | |
950 | 958 | | |
951 | 959 | | |
| |||
0 commit comments