Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(security): accept verified referenced images in partial SkillSpector scans (#299)
Narendran Raghavanf4287e38f1f6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 0ceae299..c0759702 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -432,6 +432,22 @@ All notable changes to SkillEvaluator are documented in this file.`quality-check` before any report was written. The schema check reports themalformed `metadata`, and the quality score counts `metadata.author` and`metadata.tags` as missing, as it already did for other non-mapping values.+- The Tier 1 SkillSpector scan of a skill that references PNG or JPEG images,+ such as a logo shown with ``, is no longer+ `INCOMPLETE` only because SkillSpector's text pattern analyzers cannot read+ images and report the analysis as `partial`. That gap is now a warning when+ the report shows no other gap and no fatal scope exclusion, and each image+ is a regular, single-link (not hard-linked), non-executable file whose bytes+ have the chunk or marker structure of a PNG or JPEG, is not reached through+ a symlink, and is not in a directory that agents run, load as instructions+ or read as configuration. The gap is accepted for at most 256 images and+ 128 MiB of image data in total. The structure check corroborates the file+ type without decoding the image or proving that it renders. PNG IDAT+ compressed data and ancillary chunks, and JPEG entropy-coded data and APPn+ or COM segments, are not inspected and can still carry other bytes. Other+ image formats, files without that structure, and every other partial reason+ still leave the scan `INCOMPLETE`. SkillSpector's own High `AE1` findings for+ images it could not inspect are unchanged.- A `SKILL.md` over the recommended 5,000-token budget now gets a MEDIUM`quality_efficiency` finding instead of a HIGH one. The HIGH finding failedthe quality check, and with it `validate`, `tier1`, and `quality-check`, evendiff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdxindex 2f2d7dc8..c92402a3 100644--- a/docs/tier1-validation.mdx+++ b/docs/tier1-validation.mdx@@ -178,6 +178,8 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `liceThe LLM pass requires a configured provider. It enriches the static result but does not replace static findings or make missing scanner evidence pass.+ SkillSpector's text pattern analyzers cannot read images, so it reports the analysis of a skill that references a PNG or JPEG file as `partial`. SkillEvaluator accepts that gap with a warning instead of `INCOMPLETE` only when the report shows no other gap and no fatal scope exclusion, and each referenced image is a regular, single-link (not hard-linked), non-executable file whose bytes have the chunk structure of a PNG or the marker structure of a JPEG and that is not reached through a symlink. The gap is accepted for at most 256 images and 128 MiB of image data in total. An image is never accepted inside a `hooks`, `scripts`, `tools`, `agents`, `commands`, `prompts`, `rules`, `team-rules` or `workflows` directory at any depth, or under a top-level `config`, `skills`, `.mcp`, `.agents`, `.claude`, `.codex`, `.continue`, `.cursor`, `.gemini` or `.windsurf` directory (names compared without regard to case). The structure check corroborates the file type; it does not decode the image or prove that it renders. PNG IDAT compressed data and ancillary chunks, and JPEG entropy-coded data and APPn or COM segments, are not inspected and can still carry other bytes. The image content itself is not assessed. Any other partial reason still leaves the scan `INCOMPLETE`. SkillSpector also reports a High `AE1` (incomplete referenced artifact analysis) finding for such an image; from v2.12.0 it omits that finding when the skill renders a PNG with Markdown image syntax, such as ``. An `AE1` finding fails the check like any other High finding.+To explain why two otherwise identical `--llm` scans differ, the reports record the LLM provenance that SkillSpector v2.12.0 and later return. The Security result in the JSON report carries:- `skillspector_llm_provenance`: SkillSpector's provider adapter, the model and SkillSpector revision behind each LLM analyzer, the requested and forwarded temperature, seed, and reasoning-effort controls, and a determinism classification. Provider output is never guaranteed to be identical.diff --git a/src/skillevaluator/validators/security.py b/src/skillevaluator/validators/security.pyindex af7e5cee..7fb1884c 100644--- a/src/skillevaluator/validators/security.py+++ b/src/skillevaluator/validators/security.py@@ -20,12 +20,14 @@ import mathimport osimport reimport shutil+import structimport tempfileimport tokenizeimport unicodedata+import zlibfrom collections import Counterfrom collections.abc import Iterable, Mapping-from pathlib import Path+from pathlib import Path, PurePosixPathimport yamlfrom yaml.events import ScalarEvent@@ -49,6 +51,7 @@ from skillevaluator.provider_config import (from skillevaluator.skillspector_provenance import sanitize_skillspector_llm_provenancefrom skillevaluator.spdx import is_spdx_only_html_commentfrom skillevaluator.utils.path_security import matches_filesystem_name+from skillevaluator.utils.secure_fs import SecurePathError, SecureRootfrom skillevaluator.utils.tool_runner import Tools, parse_json_outputfrom skillevaluator.validators.base import (Finding,@@ -613,6 +616,356 @@ def _skillspector_scoring_match_identity(return ("finding", finding) if finding else ("row", index)+# SkillSpector's static pattern analyzers read text, so each records a referenced+# PNG or JPEG image as a nonfatal, whole-file limitation and the analysis becomes+# ``partial``; see :func:`_skillspector_passive_raster_note`.+_PASSIVE_RASTER_SUFFIXES = frozenset({".png", ".jpg", ".jpeg"})+_PASSIVE_RASTER_REASONS = frozenset({"binary_content", "opaque_content"})+_PASSIVE_RASTER_ANALYZER_RE = re.compile(r"static_patterns_[a-z0-9]+(?:_[a-z0-9]+)*")+# An image is not a passive asset when it sits in a directory whose files an+# agent runs or loads as instructions (at any depth), or under a top-level+# configuration, nested-skill or agent-settings directory.+_PASSIVE_RASTER_CONTROL_DIRS = frozenset(+ {"agents", "commands", "hooks", "prompts", "rules", "scripts", "team-rules", "tools", "workflows"}+)+_PASSIVE_RASTER_CONTROL_ROOTS = frozenset(+ {".agents", ".claude", ".codex", ".continue", ".cursor", ".gemini", ".mcp", ".windsurf", "config", "skills"}+)+_PASSIVE_RASTER_MAX_FILES = 256+_PASSIVE_RASTER_MAX_BYTES = 128 * 1024 * 1024+_PNG_SIGNATURE = b"\x89PNG\r\n\x1a\n"+# Bit depths the PNG specification allows for each colour type.+_PNG_BIT_DEPTHS = {0: {1, 2, 4, 8, 16}, 2: {8, 16}, 3: {1, 2, 4, 8}, 4: {8, 16}, 6: {8, 16}}+# JPEG start-of-frame markers SOF0-SOF3, SOF5-SOF7, SOF9-SOF11 and SOF13-SOF15.+_JPEG_FRAME_MARKERS = frozenset({0xC0, 0xC1, 0xC2, 0xC3, 0xC5, 0xC6, 0xC7, 0xC9, 0xCA, 0xCB, 0xCD, 0xCE, 0xCF})+_JPEG_FILL_BYTES = re.compile(rb"\xff+")+# Where entropy-coded data ends: the first marker, after any fill bytes, other+# than a stuffed 0xFF00 byte or a restart marker (RST0-RST7). The lookbehind+# starts each match at the first 0xFF of a run, which keeps the search linear.+_JPEG_SCAN_END = re.compile(rb"(?<!\xff)\xff+[^\x00\xd0-\xd7\xff]")+# A non-marker byte or a stuffed 0xFF00 is entropy-coded content; fill bytes+# and restart markers by themselves do not supply scan data.+_JPEG_SCAN_DATA = re.compile(rb"(?<!\xff)[^\xff]|\xff\x00")+++def _is_png(data: bytes) -> bool:+ """Whether *data* has the chunk structure of a PNG image.++ The chunk stream must be whole, with every CRC valid: IHDR first, with a+ nonzero size and a valid bit depth and colour type; a palette exactly when+ the colour type needs or allows one, before the image data; one contiguous+ run of IDAT chunks that starts a zlib stream; and IEND last, with nothing+ after it. Unknown critical chunks and chunk types with the reserved bit set+ are rejected. This corroborates the file type without decoding the image.+ The compressed IDAT data beyond its two-byte zlib header and ancillary+ chunks are not inspected, so both can still carry arbitrary bytes.+ """+ if not data.startswith(_PNG_SIGNATURE):+ return False+ view = memoryview(data)+ offset = len(_PNG_SIGNATURE)+ depth = colour = palette_entries = 0+ idat_head = b""+ idat_state = 0 # 0: no IDAT yet, 1: inside the IDAT run, 2: after it+ while offset + 12 <= len(data):+ (length,) = struct.unpack_from(">I", data, offset)+ kind = data[offset + 4 : offset + 8]+ end = offset + 12 + length+ if end > len(data) or not kind.isalpha() or kind[2] & 0x20:+ return False+ (crc,) = struct.unpack_from(">I", data, end - 4)+ if zlib.crc32(view[offset + 4 : end - 4]) != crc or (offset == len(_PNG_SIGNATURE)) != (kind == b"IHDR"):+ return False+ if kind == b"IHDR":+ if length != 13:+ return False+ width, height, depth, colour, compression, filtering, interlace = struct.unpack_from(+ ">IIBBBBB", data, offset + 8+ )+ if (+ not 0 < width < 1 << 31+ or not 0 < height < 1 << 31+ or depth not in _PNG_BIT_DEPTHS.get(colour, ())+ or compression != 0+ or filtering != 0+ or interlace not in (0, 1)+ ):+ return False+ elif kind == b"PLTE":+ if palette_entries or idat_state or not 0 < length <= 768 or length % 3 or colour in (0, 4):+ return False+ palette_entries = length // 3+ elif kind == b"IDAT":+ if idat_state == 2:+ return False+ idat_state = 1+ idat_head = (idat_head + data[offset + 8 : offset + 8 + min(length, 2)])[:2]+ elif kind == b"IEND":+ # The zlib header names deflate with a window of at most 32 KiB,+ # its check bits are valid, and it sets no preset dictionary.+ return (+ length == 0+ and end == len(data)+ and len(idat_head) == 2+ and idat_head[0] & 0x0F == 8+ and idat_head[0] >> 4 <= 7+ and int.from_bytes(idat_head, "big") % 31 == 0+ and not idat_head[1] & 0x20+ and (colour != 3 or 0 < palette_entries <= 1 << depth)+ )+ elif not kind[0] & 0x20:+ return False # An unknown critical chunk.+ elif idat_state:+ idat_state = 2+ offset = end+ return False+++def _jpeg_tables_are_valid(marker: int, payload: bytes) -> bool:+ """Whether a DQT (0xDB), DHT (0xC4) or DAC (0xCC) segment payload holds whole, valid tables."""+ if marker == 0xCC:+ return bool(payload) and len(payload) % 2 == 0+ cursor = 0+ while cursor < len(payload):+ table_class, table_id = payload[cursor] >> 4, payload[cursor] & 0x0F+ if marker == 0xDB:+ cursor += 1 + 64 * (table_class + 1)+ valid = table_class <= 1+ else:+ symbols = sum(payload[cursor + 1 : cursor + 17])+ cursor += 17 + symbols+ valid = table_class <= 1 and 0 < symbols <= 256+ if not valid or table_id > 3 or cursor > len(payload):+ return False+ return bool(payload)+++def _is_jpeg(data: bytes) -> bool:+ """Whether *data* has the marker structure of a JPEG image.++ The file must run from SOI to EOI, its last bytes, through well-formed+ marker segments: one frame header (SOF); valid quantization (DQT) and+ entropy-coding (DHT or DAC) tables before the first scan; and scans (SOS)+ whose components belong to the frame, each followed by entropy-coded+ data. Reserved markers and markers out of place are rejected. This+ corroborates the file type without decoding the image. Entropy-coded+ data and APPn or COM segments are not inspected and can still carry+ arbitrary bytes.+ """+ if len(data) < 20 or not data.startswith(b"\xff\xd8") or not data.endswith(b"\xff\xd9"):+ return False+ frame: set[int] = set()+ has_quantization = has_entropy_tables = False+ entropy_bytes = 0+ offset = 2+ while offset < len(data):+ if data[offset] != 0xFF:+ return False+ fill = _JPEG_FILL_BYTES.match(data, offset)+ offset = fill.end() if fill else offset+ if offset >= len(data):+ return False+ marker = data[offset]+ offset += 1+ if marker == 0xD9:+ return offset == len(data) and entropy_bytes > 0+ if marker < 0xC0 or 0xD0 <= marker <= 0xD8 or offset + 2 > len(data):+ return False+ (length,) = struct.unpack_from(">H", data, offset)+ payload = data[offset + 2 : offset + length]+ offset += length+ if length < 2 or offset > len(data):+ return False+ if marker in (0xDB, 0xC4, 0xCC):+ if not _jpeg_tables_are_valid(marker, payload):+ return False+ has_quantization = has_quantization or marker == 0xDB+ has_entropy_tables = has_entropy_tables or marker != 0xDB+ elif marker in _JPEG_FRAME_MARKERS:+ count = payload[5] if len(payload) > 5 else 0+ if frame or not 1 <= count <= 4 or len(payload) != 6 + 3 * count or payload[0] not in (8, 12):+ return False+ if not int.from_bytes(payload[1:3], "big") or not int.from_bytes(payload[3:5], "big"):+ return False+ for component in range(6, len(payload), 3):+ identifier, sampling, table = payload[component : component + 3]+ if identifier in frame or not 1 <= sampling >> 4 <= 4 or not 1 <= sampling & 0x0F <= 4 or table > 3:+ return False+ frame.add(identifier)+ elif marker == 0xDA:+ count = payload[0] if payload else 0+ if not (frame and has_quantization and has_entropy_tables and 1 <= count <= len(frame)):+ return False+ if len(payload) != 4 + 2 * count:+ return False+ scanned = payload[1 : 1 + 2 * count : 2]+ selectors = payload[2 : 2 + 2 * count : 2]+ start, stop, approximation = payload[-3:]+ if (+ len(set(scanned)) != count+ or not set(scanned) <= frame+ or any(selector >> 4 > 3 or selector & 0x0F > 3 for selector in selectors)+ or not start <= stop <= 63+ or approximation >> 4 > 13+ or approximation & 0x0F > 13+ ):+ return False+ scan_end = _JPEG_SCAN_END.search(data, offset)+ if scan_end is None:+ return False+ if not _JPEG_SCAN_DATA.search(data, offset, scan_end.start()):+ return False+ entropy_bytes += scan_end.start() - offset+ offset = scan_end.start()+ elif marker == 0xDD:+ if length != 4:+ return False+ elif marker != 0xFE and not 0xE0 <= marker <= 0xEF:+ return False # Reserved extensions and segments outside this single-frame format.+ return False+++def _skillspector_passive_raster_note(+ ledger_exceptions: list[dict],+ analyzer_statuses: list[dict],+ counts: Mapping[str, int],+ limitations: list[str],+ scope_exclusions: object,+ components: object,+ scanned_root: Path | None,+) -> str | None:+ """A note for a ``partial`` SkillSpector analysis whose only gaps are referenced images, else ``None``.++ SkillSpector's ``static_patterns_*`` analyzers read text. A PNG or JPEG+ image that a skill references (````) is recorded as+ one nonfatal, whole-file ``static`` ledger exception (``opaque_content`` or+ ``binary_content``) naming those analyzers, and the analysis is reported as+ ``partial``. Every other analyzer still inspected every file.++ That gap is accepted only when it accounts exactly for the report: each+ named analyzer is ``degraded`` by one ``partial`` work item per image and+ completed the rest, every other analyzer completed, the uninspected-file+ counts and limitations match, no scope exclusion is fatal, and each image+ is a non-executable component outside the directories that agents run,+ load as instructions or read as configuration+ (:data:`_PASSIVE_RASTER_CONTROL_DIRS`, :data:`_PASSIVE_RASTER_CONTROL_ROOTS`).+ Each file under *scanned_root* must also be a regular, single-link,+ non-executable file, reached without following a link, whose bytes have the+ structure of a PNG or JPEG matching its suffix (:func:`_is_png`,+ :func:`_is_jpeg`), within :data:`_PASSIVE_RASTER_MAX_FILES` files and+ :data:`_PASSIVE_RASTER_MAX_BYTES` bytes. A binary payload named+ ``logo.png`` without PNG structure, another reason, a fatal or line-scoped+ exception, or any accounting mismatch keeps the scan INCOMPLETE. Compressed+ image data is not decoded or assessed, including arbitrary payload bytes+ behind an otherwise well-formed header.+ """+ if (+ scanned_root is None+ or not ledger_exceptions+ or not isinstance(components, list)+ or not isinstance(scope_exclusions, list)+ or any(not isinstance(row, dict) or row.get("fatal") is not False for row in scope_exclusions)+ ):+ return None+ named: Counter[str] = Counter()+ rows: set[tuple[str, str]] = set()+ for exception in ledger_exceptions:+ path = exception.get("path")+ reason = exception.get("reason_code")+ analyzers = exception.get("analyzers")+ if (+ exception.get("outcome") != "partial"+ or exception.get("phase") != "static"+ or exception.get("fatal") is not False+ or exception.get("start_line") is not None+ or exception.get("end_line") is not None+ or not isinstance(reason, str)+ or reason not in _PASSIVE_RASTER_REASONS+ or not isinstance(path, str)+ or PurePosixPath(path).suffix.lower() not in _PASSIVE_RASTER_SUFFIXES+ or not isinstance(analyzers, list)+ or not analyzers+ ):+ return None+ for analyzer in analyzers:+ if (+ not isinstance(analyzer, str)+ or not _PASSIVE_RASTER_ANALYZER_RE.fullmatch(analyzer)+ or (path, analyzer) in rows+ ):+ return None+ rows.add((path, analyzer))+ named[analyzer] += 1+ paths = sorted({path for path, _analyzer in rows})+ total = counts["total_components"]+ uninspected = counts["partially_inspected_files"] + counts["entirely_uninspected_files"]+ if (+ len(paths) > _PASSIVE_RASTER_MAX_FILES+ or uninspected != len(paths)+ or counts["findings_before_filtering"] != counts["findings_after_filtering"]+ ):+ return None++ universal = _SKILLSPECTOR_COMMON_UNIVERSAL_ANALYZERS | {"artifact_integrity"} | set(named)+ accounted: set[str] = set()+ for status in analyzer_statuses:+ analyzer_id = status.get("analyzer_id")+ state = status.get("status")+ if analyzer_id not in universal:+ if state not in {"completed", "not_applicable", "disabled"}:+ return None+ continue+ gaps = named.get(analyzer_id, 0)+ if (+ analyzer_id in accounted+ or state != ("degraded" if gaps else "completed")+ or status.get("planned_work") != total+ or status.get("completed") != total - gaps+ or status.get("partial") != gaps+ ):+ return None+ accounted.add(analyzer_id)+ allowed_limitations = {f"Analyzer {analyzer} status: degraded." for analyzer in named}+ if accounted != universal or any(limitation not in allowed_limitations for limitation in limitations):+ return None++ components_by_path: dict[str, list[dict]] = {}+ for component in components:+ if isinstance(component, dict) and isinstance(component.get("path"), str):+ components_by_path.setdefault(component["path"], []).append(component)+ budget = _PASSIVE_RASTER_MAX_BYTES+ try:+ with SecureRoot(scanned_root) as root:+ for path in paths:+ matches = components_by_path.get(path, [])+ parts = path.split("/")+ directories = [part.casefold() for part in parts[:-1]]+ if (+ len(matches) != 1+ or matches[0].get("executable") is not False+ or "\\" in path+ or not _is_filesystem_safe_path_text(path)+ or any(part in {"", ".", ".."} or Path(part).anchor for part in parts)+ or (directories and directories[0] in _PASSIVE_RASTER_CONTROL_ROOTS)+ or not _PASSIVE_RASTER_CONTROL_DIRS.isdisjoint(directories)+ ):+ return None+ data, metadata = root.read_bytes(Path(*parts), budget)+ is_image = _is_png(data) if path.lower().endswith(".png") else _is_jpeg(data)+ if metadata.st_mode & 0o111 or not is_image:+ return None+ budget -= len(data)+ except (OSError, SecurePathError):+ return None++ shown = ", ".join(paths[:5]) + (f" and {len(paths) - 5} more" if len(paths) > 5 else "")+ return (+ f"SkillSpector's text pattern analyzers could not read {len(paths)} referenced image file(s) "+ f"({shown}); each is a regular, non-executable file with PNG or JPEG structure outside agent-control "+ "directories, so the scan is not marked incomplete. The image content itself was not assessed"+ )++class SecurityValidator(ValidatorBase):"""Scans skills for security vulnerabilities and PII leakage.@@ -868,6 +1221,18 @@ class SecurityValidator(ValidatorBase):original_root=original_root if staged is not None else None,use_llm=True,)+ # Both stages run the same static analyzers, so a note such as+ # an accepted image gap can repeat word for word; keep one copy.+ finding_messages = {finding.to_legacy_string() for finding in enrichment.findings}+ repeated = {+ warning+ for warning in enrichment.warnings+ if warning in result.warnings and warning not in finding_messages+ }+ if repeated:+ kept = [warning for warning in enrichment.warnings if warning not in repeated]+ enrichment.summary.warnings -= len(enrichment.warnings) - len(kept)+ enrichment.warnings = keptresult.merge(enrichment)if not enrichment.is_incomplete:self._deduplicate_skillspector_findings(result)@@ -959,6 +1324,7 @@ class SecurityValidator(ValidatorBase):use_llm,stage_name,result,+ scanned_root=original_root if original_root is not None else scan_root,):result.mark_scan_incomplete(stage_name)return result@@ -995,8 +1361,17 @@ class SecurityValidator(ValidatorBase):use_llm: bool,stage_name: str,result: ValidationResult,+ *,+ scanned_root: Path | None = None,) -> bool:- """Return whether JSON is a trustworthy SkillSpector findings report."""+ """Return whether JSON is a trustworthy SkillSpector findings report.++ A ``partial`` analysis makes the scan INCOMPLETE unless its only gaps are+ referenced PNG or JPEG images that the files under *scanned_root* confirm+ (:func:`_skillspector_passive_raster_note`); that is a warning instead.+ *scanned_root* is the directory the report's relative paths start from.+ """+ partial_reported = Falseif "error" in data and data["error"] is not None:result.add_error("skillspector reported an error; security scan did not complete")return False@@ -1515,11 +1890,24 @@ class SecurityValidator(ValidatorBase):"security scan did not complete")return False- result.add_error(- "skillspector JSON field 'analysis_completeness' reports incomplete analysis "- f"(status '{completeness_status}'); security scan did not complete"+ partial_reported = True+ raster_note = _skillspector_passive_raster_note(+ ledger_exceptions,+ analyzer_statuses,+ counts,+ limitations,+ analysis_completeness.get("scope_exclusions", []),+ data.get("components"),+ scanned_root,)- result.mark_scan_incomplete(stage_name)+ if raster_note is not None:+ result.add_warning(raster_note)+ else:+ result.add_error(+ "skillspector JSON field 'analysis_completeness' reports incomplete analysis "+ f"(status '{completeness_status}'); security scan did not complete"+ )+ result.mark_scan_incomplete(stage_name)status = data.get("status")if status is not None and not isinstance(status, str):@@ -1586,7 +1974,7 @@ class SecurityValidator(ValidatorBase):return Falserecommendation = risk.get("recommendation")expected_recommendation = _SKILLSPECTOR_RECOMMENDATION_BY_SEVERITY[severity]- if result.is_incomplete and severity == "LOW":+ if (result.is_incomplete or partial_reported) and severity == "LOW":expected_recommendation = "CAUTION"if not isinstance(recommendation, str) or recommendation != expected_recommendation:result.add_error(diff --git a/tests/fixtures/skillspector-2.12.0-image-path-reference-no-llm.json b/tests/fixtures/skillspector-2.12.0-image-path-reference-no-llm.jsonnew file mode 100644index 00000000..11eafda0--- /dev/null+++ b/tests/fixtures/skillspector-2.12.0-image-path-reference-no-llm.json@@ -0,0 +1,893 @@+{+ "skill": {+ "name": "raster-demo",+ "source": "/tmp/raster-demo",+ "scanned_at": "2026-10-30T06:27:19.676005+00:00"+ },+ "risk_assessment": {+ "score": 37,+ "severity": "MEDIUM",+ "recommendation": "CAUTION",+ "max_issue_severity": "HIGH"+ },+ "components": [+ {+ "path": "SKILL.md",+ "type": "markdown",+ "lines": 8,+ "executable": false,+ "size_bytes": 219,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "assets/logo.png",+ "type": "other",+ "lines": 6,+ "executable": false,+ "size_bytes": 69,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "assets/photo.jpg",+ "type": "other",+ "lines": 2,+ "executable": false,+ "size_bytes": 155,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ }+ ],+ "structured_summaries": [],+ "issues": [+ {+ "id": "AE1",+ "finding_id": "finding-a90937f2836046268e0e3754acc2310b",+ "category": "analysis-evasion",+ "pattern": "Incomplete referenced artifact analysis",+ "severity": "HIGH",+ "confidence": 1.0,+ "location": {+ "file": "SKILL.md",+ "start_line": 8,+ "end_line": null+ },+ "finding": "assets/logo.png (partial)",+ "explanation": "Referenced artifact was not completely inspected",+ "remediation": "Provide inspectable source or analysis support for the referenced format. Keep required references; incomplete analysis is not proof of malicious evasion.",+ "code_snippet": "Place the logo from `assets/logo.png` and the photo from `assets/photo.jpg` in the report header.",+ "intent": null,+ "tags": [+ "coverage",+ "reference",+ "target-disposition:partial"+ ],+ "evidence": {+ "target_path": "assets/logo.png",+ "target_disposition": "partial",+ "reasons": [+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_agent_snooping"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_anti_refusal"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_data_exfiltration"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_deserialization"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_excessive_agency"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_harmful_content"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_memory_poisoning"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_output_handling"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_privilege_escalation"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_prompt_injection"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_rogue_agent"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_ssrf"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_supply_chain"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_system_prompt_leakage"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_tool_misuse"+ ]+ }+ ]+ },+ "match_fingerprint": "87409b690fe4372064b66a95d34d2560e950172920b9e4f70ca3ca40fa538596",+ "occurrences": [+ {+ "file": "SKILL.md",+ "start_line": 8,+ "end_line": null+ }+ ]+ },+ {+ "id": "AE1",+ "finding_id": "finding-ce3eb4dd8a9d42e0946321f931cdf2ab",+ "category": "analysis-evasion",+ "pattern": "Incomplete referenced artifact analysis",+ "severity": "HIGH",+ "confidence": 1.0,+ "location": {+ "file": "SKILL.md",+ "start_line": 8,+ "end_line": null+ },+ "finding": "assets/photo.jpg (partial)",+ "explanation": "Referenced artifact was not completely inspected",+ "remediation": "Provide inspectable source or analysis support for the referenced format. Keep required references; incomplete analysis is not proof of malicious evasion.",+ "code_snippet": "Place the logo from `assets/logo.png` and the photo from `assets/photo.jpg` in the report header.",+ "intent": null,+ "tags": [+ "coverage",+ "reference",+ "target-disposition:partial"+ ],+ "evidence": {+ "target_path": "assets/photo.jpg",+ "target_disposition": "partial",+ "reasons": [+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_agent_snooping"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_anti_refusal"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_data_exfiltration"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_deserialization"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_excessive_agency"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_harmful_content"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_memory_poisoning"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_output_handling"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_privilege_escalation"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_prompt_injection"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_rogue_agent"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_ssrf"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_supply_chain"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_system_prompt_leakage"+ ]+ },+ {+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "phase": "static",+ "analyzers": [+ "static_patterns_tool_misuse"+ ]+ }+ ]+ },+ "match_fingerprint": "3c933ece847ec1fba09bfa43d532a4cf7b2bfbff4cdb68804415f009d345d7a9",+ "occurrences": [+ {+ "file": "SKILL.md",+ "start_line": 8,+ "end_line": null+ }+ ]+ }+ ],+ "suppressed_count": 0,+ "suppressed": [],+ "metadata": {+ "has_executable_scripts": false,+ "skillspector_version": "2.12.0",+ "llm_requested": false,+ "llm_available": false,+ "meta_analysis_applied": false,+ "inference_usage": [],+ "llm_provenance": {+ "schema_version": 1,+ "provider": {+ "configured_adapter": "nv_build",+ "resolved_adapter": "nv_build",+ "effective_adapter": "not_applicable",+ "effective_adapters": [],+ "service": "unknown",+ "routing": {+ "deployment_override": null,+ "deployment_source": "not_applicable",+ "api_version": null,+ "api_version_source": "not_applicable"+ }+ },+ "analyzers": [+ {+ "analyzer_id": "mcp_tool_poisoning",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "meta_analyzer",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ }+ ],+ "sampling": {+ "temperature": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ },+ "seed": {+ "requested": null,+ "source": "unset",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ },+ "reasoning_effort": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ }+ },+ "determinism": {+ "classification": "not_applicable",+ "control_status": "not_applied",+ "provider_guarantee": false,+ "reason": "LLM analysis was not executed for this scan."+ }+ },+ "filtering_mode": "heuristic"+ },+ "execution_successful": true,+ "analysis_completeness": {+ "total_components": 3,+ "scanned_components": 1,+ "coverage_percent": 33.3,+ "is_complete": false,+ "status": "partial",+ "execution_successful": true,+ "fully_inspected_files": 1,+ "partially_inspected_files": 0,+ "entirely_uninspected_files": 2,+ "ledger_exceptions": [+ {+ "outcome": "partial",+ "phase": "static",+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "path": "assets/logo.png",+ "start_line": null,+ "end_line": null,+ "fatal": false,+ "analyzers": [+ "static_patterns_agent_snooping",+ "static_patterns_anti_refusal",+ "static_patterns_data_exfiltration",+ "static_patterns_deserialization",+ "static_patterns_excessive_agency",+ "static_patterns_harmful_content",+ "static_patterns_memory_poisoning",+ "static_patterns_output_handling",+ "static_patterns_privilege_escalation",+ "static_patterns_prompt_injection",+ "static_patterns_rogue_agent",+ "static_patterns_ssrf",+ "static_patterns_supply_chain",+ "static_patterns_system_prompt_leakage",+ "static_patterns_tool_misuse"+ ]+ },+ {+ "outcome": "partial",+ "phase": "static",+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "path": "assets/photo.jpg",+ "start_line": null,+ "end_line": null,+ "fatal": false,+ "analyzers": [+ "static_patterns_agent_snooping",+ "static_patterns_anti_refusal",+ "static_patterns_data_exfiltration",+ "static_patterns_deserialization",+ "static_patterns_excessive_agency",+ "static_patterns_harmful_content",+ "static_patterns_memory_poisoning",+ "static_patterns_output_handling",+ "static_patterns_privilege_escalation",+ "static_patterns_prompt_injection",+ "static_patterns_rogue_agent",+ "static_patterns_ssrf",+ "static_patterns_supply_chain",+ "static_patterns_system_prompt_leakage",+ "static_patterns_tool_misuse"+ ]+ }+ ],+ "scope_exclusions": [],+ "analyzer_statuses": [+ {+ "analyzer_id": "artifact_integrity",+ "status": "completed",+ "planned_work": 3,+ "completed": 3,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "behavioral_ast",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "behavioral_taint_tracking",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "bundled_execution_surface",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_least_privilege",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_rug_pull",+ "status": "completed",+ "planned_work": 3,+ "completed": 3,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "mcp_tool_poisoning",+ "status": "completed",+ "planned_work": 1,+ "completed": 1,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "meta_analyzer",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "reference_coverage",+ "status": "completed",+ "planned_work": 1,+ "completed": 1,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "static_patterns_agent_snooping",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_anti_refusal",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_data_exfiltration",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_deserialization",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_excessive_agency",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_harmful_content",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_memory_poisoning",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_output_handling",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_privilege_escalation",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_prompt_injection",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_rogue_agent",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_ssrf",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_supply_chain",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_system_prompt_leakage",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_tool_misuse",+ "status": "degraded",+ "planned_work": 3,+ "completed": 1,+ "partial": 2,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_yara",+ "status": "completed",+ "planned_work": 3,+ "completed": 3,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ }+ ],+ "references": [+ {+ "source_path": "SKILL.md",+ "line": 8,+ "column": 22,+ "evidence": "Place the logo from `assets/logo.png` and the photo from `assets/photo.jpg` in the report header.",+ "target_path": "assets/logo.png",+ "status": "resolved",+ "disposition": "out_of_scope",+ "reference_kind": "quoted_or_code"+ },+ {+ "source_path": "SKILL.md",+ "line": 8,+ "column": 59,+ "evidence": "Place the logo from `assets/logo.png` and the photo from `assets/photo.jpg` in the report header.",+ "target_path": "assets/photo.jpg",+ "status": "resolved",+ "disposition": "out_of_scope",+ "reference_kind": "quoted_or_code"+ }+ ],+ "limitations": [+ "Analyzer static_patterns_agent_snooping status: degraded.",+ "Analyzer static_patterns_anti_refusal status: degraded.",+ "Analyzer static_patterns_data_exfiltration status: degraded.",+ "Analyzer static_patterns_deserialization status: degraded.",+ "Analyzer static_patterns_excessive_agency status: degraded.",+ "Analyzer static_patterns_harmful_content status: degraded.",+ "Analyzer static_patterns_memory_poisoning status: degraded.",+ "Analyzer static_patterns_output_handling status: degraded.",+ "Analyzer static_patterns_privilege_escalation status: degraded.",+ "Analyzer static_patterns_prompt_injection status: degraded.",+ "Analyzer static_patterns_rogue_agent status: degraded.",+ "Analyzer static_patterns_ssrf status: degraded.",+ "Analyzer static_patterns_supply_chain status: degraded.",+ "Analyzer static_patterns_system_prompt_leakage status: degraded.",+ "Analyzer static_patterns_tool_misuse status: degraded."+ ],+ "findings_before_filtering": 2,+ "findings_after_filtering": 2+ }+}diff --git a/tests/fixtures/skillspector-2.12.0-image-reference-no-llm.json b/tests/fixtures/skillspector-2.12.0-image-reference-no-llm.jsonnew file mode 100644index 00000000..400e44e4--- /dev/null+++ b/tests/fixtures/skillspector-2.12.0-image-reference-no-llm.json@@ -0,0 +1,521 @@+{+ "skill": {+ "name": "raster-demo",+ "source": "/tmp/raster-demo",+ "scanned_at": "2026-10-29T13:29:51.821296+00:00"+ },+ "risk_assessment": {+ "score": 0,+ "severity": "LOW",+ "recommendation": "CAUTION",+ "max_issue_severity": "NONE"+ },+ "components": [+ {+ "path": "SKILL.md",+ "type": "markdown",+ "lines": 8,+ "executable": false,+ "size_bytes": 154,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "assets/logo.png",+ "type": "other",+ "lines": 6,+ "executable": false,+ "size_bytes": 69,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ }+ ],+ "structured_summaries": [],+ "issues": [],+ "suppressed_count": 0,+ "suppressed": [],+ "metadata": {+ "has_executable_scripts": false,+ "skillspector_version": "2.12.0",+ "llm_requested": false,+ "llm_available": false,+ "meta_analysis_applied": false,+ "inference_usage": [],+ "llm_provenance": {+ "schema_version": 1,+ "provider": {+ "configured_adapter": "nv_build",+ "resolved_adapter": "nv_build",+ "effective_adapter": "not_applicable",+ "effective_adapters": [],+ "service": "unknown",+ "routing": {+ "deployment_override": null,+ "deployment_source": "not_applicable",+ "api_version": null,+ "api_version_source": "not_applicable"+ }+ },+ "analyzers": [+ {+ "analyzer_id": "mcp_tool_poisoning",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "meta_analyzer",+ "model": "z-ai/glm-5.2",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.12.0",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ }+ ],+ "sampling": {+ "temperature": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ },+ "seed": {+ "requested": null,+ "source": "unset",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ },+ "reasoning_effort": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": true,+ "provider_support": "unknown"+ }+ },+ "determinism": {+ "classification": "not_applicable",+ "control_status": "not_applied",+ "provider_guarantee": false,+ "reason": "LLM analysis was not executed for this scan."+ }+ },+ "filtering_mode": "heuristic"+ },+ "execution_successful": true,+ "analysis_completeness": {+ "total_components": 2,+ "scanned_components": 1,+ "coverage_percent": 50.0,+ "is_complete": false,+ "status": "partial",+ "execution_successful": true,+ "fully_inspected_files": 1,+ "partially_inspected_files": 0,+ "entirely_uninspected_files": 1,+ "ledger_exceptions": [+ {+ "outcome": "partial",+ "phase": "static",+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "path": "assets/logo.png",+ "start_line": null,+ "end_line": null,+ "fatal": false,+ "analyzers": [+ "static_patterns_agent_snooping",+ "static_patterns_anti_refusal",+ "static_patterns_data_exfiltration",+ "static_patterns_deserialization",+ "static_patterns_excessive_agency",+ "static_patterns_harmful_content",+ "static_patterns_memory_poisoning",+ "static_patterns_output_handling",+ "static_patterns_privilege_escalation",+ "static_patterns_prompt_injection",+ "static_patterns_rogue_agent",+ "static_patterns_ssrf",+ "static_patterns_supply_chain",+ "static_patterns_system_prompt_leakage",+ "static_patterns_tool_misuse"+ ]+ }+ ],+ "scope_exclusions": [],+ "analyzer_statuses": [+ {+ "analyzer_id": "artifact_integrity",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "behavioral_ast",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "behavioral_taint_tracking",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "bundled_execution_surface",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_least_privilege",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_rug_pull",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "mcp_tool_poisoning",+ "status": "completed",+ "planned_work": 1,+ "completed": 1,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "meta_analyzer",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "static_patterns_agent_snooping",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_anti_refusal",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_data_exfiltration",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_deserialization",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_excessive_agency",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_harmful_content",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_memory_poisoning",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_output_handling",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_privilege_escalation",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_prompt_injection",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_rogue_agent",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_ssrf",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_supply_chain",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_system_prompt_leakage",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_tool_misuse",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_yara",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ }+ ],+ "references": [+ {+ "source_path": "SKILL.md",+ "line": 8,+ "column": 17,+ "evidence": "",+ "target_path": "assets/logo.png",+ "status": "resolved",+ "disposition": "out_of_scope",+ "reference_kind": "markdown_image"+ }+ ],+ "limitations": [+ "Analyzer static_patterns_agent_snooping status: degraded.",+ "Analyzer static_patterns_anti_refusal status: degraded.",+ "Analyzer static_patterns_data_exfiltration status: degraded.",+ "Analyzer static_patterns_deserialization status: degraded.",+ "Analyzer static_patterns_excessive_agency status: degraded.",+ "Analyzer static_patterns_harmful_content status: degraded.",+ "Analyzer static_patterns_memory_poisoning status: degraded.",+ "Analyzer static_patterns_output_handling status: degraded.",+ "Analyzer static_patterns_privilege_escalation status: degraded.",+ "Analyzer static_patterns_prompt_injection status: degraded.",+ "Analyzer static_patterns_rogue_agent status: degraded.",+ "Analyzer static_patterns_ssrf status: degraded.",+ "Analyzer static_patterns_supply_chain status: degraded.",+ "Analyzer static_patterns_system_prompt_leakage status: degraded.",+ "Analyzer static_patterns_tool_misuse status: degraded."+ ],+ "findings_before_filtering": 0,+ "findings_after_filtering": 0+ }+}diff --git a/tests/fixtures/skillspector-2.13.2-image-reference-no-llm.json b/tests/fixtures/skillspector-2.13.2-image-reference-no-llm.jsonnew file mode 100644index 00000000..fcbe3f6d--- /dev/null+++ b/tests/fixtures/skillspector-2.13.2-image-reference-no-llm.json@@ -0,0 +1,521 @@+{+ "skill": {+ "name": "raster-demo",+ "source": "/tmp/raster-demo",+ "scanned_at": "2026-10-29T13:29:58.815743+00:00"+ },+ "risk_assessment": {+ "score": 0,+ "severity": "LOW",+ "recommendation": "CAUTION",+ "max_issue_severity": "NONE"+ },+ "components": [+ {+ "path": "SKILL.md",+ "type": "markdown",+ "lines": 8,+ "executable": false,+ "size_bytes": 154,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "assets/logo.png",+ "type": "other",+ "lines": 6,+ "executable": false,+ "size_bytes": 69,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ }+ ],+ "structured_summaries": [],+ "issues": [],+ "suppressed_count": 0,+ "suppressed": [],+ "metadata": {+ "has_executable_scripts": false,+ "skillspector_version": "2.13.2",+ "llm_requested": false,+ "llm_available": false,+ "meta_analysis_applied": false,+ "inference_usage": [],+ "llm_provenance": {+ "schema_version": 1,+ "provider": {+ "configured_adapter": "unknown",+ "resolved_adapter": "unknown",+ "effective_adapter": "not_applicable",+ "effective_adapters": [],+ "service": "unknown",+ "routing": {+ "deployment_override": null,+ "deployment_source": "unknown",+ "api_version": null,+ "api_version_source": "unknown"+ }+ },+ "analyzers": [+ {+ "analyzer_id": "mcp_tool_poisoning",+ "model": "z-ai/glm-5.3",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.13.2",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "model": "z-ai/glm-5.3",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.13.2",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "model": "z-ai/glm-5.3",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.13.2",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "model": "z-ai/glm-5.3",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.13.2",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ },+ {+ "analyzer_id": "meta_analyzer",+ "model": "z-ai/glm-5.3",+ "model_source": "resolved_configuration",+ "analyzer_revision": {+ "value": "2.13.2",+ "source": "skillspector_package",+ "source_revision": {+ "value": "unknown",+ "source": "unknown"+ }+ }+ }+ ],+ "sampling": {+ "temperature": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": false,+ "provider_support": "unknown"+ },+ "seed": {+ "requested": null,+ "source": "unset",+ "forwarded_to_client": null,+ "adapter_support": false,+ "provider_support": "unknown"+ },+ "reasoning_effort": {+ "requested": null,+ "source": "provider_default",+ "forwarded_to_client": null,+ "adapter_support": false,+ "provider_support": "unknown"+ }+ },+ "determinism": {+ "classification": "not_applicable",+ "control_status": "not_applied",+ "provider_guarantee": false,+ "reason": "LLM analysis was not executed for this scan."+ }+ },+ "filtering_mode": "heuristic"+ },+ "execution_successful": true,+ "analysis_completeness": {+ "total_components": 2,+ "scanned_components": 1,+ "coverage_percent": 50.0,+ "is_complete": false,+ "status": "partial",+ "execution_successful": true,+ "fully_inspected_files": 1,+ "partially_inspected_files": 0,+ "entirely_uninspected_files": 1,+ "ledger_exceptions": [+ {+ "outcome": "partial",+ "phase": "static",+ "reason_code": "opaque_content",+ "message": "Artifact contents could not be fully interpreted.",+ "path": "assets/logo.png",+ "start_line": null,+ "end_line": null,+ "fatal": false,+ "analyzers": [+ "static_patterns_agent_snooping",+ "static_patterns_anti_refusal",+ "static_patterns_data_exfiltration",+ "static_patterns_deserialization",+ "static_patterns_excessive_agency",+ "static_patterns_harmful_content",+ "static_patterns_memory_poisoning",+ "static_patterns_output_handling",+ "static_patterns_privilege_escalation",+ "static_patterns_prompt_injection",+ "static_patterns_rogue_agent",+ "static_patterns_ssrf",+ "static_patterns_supply_chain",+ "static_patterns_system_prompt_leakage",+ "static_patterns_tool_misuse"+ ]+ }+ ],+ "scope_exclusions": [],+ "analyzer_statuses": [+ {+ "analyzer_id": "artifact_integrity",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "behavioral_ast",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "behavioral_taint_tracking",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "bundled_execution_surface",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_least_privilege",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "mcp_rug_pull",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "mcp_tool_poisoning",+ "status": "completed",+ "planned_work": 1,+ "completed": 1,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "meta_analyzer",+ "status": "not_applicable",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "no_applicable_files",+ "message": "No files matched this analyzer's applicability contract."+ },+ {+ "analyzer_id": "semantic_developer_intent",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_quality_policy",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "semantic_security_discovery",+ "status": "disabled",+ "planned_work": 0,+ "completed": 0,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0,+ "reason_code": "disabled_by_configuration",+ "message": "Analyzer was disabled by the requested configuration."+ },+ {+ "analyzer_id": "static_patterns_agent_snooping",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_anti_refusal",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_data_exfiltration",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_deserialization",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_excessive_agency",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_harmful_content",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_memory_poisoning",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_output_handling",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_privilege_escalation",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_prompt_injection",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_rogue_agent",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_ssrf",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_supply_chain",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_system_prompt_leakage",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_tool_misuse",+ "status": "degraded",+ "planned_work": 2,+ "completed": 1,+ "partial": 1,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_yara",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ }+ ],+ "references": [+ {+ "source_path": "SKILL.md",+ "line": 8,+ "column": 17,+ "evidence": "",+ "target_path": "assets/logo.png",+ "status": "resolved",+ "disposition": "out_of_scope",+ "reference_kind": "markdown_image"+ }+ ],+ "limitations": [+ "Analyzer static_patterns_agent_snooping status: degraded.",+ "Analyzer static_patterns_anti_refusal status: degraded.",+ "Analyzer static_patterns_data_exfiltration status: degraded.",+ "Analyzer static_patterns_deserialization status: degraded.",+ "Analyzer static_patterns_excessive_agency status: degraded.",+ "Analyzer static_patterns_harmful_content status: degraded.",+ "Analyzer static_patterns_memory_poisoning status: degraded.",+ "Analyzer static_patterns_output_handling status: degraded.",+ "Analyzer static_patterns_privilege_escalation status: degraded.",+ "Analyzer static_patterns_prompt_injection status: degraded.",+ "Analyzer static_patterns_rogue_agent status: degraded.",+ "Analyzer static_patterns_ssrf status: degraded.",+ "Analyzer static_patterns_supply_chain status: degraded.",+ "Analyzer static_patterns_system_prompt_leakage status: degraded.",+ "Analyzer static_patterns_tool_misuse status: degraded."+ ],+ "findings_before_filtering": 0,+ "findings_after_filtering": 0+ }+}diff --git a/tests/validators/test_security.py b/tests/validators/test_security.pyindex ccd32c3c..79aca6db 100644--- a/tests/validators/test_security.py+++ b/tests/validators/test_security.py@@ -6,8 +6,10 @@import jsonimport osimport re+import structimport subprocessimport sys+import zlibfrom pathlib import Pathfrom unittest.mock import patch@@ -21,6 +23,8 @@ from skillevaluator.validators.base import Finding, Severity, ValidationResultfrom skillevaluator.validators.schema import SchemaValidatorfrom skillevaluator.validators.security import (SecurityValidator,+ _is_jpeg,+ _is_png,_skillspector_child_env,_skillspector_llm_env,_skillspector_timeout_seconds,@@ -6149,3 +6153,431 @@ class TestSpdxAndIpFalsePositiveHardening:for finding in result.findingsif finding.check_name == "ip_addresses"] == ["8.8.8.8"]+++def _png_chunk(kind: bytes, data: bytes) -> bytes:+ """Return one PNG chunk with its length and CRC."""+ return struct.pack(">I", len(data)) + kind + data + struct.pack(">I", zlib.crc32(kind + data))+++def _png_header(width: int = 1, height: int = 1, depth: int = 8, colour: int = 2, interlace: int = 0) -> bytes:+ """Return an IHDR chunk."""+ return _png_chunk(b"IHDR", struct.pack(">IIBBBBB", width, height, depth, colour, 0, 0, interlace))+++def _png_bytes() -> bytes:+ """Return the 1x1 PNG that the referenced-image SkillSpector fixtures scanned."""+ return (+ b"\x89PNG\r\n\x1a\n"+ + _png_header()+ + _png_chunk(b"IDAT", zlib.compress(b"\x00\xff\xff\xff"))+ + _png_chunk(b"IEND", b"")+ )+++def _jpeg_segment(marker: int, payload: bytes) -> bytes:+ """Return one JPEG marker segment with its length."""+ return bytes((0xFF, marker)) + struct.pack(">H", len(payload) + 2) + payload+++# One Huffman table with a single 1-bit code for symbol 0.+_JPEG_HUFFMAN = bytes([1]) + bytes(15) + b"\x00"+_JPEG_APP0 = _jpeg_segment(0xE0, b"JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00")+_JPEG_DQT = _jpeg_segment(0xDB, b"\x00" + bytes([1]) * 64)+_JPEG_SOF = _jpeg_segment(0xC0, b"\x08\x00\x01\x00\x01\x01\x01\x11\x00")+_JPEG_DHT = _jpeg_segment(0xC4, b"\x00" + _JPEG_HUFFMAN + b"\x10" + _JPEG_HUFFMAN)+_JPEG_SOS = _jpeg_segment(0xDA, b"\x01\x01\x00\x00\x3f\x00")+++def _jpeg_bytes() -> bytes:+ """Return the 1x1 grey baseline JPEG that the path-reference SkillSpector fixture scanned."""+ return b"\xff\xd8" + _JPEG_APP0 + _JPEG_DQT + _JPEG_SOF + _JPEG_DHT + _JPEG_SOS + b"\x3f" + b"\xff\xd9"+++def _referenced_image_report(name: str) -> dict:+ """Load a captured SkillSpector ``--no-llm`` report for a skill that references images.++ The scanned skill is ``SKILL.md`` plus the files written by :func:`_png_bytes`+ (``assets/logo.png``) and, for the path-reference report, :func:`_jpeg_bytes`+ (``assets/photo.jpg``). The image-reference reports render the PNG with+ ````; the path-reference report names both+ files in inline code, for which SkillSpector also reports a High AE1 finding.+ """+ return json.loads((Path(__file__).parents[1] / "fixtures" / name).read_text(encoding="utf-8"))+++class TestSkillspectorReferencedImages:+ """SkillSpector records a referenced image it cannot read as a ``partial`` analysis."""++ @pytest.mark.parametrize(+ "fixture",+ [+ "skillspector-2.12.0-image-reference-no-llm.json",+ "skillspector-2.13.2-image-reference-no-llm.json",+ ],+ )+ @patch("skillevaluator.validators.security.Tools")+ def test_verified_png_reference_completes_the_scan(self, mock_tools, sample_skill_dir: Path, fixture: str) -> None:+ (sample_skill_dir / "assets").mkdir()+ (sample_skill_dir / "assets" / "logo.png").write_bytes(_png_bytes())++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, _referenced_image_report(fixture))++ assert result.passed+ assert result.status == "passed"+ assert not result.errors+ assert any(+ "1 referenced image file(s) (assets/logo.png)" in warning and "not marked incomplete" in warning+ for warning in result.warnings+ )+ assert any(detail.check_name == "skillspector" for detail in result.success_details)++ @patch("skillevaluator.validators.security.Tools")+ def test_verified_image_paths_keep_scanner_findings(self, mock_tools, sample_skill_dir: Path) -> None:+ (sample_skill_dir / "assets").mkdir()+ (sample_skill_dir / "assets" / "logo.png").write_bytes(_png_bytes())+ (sample_skill_dir / "assets" / "photo.jpg").write_bytes(_jpeg_bytes())++ result = _validate_skillspector_payload(+ mock_tools,+ sample_skill_dir,+ _referenced_image_report("skillspector-2.12.0-image-path-reference-no-llm.json"),+ )++ assert not result.is_incomplete+ assert result.status == "failed"+ assert sorted(finding.message for finding in result.findings if finding.severity == Severity.HIGH) == [+ "analysis-evasion: assets/logo.png (partial)",+ "analysis-evasion: assets/photo.jpg (partial)",+ ]+ assert any("(assets/logo.png, assets/photo.jpg)" in warning for warning in result.warnings)++ @patch("skillevaluator.validators.security.Tools")+ def test_verified_png_reference_completes_the_llm_stage(self, mock_tools, sample_skill_dir: Path) -> None:+ (sample_skill_dir / "assets").mkdir()+ (sample_skill_dir / "assets" / "logo.png").write_bytes(_png_bytes())+ static = _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json")+ enriched = _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json")+ enriched["metadata"].update({"llm_requested": True, "llm_available": True})+ for status in enriched["analysis_completeness"]["analyzer_statuses"]:+ if status["status"] == "disabled":+ status.update({"status": "completed", "planned_work": 1, "completed": 1, "reason_code": None})+ mock_tools.skillspector.is_available = True+ mock_tools.skillspector.run.side_effect = [+ ToolResult(success=True, stdout=json.dumps(report), stderr="", exit_code=0) for report in (static, enriched)+ ]++ result = SecurityValidator(use_llm=True).validate_security_only(sample_skill_dir)++ assert mock_tools.skillspector.run.call_count == 2+ assert result.passed+ assert result.incomplete_scans == []+ assert sum("referenced image" in warning for warning in result.warnings) == 1+ assert result.summary.warnings == len(result.warnings)++ @pytest.mark.skipif(os.name == "nt", reason="POSIX hard-link semantics")+ @patch("skillevaluator.validators.security.Tools")+ def test_staged_scan_verifies_images_in_the_original_tree(+ self, mock_tools, sample_skill_dir: Path, tmp_path: Path+ ) -> None:+ (sample_skill_dir / "assets").mkdir()+ (sample_skill_dir / "assets" / "logo.png").write_bytes(_png_bytes())+ (sample_skill_dir / "evals" / "results").mkdir(parents=True)+ # copytree breaks hard links; only verification of the original tree rejects this image.+ os.link(sample_skill_dir / "assets" / "logo.png", tmp_path / "elsewhere.png")++ result = _validate_skillspector_payload(+ mock_tools,+ sample_skill_dir,+ _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json"),+ )++ scanned = Path(mock_tools.skillspector.run.call_args.args[0][1])+ assert scanned != sample_skill_dir.resolve()+ assert result.is_incomplete+ assert result.incomplete_scans == ["skillspector"]+ assert not any("referenced image" in warning for warning in result.warnings)++ @patch("skillevaluator.validators.security.Tools")+ def test_incomplete_llm_stage_keeps_each_findings_warning(self, mock_tools, sample_skill_dir: Path) -> None:+ issue = {+ "id": "PI-1",+ "category": "Prompt Injection",+ "pattern": "Instruction override",+ "severity": "MEDIUM",+ "finding": "Ignore prior instructions",+ "location": {"file": "SKILL.md", "start_line": 8},+ }+ static = _skillspector_json_report([issue])+ enriched = _skillspector_json_report([issue], llm_requested=True, llm_available=True)+ for report in (static, enriched):+ report["risk_assessment"] = {"score": 50, "severity": "MEDIUM", "recommendation": "CAUTION"}+ enriched["analysis_completeness"].update(+ {+ "is_complete": False,+ "limitations": ["Transitive traversal truncated: target budget 1 reached"],+ }+ )+ mock_tools.skillspector.is_available = True+ mock_tools.skillspector.run.side_effect = [+ ToolResult(success=True, stdout=json.dumps(report), stderr="", exit_code=0) for report in (static, enriched)+ ]++ result = SecurityValidator(use_llm=True).validate_security_only(sample_skill_dir)++ assert result.incomplete_scans == ["skillspector-llm"]+ assert len(result.findings) == 2+ assert result.warnings.count(+ "[SECURITY-MEDIUM] Prompt Injection: Ignore prior instructions in SKILL.md:8"+ ) == 2+ assert result.summary.warnings == len(result.warnings)++ @pytest.mark.parametrize(+ "path",+ ["docs/images/logo.png", "references/hooks.png", "templates/config/logo.png", ".github/logo.png"],+ )+ @patch("skillevaluator.validators.security.Tools")+ def test_verified_png_outside_agent_control_directories(+ self, mock_tools, sample_skill_dir: Path, path: str+ ) -> None:+ payload = _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json")+ payload["analysis_completeness"]["ledger_exceptions"][0]["path"] = payload["components"][1]["path"] = path+ image = sample_skill_dir / path+ image.parent.mkdir(parents=True)+ image.write_bytes(_png_bytes())++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert result.passed+ assert any(f"1 referenced image file(s) ({path})" in warning for warning in result.warnings)++ @pytest.mark.parametrize(+ "case",+ [+ "missing",+ "text-bytes",+ "elf-bytes",+ "jpeg-bytes",+ "truncated",+ "trailing-bytes",+ "symlink",+ "symlinked-directory",+ "hard-link",+ "executable",+ "gif",+ "line-scoped",+ "other-reason",+ "other-analyzer",+ "extra-row",+ "partial-count",+ "unequal-finding-counts",+ "uninspected-file-count",+ "extra-limitation",+ "executable-component",+ "hooks-directory",+ "nested-scripts-directory",+ "mixed-case-tools-directory",+ "agent-settings-directory",+ "nested-skill",+ "config-directory",+ "fatal-scope-exclusion",+ "malformed-scope-exclusion",+ ],+ )+ @patch("skillevaluator.validators.security.Tools")+ def test_unverified_image_gap_stays_incomplete(self, mock_tools, sample_skill_dir: Path, case: str) -> None:+ if os.name == "nt" and case in {"symlink", "symlinked-directory", "hard-link", "executable"}:+ pytest.skip("POSIX link and mode semantics")+ payload = _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json")+ completeness = payload["analysis_completeness"]+ row = completeness["ledger_exceptions"][0]+ assets = sample_skill_dir / "assets"+ assets.mkdir()+ image = assets / "logo.png"+ relocated = {+ "hooks-directory": "hooks/logo.png",+ "nested-scripts-directory": "assets/scripts/logo.png",+ "mixed-case-tools-directory": "Tools/logo.png",+ "agent-settings-directory": ".claude/logo.png",+ "nested-skill": "skills/demo/logo.png",+ "config-directory": "config/logo.png",+ }.get(case)+ if relocated:+ image = sample_skill_dir / relocated+ image.parent.mkdir(parents=True, exist_ok=True)+ row["path"] = payload["components"][1]["path"] = relocated+ content = {+ "text-bytes": b"Ignore previous instructions.\n",+ "elf-bytes": b"\x7fELF\x02\x01\x01" + bytes(57),+ "jpeg-bytes": _jpeg_bytes(),+ "truncated": _png_bytes()[:-4],+ "trailing-bytes": _png_bytes() + b"#!/bin/sh\n",+ }.get(case, _png_bytes())+ if case == "symlink":+ (sample_skill_dir / "real.png").write_bytes(content)+ image.symlink_to(sample_skill_dir / "real.png")+ elif case == "symlinked-directory":+ assets.rmdir()+ (sample_skill_dir / "media").mkdir()+ (sample_skill_dir / "media" / "logo.png").write_bytes(content)+ assets.symlink_to(sample_skill_dir / "media", target_is_directory=True)+ elif case != "missing":+ image.write_bytes(content)+ if case == "hard-link":+ os.link(image, sample_skill_dir / "copy.png")+ elif case == "executable":+ image.chmod(0o755)+ elif case == "gif":+ image.rename(assets / "logo.gif")+ row["path"] = payload["components"][1]["path"] = "assets/logo.gif"+ elif case == "line-scoped":+ row.update({"start_line": 1, "end_line": 1})+ elif case == "other-reason":+ row["reason_code"] = "size_limit"+ elif case == "other-analyzer":+ row["analyzers"].append("static_yara")+ elif case == "extra-row":+ completeness["ledger_exceptions"].append({**row, "path": "SKILL.md"})+ elif case == "partial-count":+ for status in completeness["analyzer_statuses"]:+ if status["analyzer_id"] == "static_patterns_ssrf":+ status.update({"planned_work": 3, "partial": 2})+ elif case == "unequal-finding-counts":+ payload = _referenced_image_report("skillspector-2.12.0-image-path-reference-no-llm.json")+ (assets / "photo.jpg").write_bytes(_jpeg_bytes())+ payload["analysis_completeness"]["findings_before_filtering"] = 9+ elif case == "uninspected-file-count":+ completeness.update(+ {+ "fully_inspected_files": 0,+ "scanned_components": 0,+ "entirely_uninspected_files": 2,+ "coverage_percent": 0.0,+ }+ )+ elif case == "extra-limitation":+ completeness["limitations"].append("Analyzer static_yara status: degraded.")+ elif case == "executable-component":+ payload["components"][1]["executable"] = True+ elif case == "fatal-scope-exclusion":+ completeness["scope_exclusions"].append(+ {**row, "outcome": "out_of_scope", "path": "big.bin", "fatal": True}+ )+ elif case == "malformed-scope-exclusion":+ completeness["scope_exclusions"].append("big.bin")++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert result.is_incomplete+ assert result.incomplete_scans == ["skillspector"]+ assert any("reports incomplete analysis (status 'partial')" in error for error in result.errors)+ assert not any("referenced image" in warning for warning in result.warnings)++ @pytest.mark.parametrize("limit", ["_PASSIVE_RASTER_MAX_FILES", "_PASSIVE_RASTER_MAX_BYTES"])+ @patch("skillevaluator.validators.security.Tools")+ def test_image_verification_is_bounded(self, mock_tools, sample_skill_dir: Path, limit: str) -> None:+ (sample_skill_dir / "assets").mkdir()+ (sample_skill_dir / "assets" / "logo.png").write_bytes(_png_bytes())++ with patch(f"skillevaluator.validators.security.{limit}", 0):+ result = _validate_skillspector_payload(+ mock_tools,+ sample_skill_dir,+ _referenced_image_report("skillspector-2.12.0-image-reference-no-llm.json"),+ )++ assert result.is_incomplete++ def test_image_structure_checks(self) -> None:+ elf = b"\x7fELF\x02\x01\x01" + bytes(57)+ png = _png_bytes()+ ihdr, idat, iend = png[8:33], png[33:-12], png[-12:]++ def png_of(*chunks: bytes) -> bytes:+ return b"\x89PNG\r\n\x1a\n" + b"".join(chunks)++ compressed = zlib.compress(b"\x00\xff\xff\xff")+ palette = _png_header(colour=3)+ plte = _png_chunk(b"PLTE", b"\x00\x00\x00")+ paletted_idat = _png_chunk(b"IDAT", zlib.compress(b"\x00\x00"))+ assert _is_png(png)+ assert _is_png(png_of(ihdr, _png_chunk(b"IDAT", compressed[:1]), _png_chunk(b"IDAT", compressed[1:]), iend))+ assert _is_png(png_of(palette, plte, paletted_idat, iend))+ # Structure corroborates the type; ancillary chunks are not interpreted.+ assert _is_png(png_of(ihdr, _png_chunk(b"tEXt", b"Comment\x00" + elf), idat, iend))+ for rejected in (+ png[:12] + b"IHDX" + png[16:], # unknown chunk type in place of IHDR+ png[:-1] + bytes([png[-1] ^ 1]), # bad CRC+ png_of(idat, iend), # no IHDR+ png_of(ihdr, ihdr, idat, iend), # second IHDR+ png_of(ihdr, iend), # no IDAT+ png_of(_png_header(width=0), idat, iend),+ png_of(_png_header(height=0), idat, iend),+ png_of(_png_header(depth=4), idat, iend), # bit depth not allowed for RGB+ png_of(_png_header(colour=5), idat, iend),+ png_of(_png_header(interlace=2), idat, iend),+ png_of(ihdr, _png_chunk(b"EVIL", elf), idat, iend), # unknown critical chunk+ png_of(ihdr, _png_chunk(b"tExt", b""), idat, iend), # reserved bit set+ png_of(ihdr, idat, _png_chunk(b"tEXt", b"a\x00b"), idat, iend), # IDAT run split+ png_of(ihdr, _png_chunk(b"IDAT", elf), iend), # not a zlib stream+ png_of(palette, paletted_idat, iend), # palette missing+ png_of(_png_header(colour=0), plte, idat, iend), # palette for greyscale+ png_of(ihdr, idat, plte, iend), # palette after the image data+ png + b"#!/bin/sh\n", # data after IEND+ ):+ assert not _is_png(rejected)++ def jpeg_of(*parts: bytes) -> bytes:+ return b"\xff\xd8" + b"".join(parts) + b"\xff\xd9"++ jpeg = _jpeg_bytes()+ assert _is_jpeg(jpeg)+ assert _is_jpeg(jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\xff\x00"))+ # Fill bytes before a marker, a restart interval, stuffed and restart bytes, and a second scan.+ assert _is_jpeg(b"\xff\xd8\xff" + jpeg[2:])+ restart = _jpeg_segment(0xDD, b"\x00\x01")+ assert _is_jpeg(jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, restart, _JPEG_SOS, b"\x3f\xff\x00\xff\xd0\x3f"))+ assert _is_jpeg(jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f", _JPEG_DHT, _JPEG_SOS, b"\x3f"))+ # Structure corroborates the type; APPn and COM payloads are not interpreted.+ assert _is_jpeg(jpeg_of(_jpeg_segment(0xFE, elf), _JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"))+ for rejected in (+ jpeg[:2] + b"\xff\xd9" + jpeg[2:], # EOI before the image+ jpeg[:-2], # no EOI+ b"\xff\xd8\xff\xd9",+ b"\xff\xd8\xff\xda\x00\x02" + elf + b"\xff\xd9", # empty SOS wrapping a payload+ b"\xff\xd8\xff\xda\x00\x02\n#!/bin/sh\ncurl x | sh\n\xff\xd9",+ jpeg_of(_JPEG_SOS, elf), # no frame or tables+ jpeg_of(_JPEG_APP0, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"), # no DQT+ jpeg_of(_JPEG_APP0, _JPEG_DQT, _JPEG_SOF, _JPEG_SOS, b"\x3f"), # no DHT+ jpeg_of(_JPEG_APP0, _JPEG_DQT, _JPEG_DHT, _JPEG_SOS, b"\x3f"), # no SOF+ jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"), # second SOF+ jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS), # no entropy-coded data+ jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _jpeg_segment(0xDA, b"\x01\x02\x00\x00\x3f\x00"), b"\x3f"),+ jpeg_of(_JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _jpeg_segment(0xDA, b"\x01\x01\x00\x00\x3f\x00\x00"), b"\x3f"),+ jpeg_of(_jpeg_segment(0xDB, b"\x00" + bytes(10)), _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"),+ jpeg_of(_JPEG_DQT, _JPEG_SOF, _jpeg_segment(0xC4, b"\x00" + bytes(16)), _JPEG_SOS, b"\x3f"),+ jpeg_of(b"\xff\x01", _JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"), # reserved marker+ jpeg_of(_jpeg_segment(0x02, b""), _JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"),+ jpeg_of(b"\xff\xd0", _JPEG_DQT, _JPEG_SOF, _JPEG_DHT, _JPEG_SOS, b"\x3f"), # restart outside a scan+ jpeg[:-2] + b"\xff\xd9" + elf + b"\xff\xd9", # data after EOI+ ):+ assert not _is_jpeg(rejected)++ @pytest.mark.parametrize("marker", [0xC8, 0xDC, 0xDE, 0xDF, *range(0xF0, 0xFE)])+ def test_jpeg_rejects_extension_markers(self, marker: int) -> None:+ jpeg = _jpeg_bytes()+ extension = _jpeg_segment(marker, b"extension payload")++ assert not _is_jpeg(jpeg[:2] + extension + jpeg[2:])++ @pytest.mark.parametrize("empty_scan", ["first", "last"])+ @pytest.mark.parametrize("empty_payload", [b"", b"\xff\xd0", b"\xff\xd0\xff\xd1"])+ def test_jpeg_requires_entropy_data_in_every_scan(self, empty_scan: str, empty_payload: bytes) -> None:+ scans = (+ _JPEG_SOS + empty_payload + _JPEG_SOS + b"\x3f"+ if empty_scan == "first"+ else _JPEG_SOS + b"\x3f" + _JPEG_SOS + empty_payload+ )+ jpeg = b"\xff\xd8" + _JPEG_DQT + _JPEG_SOF + _JPEG_DHT + scans + b"\xff\xd9"++ assert not _is_jpeg(jpeg)