Skip to content

Commit 44c08a9

Browse files
fix: exclude valid OMS signatures from content analysis
OMS bundles necessarily contain long base64-encoded payload, signature, and certificate fields. Generic obfuscated-code checks can misclassify these fields as hidden executable content. Recognize root-level skill.oms.sig files with the minimal OMS v0.3 DSSE/in-toto structure and inventory them as oms_signature components without sending their contents through static or LLM analyzers. Preserve normal scanning for malformed, nested, oversized, or unrecognized signature files. Add a pinned real-world fixture, regression coverage, completeness accounting, and documentation. Recognition is structural only and does not verify signatures, certificates, transparency logs, or signer identity. Signed-off-by: major-security <[email protected]>
1 parent dde36f2 commit 44c08a9

13 files changed

Lines changed: 270 additions & 14 deletions

‎README.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,10 +651,18 @@ SkillSpector uses a two-stage detection pipeline:
651651
- Fast regex-based pattern matching across 11 static analyzers
652652
- AST-based behavioral analysis detecting dangerous calls (exec, eval, subprocess, etc.)
653653
- Live vulnerability lookups via OSV.dev for known CVEs in dependencies
654-
- Scans all files in the skill
654+
- Scans all analyzer-eligible files in the skill
655655
- High recall (catches most issues)
656656
- Moderate precision (some false positives)
657657

658+
A valid, root-level OpenSSF Model Signing signature (`skill.oms.sig`) is retained in the
659+
component inventory as type `oms_signature`, but excluded from static and LLM content analysis.
660+
OMS bundles necessarily contain long base64-encoded payload, signature, and certificate fields;
661+
generic obfuscated-code checks can otherwise misclassify those fields as hidden executable content.
662+
The recognizer checks the minimal OMS DSSE/in-toto structure; it does not verify the signature,
663+
certificate chain, transparency-log entry, or signer identity. Invalid or unrecognized signature
664+
files are scanned normally.
665+
658666
### Stage 2: LLM Semantic Analysis (Optional)
659667
- Evaluates context and intent
660668
- Filters false positives
@@ -679,7 +687,7 @@ The tool requires outbound HTTPS access to `api.osv.dev` for live vulnerability
679687
SkillSpector is defense-in-depth, not a sandbox. Know what it does and does not do before relying on it:
680688

681689
- **It never executes the scanned skill.** All analysis is static (regex, Python AST, YARA) plus optional LLM evaluation of file *contents* — the skill's code is never run.
682-
- **LLM analysis sends file contents to the configured provider.** When LLM analysis is enabled (the default), file contents are sent to the active `SKILLSPECTOR_PROVIDER` endpoint. Use `--no-llm` to keep contents local (static analysis only).
690+
- **LLM analysis sends analyzer-eligible file contents to the configured provider.** When LLM analysis is enabled (the default), file contents are sent to the active `SKILLSPECTOR_PROVIDER` endpoint. Recognized OMS signature files are excluded. Use `--no-llm` to keep contents local (static analysis only).
683691
- **SC4 sends dependency names to OSV.dev.** The supply-chain check queries [OSV.dev](https://osv.dev) with the package names and versions the skill declares, to look up known CVEs. This is fundamental to the check and runs even with `--no-llm`. It sends dependency coordinates (not file contents), requires no API key, and falls back to a bundled list when OSV.dev is unreachable.
684692
- **It does not sandbox the host.** SkillSpector flags risky patterns *before* you install a skill; it does not contain or isolate a skill you choose to install anyway.
685693

‎docs/DEVELOPMENT.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ All targets assume the virtual environment is **already created and activated**.
7979
| `zip_bytes`, `mode` | Optional zip input and scan mode |
8080
| `components` | List of relative file paths in the skill |
8181
| `file_cache` | Map of path → file contents |
82+
| `analysis_excluded_components` | Inventoried paths intentionally withheld from analyzers (for example, a recognized OMS signature) |
8283
| `ast_cache` | Map of path → AST representation (for future use) |
8384
| `manifest`, `previous_manifest` | Parsed skill metadata (e.g. from SKILL.md) |
8485
| `component_metadata` | List of dicts: path, type, lines, executable, size_bytes (from build_context) |

‎src/skillspector/constants.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
DEFAULT_CONTEXT_LENGTH = 128_000
2929
# Risk score threshold above which a scan is treated as unsafe.
3030
RISK_THRESHOLD = 50
31+
# Maximum text-file size processed by static analyzers and lightweight
32+
# format recognizers.
33+
MAX_FILE_BYTES = 1_000_000
3134

3235
# Default-model selection lives on each provider (see providers/<name>/provider.py
3336
# for ``DEFAULT_MODEL`` and ``SLOT_DEFAULTS``). The active provider's

‎src/skillspector/nodes/analyzers/semantic_security_discovery.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ def node(state: SkillspectorState) -> AnalyzerNodeResponse:
7575
return {"findings": []}
7676

7777
file_cache: dict[str, str] = state.get("file_cache") or {}
78-
components: list[str] = state.get("components") or sorted(file_cache.keys())
78+
requested_components: list[str] = state.get("components") or sorted(file_cache.keys())
79+
# Components intentionally excluded from file_cache (for example a
80+
# recognized OMS signature) must not become placeholder LLM batches.
81+
components = [path for path in requested_components if path in file_cache]
7982
if not components:
8083
return {"findings": []}
8184

‎src/skillspector/nodes/analyzers/static_runner.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import re
2121
from collections.abc import Callable
2222

23+
from skillspector.constants import MAX_FILE_BYTES
2324
from skillspector.logging_config import get_logger
2425
from skillspector.models import AnalyzerFinding, Finding
2526

@@ -48,7 +49,6 @@
4849
".rs": "rust",
4950
}
5051

51-
MAX_FILE_BYTES = 1_000_000
5252
_EVAL_DATASET_FILES = {
5353
"evals/evals.json",
5454
"evals/evals.jsonl",

‎src/skillspector/nodes/build_context.py‎

Lines changed: 94 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,15 @@
2121

2222
from __future__ import annotations
2323

24+
import base64
25+
import binascii
26+
import json
2427
import re
2528
from pathlib import Path
2629

2730
import yaml
2831

29-
from skillspector.constants import MODEL_CONFIG
32+
from skillspector.constants import MAX_FILE_BYTES, MODEL_CONFIG
3033
from skillspector.logging_config import get_logger
3134
from skillspector.state import SkillspectorState
3235

@@ -60,6 +63,12 @@
6063
{".py", ".sh", ".bash", ".zsh", ".js", ".ts", ".rb", ".go", ".rs", ".pl"}
6164
)
6265

66+
_OMS_SIGNATURE_PATH = "skill.oms.sig"
67+
_SIGSTORE_BUNDLE_MEDIA_TYPE = "application/vnd.dev.sigstore.bundle.v0.3+json"
68+
_IN_TOTO_PAYLOAD_TYPE = "application/vnd.in-toto+json"
69+
_IN_TOTO_STATEMENT_TYPE = "https://in-toto.io/Statement/v1"
70+
_OMS_PREDICATE_TYPE = "https://model_signing/signature/v1.0"
71+
6372

6473
def _resolve_skill_dir(state: SkillspectorState) -> Path:
6574
"""Resolve state skill_path to an existing directory Path."""
@@ -108,6 +117,68 @@ def _infer_file_type(path: str) -> str:
108117
return _FILE_TYPES.get(suffix, "other")
109118

110119

120+
def _decode_base64_json(value: object) -> dict[str, object] | None:
121+
"""Decode a strict base64 JSON object, returning ``None`` on malformed input."""
122+
if not isinstance(value, str) or not value:
123+
return None
124+
try:
125+
decoded = base64.b64decode(value, validate=True)
126+
parsed = json.loads(decoded.decode("utf-8"))
127+
except (binascii.Error, UnicodeDecodeError, json.JSONDecodeError):
128+
return None
129+
return parsed if isinstance(parsed, dict) else None
130+
131+
132+
def _is_valid_oms_signature(file_path: Path) -> bool:
133+
"""Recognize the minimal root-level OMS DSSE/in-toto signature structure.
134+
135+
This intentionally does not parse verification material or verify the
136+
cryptographic signature. Its purpose is to distinguish detached OMS
137+
metadata from agent-facing content before analyzers inspect the skill.
138+
"""
139+
try:
140+
if file_path.stat().st_size > MAX_FILE_BYTES:
141+
return False
142+
content = file_path.read_text(encoding="utf-8")
143+
bundle = json.loads(content)
144+
except (OSError, UnicodeDecodeError, json.JSONDecodeError):
145+
return False
146+
147+
if not isinstance(bundle, dict):
148+
return False
149+
if bundle.get("mediaType") != _SIGSTORE_BUNDLE_MEDIA_TYPE:
150+
return False
151+
if not isinstance(bundle.get("verificationMaterial"), dict):
152+
return False
153+
154+
envelope = bundle.get("dsseEnvelope")
155+
if not isinstance(envelope, dict):
156+
return False
157+
if envelope.get("payloadType") != _IN_TOTO_PAYLOAD_TYPE:
158+
return False
159+
160+
signatures = envelope.get("signatures")
161+
if not isinstance(signatures, list) or len(signatures) != 1:
162+
return False
163+
signature = signatures[0]
164+
if not isinstance(signature, dict):
165+
return False
166+
signature_bytes = signature.get("sig")
167+
if not isinstance(signature_bytes, str) or not signature_bytes:
168+
return False
169+
try:
170+
base64.b64decode(signature_bytes, validate=True)
171+
except (binascii.Error, ValueError):
172+
return False
173+
174+
statement = _decode_base64_json(envelope.get("payload"))
175+
return bool(
176+
statement
177+
and statement.get("_type") == _IN_TOTO_STATEMENT_TYPE
178+
and statement.get("predicateType") == _OMS_PREDICATE_TYPE
179+
)
180+
181+
111182
def _count_lines(file_path: Path) -> int:
112183
"""Count lines in a file, handling binary and errors gracefully."""
113184
try:
@@ -119,7 +190,9 @@ def _count_lines(file_path: Path) -> int:
119190

120191

121192
def _build_component_metadata(
122-
skill_dir: Path, components: list[str]
193+
skill_dir: Path,
194+
components: list[str],
195+
recognized_oms_signatures: frozenset[str] = frozenset(),
123196
) -> tuple[list[dict[str, object]], bool]:
124197
"""Build component_metadata list and has_executable_scripts from paths."""
125198
metadata: list[dict[str, object]] = []
@@ -129,7 +202,7 @@ def _build_component_metadata(
129202
if not full.is_file():
130203
continue
131204
suffix = full.suffix.lower()
132-
file_type = _infer_file_type(path)
205+
file_type = "oms_signature" if path in recognized_oms_signatures else _infer_file_type(path)
133206
lines = _count_lines(full)
134207
executable = suffix in _EXECUTABLE_EXTENSIONS
135208
if executable:
@@ -151,10 +224,16 @@ def _build_component_metadata(
151224
return metadata, has_executable
152225

153226

154-
def _read_file_cache(skill_dir: Path, components: list[str]) -> dict[str, str]:
227+
def _read_file_cache(
228+
skill_dir: Path,
229+
components: list[str],
230+
excluded_paths: frozenset[str] = frozenset(),
231+
) -> dict[str, str]:
155232
"""Build file_cache: relative path -> file contents. Uses utf-8 with replace for errors."""
156233
file_cache: dict[str, str] = {}
157234
for path in components:
235+
if path in excluded_paths:
236+
continue
158237
full = skill_dir / path
159238
if not full.is_file():
160239
continue
@@ -236,13 +315,22 @@ def build_context(state: SkillspectorState) -> dict[str, object]:
236315
skill_dir = _resolve_skill_dir(state)
237316

238317
components = _walk_skill_files(skill_dir)
239-
file_cache = _read_file_cache(skill_dir, components)
318+
recognized_oms_signatures = frozenset(
319+
{_OMS_SIGNATURE_PATH}
320+
if _OMS_SIGNATURE_PATH in components
321+
and _is_valid_oms_signature(skill_dir / _OMS_SIGNATURE_PATH)
322+
else set()
323+
)
324+
file_cache = _read_file_cache(skill_dir, components, recognized_oms_signatures)
240325
manifest = _parse_manifest(skill_dir)
241-
component_metadata, has_executable_scripts = _build_component_metadata(skill_dir, components)
326+
component_metadata, has_executable_scripts = _build_component_metadata(
327+
skill_dir, components, recognized_oms_signatures
328+
)
242329

243330
return {
244331
"components": components,
245332
"file_cache": file_cache,
333+
"analysis_excluded_components": sorted(recognized_oms_signatures),
246334
"ast_cache": {},
247335
"manifest": manifest,
248336
"previous_manifest": None,

‎src/skillspector/nodes/report.py‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,21 +495,26 @@ def _build_analysis_completeness(
495495
use_llm: bool,
496496
findings_pre_filter: list[Finding],
497497
findings_post_filter: list[Finding],
498+
excluded_components: list[str] | None = None,
498499
) -> dict[str, object]:
499500
"""Build analysis_completeness section indicating scan coverage and limitations.
500501
501502
Helps consumers understand what was NOT analyzed and whether findings
502503
can be trusted as comprehensive.
503504
"""
505+
excluded = frozenset(excluded_components or [])
504506
total_components = len(components)
505-
scanned_components = sum(1 for c in components if c in file_cache)
507+
missing_components = [c for c in components if c not in file_cache and c not in excluded]
508+
# Intentionally excluded metadata is fully accounted for by the scan even
509+
# though analyzers do not inspect its content.
510+
scanned_components = total_components - len(missing_components)
506511

507512
llm_available, llm_error = is_llm_available()
508513
llm_used = use_llm and llm_available
509514

510515
limitations: list[str] = []
511-
if scanned_components < total_components:
512-
skipped = total_components - scanned_components
516+
if missing_components:
517+
skipped = len(missing_components)
513518
limitations.append(f"{skipped} component(s) had no content in file_cache (skipped)")
514519
if use_llm and not llm_available:
515520
limitations.append(f"LLM meta-analysis unavailable: {llm_error or 'unknown reason'}")
@@ -727,7 +732,12 @@ def report(state: SkillspectorState) -> dict[str, object]:
727732
)
728733
sarif_report = _build_sarif(active_findings, suppressed, degraded_notice=degraded_notice)
729734
analysis_completeness = _build_analysis_completeness(
730-
components, file_cache, use_llm, raw_findings, filtered_findings
735+
components,
736+
file_cache,
737+
use_llm,
738+
raw_findings,
739+
filtered_findings,
740+
state.get("analysis_excluded_components") or [],
731741
)
732742

733743
# Fail closed on a degraded deep scan: when the LLM stage was requested but

‎src/skillspector/state.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ class SkillspectorState(TypedDict, total=False):
3939
# build_context node populates these
4040
components: list[str]
4141
file_cache: dict[str, str]
42+
# Components inventoried for reporting but intentionally omitted from all
43+
# analyzer inputs (for example, a recognized root-level OMS signature).
44+
analysis_excluded_components: list[str]
4245
ast_cache: dict[str, str]
4346
manifest: dict[str, object]
4447
previous_manifest: dict[str, object] | None
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"mediaType":"application/vnd.dev.sigstore.bundle.v0.3+json","verificationMaterial":{"x509CertificateChain":{"certificates":[{"rawBytes":"MIICgzCCAgmgAwIBAgIUKIyS7SxNteQIiWzK1dWj85E6520wCgYIKoZIzj0EAwMwVTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjEpMCcGA1UEAwwgTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBJQ0EgMDEwHhcNMjYwNDAxMDAwMDAwWhcNMjgwNDIyMTUzMzA5WjBUMQswCQYDVQQGEwJVUzEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMSgwJgYDVQQDDB9OVklESUEgQWdlbnQgU2tpbGxzIFNpZ25pbmcgMDAxMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEYoRM9bQl/d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FcwQQZlk19LOAbyGMRixbu2Ww/rj"}]},"tlogEntries":[]},"dsseEnvelope":{"payload":"ewogICJfdHlwZSI6ICJodHRwczovL2luLXRvdG8uaW8vU3RhdGVtZW50L3YxIiwKICAic3ViamVjdCI6IFsKICAgIHsKICAgICAgIm5hbWUiOiAibWNvcmUtc3BsaXQtcHIiLAogICAgICAiZGlnZXN0IjogewogICAgICAgICJzaGEyNTYiOiAiNWMzNDc0ZGViZWJhOWYxYWNlYTg0Y2ZjNGJhMmY4YzA0MGExMTU2YWFkYjhlMjlmMzhlZGZiMTgxMTE1Y2JkMiIKICAgICAgfQogICAgfQogIF0sCiAgInByZWRpY2F0ZVR5cGUiOiAiaHR0cHM6Ly9tb2RlbF9zaWduaW5nL3NpZ25hdHVyZS92MS4wIiwKICAicHJlZGljYXRlIjogewogICAgInNlcmlhbGl6YXRpb24iOiB7CiAgICAgICJhbGxvd19zeW1saW5rcyI6IGZhbHNlLAogICAgICAiaWdub3JlX3BhdGhzIjogWwogICAgICAgICIuZ2l0YXR0cmlidXRlcyIsCiAgICAgICAgIi5naXRodWIiLAogICAgICAgICIuZ2l0IiwKICAgICAgICAiLmdpdGlnbm9yZSIKICAgICAgXSwKICAgICAgIm1ldGhvZCI6ICJmaWxlcyIsCiAgICAgICJoYXNoX3R5cGUiOiAic2hhMjU2IgogICAgfSwKICAgICJyZXNvdXJjZXMiOiBbCiAgICAgIHsKICAgICAgICAiZGlnZXN0IjogIjUxOWRmZDI1NGQ3NDU4MzJlYWU5MzRhNGNjOThlZGExN2NjYzljNGQ0MjgwM2U2MzJiYmE2OTJkMjE3ZjIwODciLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAibmFtZSI6ICJCRU5DSE1BUksubWQiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiZGlnZXN0IjogIjBmM2Q0MDkyMmQzYzU3ZWI2ZWJhMWVkNzRiOGI2Y2RiM2U4N2E0NjljMWU2YWZkNDE1NDFkMmZlZDcyZTIxYTAiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAibmFtZSI6ICJTS0lMTC5tZCIKICAgICAgfSwKICAgICAgewogICAgICAgICJkaWdlc3QiOiAiMzc1MTdlNWYzZGM2NjgxOWY2MWY1YTdiYjhhY2UxOTIxMjgyNDE1ZjEwNTUxZDJkZWZhNWMzZWIwOTg1YjU3MCIsCiAgICAgICAgImFsZ29yaXRobSI6ICJzaGEyNTYiLAogICAgICAgICJuYW1lIjogImV2YWxzL2V2YWxzLmpzb24iCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiZGlnZXN0IjogImJjY2MxZTk0YWJmZDc0NDcyMjdjZmU5MDg0N2U1MTE5YWJiMTA0Y2UzOGE0NzAxYmIzYjVkM2JlOWRjYjVlZGIiLAogICAgICAgICJhbGdvcml0aG0iOiAic2hhMjU2IiwKICAgICAgICAibmFtZSI6ICJza2lsbC1jYXJkLm1kIgogICAgICB9CiAgICBdCiAgfQp9","payloadType":"application/vnd.in-toto+json","signatures":[{"sig":"MGQCMBexfplum16efCE5Z+c2uymUa1slPFLC+0CJV5i+Gl9DZnzsUStO5pEnlz5N/BlL8wIwS9tDLOLlxp0c0vYTjV2EEnVRv1zjrnHxUbD2jFrZpE7my7zwTcRW28UWqWBS3N6H","keyid":""}]}}

‎tests/integration/test_graph.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,34 @@ def test_graph_invoke_with_output_format_json(tmp_path: Path) -> None:
4242
assert "components" in data
4343

4444

45+
def test_graph_excludes_valid_oms_signature_from_static_findings(tmp_path: Path) -> None:
46+
"""A real OMS signature remains inventoried without producing scan findings."""
47+
fixture = Path(__file__).parents[1] / "fixtures" / "oms" / "mcore-split-pr.skill.oms.sig"
48+
(tmp_path / "SKILL.md").write_text("---\nname: signed\n---\n# Signed\n", encoding="utf-8")
49+
(tmp_path / "skill.oms.sig").write_text(fixture.read_text(encoding="utf-8"), encoding="utf-8")
50+
51+
result = graph.invoke(
52+
{
53+
"skill_path": str(tmp_path),
54+
"output_format": "json",
55+
"use_llm": False,
56+
}
57+
)
58+
59+
report = json.loads(result["report_body"])
60+
signature_component = next(
61+
component for component in report["components"] if component["path"] == "skill.oms.sig"
62+
)
63+
assert signature_component["type"] == "oms_signature"
64+
assert report["analysis_completeness"]["coverage_percent"] == 100.0
65+
assert not any(
66+
"no content in file_cache" in limitation
67+
for limitation in (report["analysis_completeness"]["limitations"] or [])
68+
)
69+
assert all(finding.file != "skill.oms.sig" for finding in result["findings"])
70+
assert all(issue["file"] != "skill.oms.sig" for issue in report["issues"])
71+
72+
4573
def test_graph_invoke_returns_findings_and_report(tmp_path: Path) -> None:
4674
"""Graph runs to completion; returns findings, SARIF report, report_body, risk_score."""
4775
result = graph.invoke({"skill_path": str(tmp_path), "use_llm": False})

0 commit comments

Comments
 (0)