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): handle read-only passwd mounts with SkillSpector 2.13.3 (#289)
Narendran Raghavanffa78ba1344f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 63ea6bfe..6ff41f92 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -317,6 +317,20 @@ All notable changes to SkillEvaluator are documented in this file.single commands need longer can raise Claude Code's default with`BASH_DEFAULT_TIMEOUT_MS` in `harbor.runtime_env`.+- Tier 1 security scans no longer fail a skill for an exact read-only+ `/etc/passwd` bind mount such as `docker run -v /etc/passwd:/etc/passwd:ro`.+ SkillSpector 2.11.1 and later tags this mount as likely benign but still+ reports a HIGH Credential Access (PE3) finding. That finding is now ignored+ only when it carries both benign-context tags and every `/etc/passwd` on the+ reported source line, read without following links, is the source or target+ of such a mount. The aggregate risk score is recomputed without it. Writable+ or implicit-mode mounts, other paths, same-line reads such as+ `cat /etc/passwd`, aggregated rows, and earlier SkillSpector versions still+ block. Captured SkillSpector 2.13.3 reports cover both mount operands and a+ separate blocking read, and partial LLM-response inspection stays incomplete.+ Static reports are accepted when a provider is available but LLM analysis+ was neither requested nor applied; availability alone is not execution.+- PII email scans recognize all RFC 2606 reserved domains, including theirsubdomains, mixed-case forms, trailing dots, and prose ellipses. A local-partboundary prevents quadratic rescanning of long excluded addresses. Ordinarydiff --git a/docs/tier1-validation.mdx b/docs/tier1-validation.mdxindex c92402a3..1d53aa13 100644--- a/docs/tier1-validation.mdx+++ b/docs/tier1-validation.mdx@@ -186,6 +186,10 @@ For `validate`, the default set is `schema`, `version`, `security`, `pii`, `lice- `skillspector_provider_id`: the SkillEvaluator provider the scan was bridged from (`nv_build`, `openai`, `openai-compatible`, `anthropic`, or `bedrock`). `nv_build` and `openai-compatible` both run as SkillSpector's `openai` adapter. The field is omitted when `SKILLSPECTOR_PROVIDER` selects a SkillSpector adapter directly (`anthropic`, `bedrock`, or `openai`) or names an unsupported provider. `SKILLSPECTOR_PROVIDER=nv_build` is bridged like `SKILL_EVAL_LLM_PROVIDER=nv_build` and recorded as `nv_build`.The HTML report shows the same data in the **Tier 1 LLM Provenance** table on the Tier 1 tab. The record contains no prompts, endpoints, or credentials. A record that does not match SkillSpector's provenance contract, or that contains a URL or credential-shaped value, is left out rather than partially shown. If the LLM stage fails or SkillSpector does not confirm LLM analysis, a valid record in SkillSpector's output is still kept to show what was attempted, and the Security result stays incomplete. Provenance is recorded when you scan a single skill. A scan of a folder with several skills does not record it yet.++ SkillSpector 2.11.1 and later tags an exact read-only `/etc/passwd` bind mount, such as `docker run -v /etc/passwd:/etc/passwd:ro` or the Podman, `--volume`, and quoted forms, as likely benign but still reports it as a HIGH Credential Access (PE3) finding. SkillEvaluator ignores that finding only when SkillSpector tagged it benign and every `/etc/passwd` on the reported source line is the source or target of such a mount. Writable or implicit-mode mounts, other source or target paths, and reads such as `cat /etc/passwd` still block.++ SkillSpector 2.13.3 can report separate findings for the mount's source and target; both must pass the same checks. Ignoring a mount never clears incomplete inspection, including refused or truncated LLM responses. A static report can say an LLM provider is available without having requested or applied LLM analysis; provider availability alone does not invalidate the static scan.</Accordion><Accordion title="pii — PII, credentials, and local identifiers">diff --git a/src/skillevaluator/validators/security.py b/src/skillevaluator/validators/security.pyindex 7fb1884c..e862c689 100644--- a/src/skillevaluator/validators/security.py+++ b/src/skillevaluator/validators/security.py@@ -86,6 +86,22 @@ _SKILLSPECTOR_DOCS_ONLY_NOT_APPLICABLE_ANALYZERS = frozenset("meta_analyzer",})+# SkillSpector 2.11.1+ classifies each occurrence separately, so benign-context+# tags describe the reported row instead of a compacted sibling.+_SKILLSPECTOR_OCCURRENCE_TRIAGE_VERSION = (2, 11, 1)+_SKILLSPECTOR_BENIGN_CONTEXT_TAGS = frozenset({"contextual-triage", "likely-benign-context"})+_SKILLSPECTOR_PASSWD_MOUNT_SOURCE_LIMIT_BYTES = 1024 * 1024+_PASSWD_PATH_PATTERN = re.compile(r"/etc/passwd", re.IGNORECASE)+# SkillSpector's own bounded grammar for an exact read-only UID-map mount.+_READ_ONLY_PASSWD_VOLUME_PATTERN = re.compile(+ r"\b(?:docker|podman)\s+run\b"+ r"(?:(?:\\\r?\n)|[^\n;&|]){0,1000}?"+ r"(?:-v|--volume)(?:=|\s+)"+ r"(?P<quote>['\"]?)"+ r"(?P<source>/etc/passwd):(?P<target>/etc/passwd):ro"+ r"(?P=quote)(?=$|[\s\\])",+ re.IGNORECASE | re.MULTILINE,+)def _is_filesystem_safe_path_text(value: str) -> bool:@@ -2086,9 +2102,10 @@ class SecurityValidator(ValidatorBase):"security scan did not complete")return False+ # Provider availability is independent of execution: configured+ # credentials do not contradict a --no-llm report.if not use_llm and (metadata.get("llm_requested") not in {None, False}- or metadata.get("llm_available") not in {None, False}or metadata.get("meta_analysis_applied") not in {None, False}):result.add_error(@@ -2595,10 +2612,14 @@ class SecurityValidator(ValidatorBase):self._store_skillspector_metadata(data, result)issues = data.get("issues", [])+ report_metadata = data.get("metadata") if isinstance(data.get("metadata"), dict) else {}+ raw_version = report_metadata.get("skillspector_version")scanned_issues = []removed_issues = []skipped_generated = 0skipped_spdx_comments = 0+ skipped_passwd_mounts = 0+ passwd_mount_lines: dict[str, frozenset[int]] = {}has_critical_or_high = Falsefor issue in issues:if not isinstance(issue, dict):@@ -2611,6 +2632,15 @@ class SecurityValidator(ValidatorBase):removed_issues.append(issue)skipped_spdx_comments += 1continue+ if self._is_read_only_passwd_mount_issue(+ issue,+ scanner_version=raw_version,+ source_root=source_root,+ safe_lines_by_file=passwd_mount_lines,+ ):+ removed_issues.append(issue)+ skipped_passwd_mounts += 1+ continuescanned_issues.append(issue)finding, is_error = self._convert_skillspector_issue(issue)if is_error:@@ -2621,11 +2651,11 @@ class SecurityValidator(ValidatorBase):result.add_message(f"skillspector ignored {skipped_generated} generated artifact issue(s)")if skipped_spdx_comments:result.add_message(f"skillspector ignored {skipped_spdx_comments} SPDX-only HTML comment issue(s)")+ if skipped_passwd_mounts:+ result.add_message(f"skillspector ignored {skipped_passwd_mounts} read-only /etc/passwd mount issue(s)")reported_score = data["risk_assessment"]["score"]report_components = data.get("components") if isinstance(data.get("components"), list) else []- report_metadata = data.get("metadata") if isinstance(data.get("metadata"), dict) else {}- raw_version = report_metadata.get("skillspector_version")uses_report_identities = (isinstance(raw_version, str)and SEMVER_RE.fullmatch(raw_version) is not None@@ -2656,7 +2686,7 @@ class SecurityValidator(ValidatorBase):removed_issues=removed_issues,all_findings_serialized=findings_after_filtering == serialized_findings,)- if skipped_generated or skipped_spdx_comments+ if skipped_generated or skipped_spdx_comments or skipped_passwd_mountselse reported_score)if effective_score > 50 and not has_critical_or_high:@@ -2718,6 +2748,99 @@ class SecurityValidator(ValidatorBase):allow_frontmatter_separator=True,)+ @staticmethod+ def _is_read_only_passwd_mount_issue(+ issue: dict,+ *,+ scanner_version: object,+ source_root: Path | None,+ safe_lines_by_file: dict[str, frozenset[int]],+ ) -> bool:+ """Suppress only a benign-tagged PE3 on an exact read-only passwd mount.++ SkillSpector tags ``docker run -v /etc/passwd:/etc/passwd:ro`` (and its+ Podman, ``--volume`` and quoted forms) as likely benign context but+ still reports it as a HIGH Credential Access finding. Trust those tags+ only where each occurrence is classified separately, and re-check the+ reported source line: every ``/etc/passwd`` on it must be the source or+ target of an exact read-only mount. Writable or implicit-mode mounts,+ other paths, same-line reads such as ``cat /etc/passwd``, aggregated+ rows, unsafe or unreadable locations, and older scanners stay reported.+ """+ tags = issue.get("tags")+ if (+ issue.get("id") != "PE3"+ or issue.get("pattern") != "Credential Access"+ or issue.get("finding") != "/etc/passwd"+ or not isinstance(tags, list)+ or not all(isinstance(tag, str) for tag in tags)+ or not _SKILLSPECTOR_BENIGN_CONTEXT_TAGS.issubset(tags)+ or not isinstance(scanner_version, str)+ or SEMVER_RE.fullmatch(scanner_version) is None+ or tuple(int(part) for part in scanner_version.split(".")) < _SKILLSPECTOR_OCCURRENCE_TRIAGE_VERSION+ or source_root is None+ ):+ return False++ location = issue.get("location")+ occurrences = issue.get("occurrences")+ if not isinstance(location, dict) or not isinstance(occurrences, list) or len(occurrences) != 1:+ return False+ occurrence = occurrences[0]+ if not isinstance(occurrence, dict) or any(+ occurrence.get(field) != location.get(field) for field in ("file", "start_line", "end_line")+ ):+ return False+ file_path = location.get("file")+ line_number = location.get("start_line")+ if (+ not isinstance(file_path, str)+ or not _is_filesystem_safe_path_text(file_path)+ or isinstance(line_number, bool)+ or not isinstance(line_number, int)+ or location.get("end_line") not in (None, line_number)+ ):+ return False++ if file_path not in safe_lines_by_file:+ safe_lines_by_file[file_path] = SecurityValidator._read_only_passwd_mount_lines(source_root, file_path)+ return line_number in safe_lines_by_file[file_path]++ @staticmethod+ def _read_only_passwd_mount_lines(source_root: Path, file_path: str) -> frozenset[int]:+ """Return lines whose every ``/etc/passwd`` belongs to an exact read-only mount.++ The file is read once, without following links, from beneath the scan+ root. Unreadable, oversized, non-UTF-8, or out-of-root files yield no+ lines, which keeps their findings reported.+ """+ root = Path(os.path.abspath(source_root)) # noqa: PTH100 - do not follow untrusted path links+ relative = Path(file_path)+ try:+ if relative.is_absolute():+ relative = relative.relative_to(root)+ with SecureRoot(root) as secure_root:+ raw, _metadata = secure_root.read_bytes(relative, _SKILLSPECTOR_PASSWD_MOUNT_SOURCE_LIMIT_BYTES)+ content = raw.decode("utf-8")+ except (OSError, SecurePathError, UnicodeError, ValueError):+ return frozenset()++ mount_path_starts = {+ volume.start(group)+ for volume in _READ_ONLY_PASSWD_VOLUME_PATTERN.finditer(content)+ for group in ("source", "target")+ }+ safe_lines = set()+ offset = 0+ # str.splitlines() uses the same logical line breaks as SkillSpector's+ # reported line numbers.+ for line_number, line in enumerate(content.splitlines(keepends=True), start=1):+ passwd_starts = [offset + match.start() for match in _PASSWD_PATH_PATTERN.finditer(line)]+ if passwd_starts and all(start in mount_path_starts for start in passwd_starts):+ safe_lines.add(line_number)+ offset += len(line)+ return frozenset(safe_lines)+@staticmethoddef _store_skillspector_metadata(data: dict, result: ValidationResult) -> None:"""Store the validated SkillSpector report metadata on the result."""diff --git a/tests/fixtures/skillspector-2.13.3-passwd-mount/README.md b/tests/fixtures/skillspector-2.13.3-passwd-mount/README.mdnew file mode 100644index 00000000..556161e0--- /dev/null+++ b/tests/fixtures/skillspector-2.13.3-passwd-mount/README.md@@ -0,0 +1,66 @@+# SkillSpector 2.13.3 read-only mount reports++These reports were captured with `skillspector scan --no-llm --format json`+from the published `v2.13.3` tag, commit+`38a1dfe93325d2f8bfcd4f8d0241eed706334915`. They are newly generated reports,+not older fixtures with a changed version. Only the temporary scan-root prefix+was normalized; finding identities, scores, timestamps, provenance and+completeness accounting are scanner output.++Both input directories contained this `SKILL.md`:++```markdown+---+name: passwd-mount-probe+description: Build a project in a container as the host user.+---++# Container build++Run `sh build.sh` to build the project in a container.+```++`build.sh` was executable (mode `0755`). For `read-only.json`:++```sh+#!/bin/sh+docker run -v /etc/passwd:/etc/passwd:ro image+```++For `separate-read.json`:++```sh+#!/bin/sh+docker run -v /etc/passwd:/etc/passwd:ro image+cat /etc/passwd+```++Each mount emits two HIGH PE3 rows with distinct `finding_id` values, one+for each path operand, plus an unrelated MEDIUM RP1 image-pinning advisory.+The separate read emits a third, untagged HIGH PE3 row on line 3. Both scans+return exit code `0`, with complete inspection and aggregate scores `39`+and `43`, respectively; SkillEvaluator still blocks the actual HIGH read.++The captures have `llm_requested=false`, `meta_analysis_applied=false`, empty+`inference_usage`, heuristic filtering and disabled semantic analyzers.+`llm_available=true` means a provider was configured, independently of+`--no-llm`. The provenance correctly says execution was not applicable.+No LLM calls were requested. The adapter tests also exercise unavailable+providers by changing only that availability flag in memory.++To regenerate, create the input directories above, keep report destinations+outside the inputs, and run:++```sh+for case in read-only separate-read; do+ OPENAI_API_KEY=fixture-only SKILLSPECTOR_PROVIDER=openai uvx \+ --from git+https://github.com/NVIDIA/[email protected] \+ skillspector scan "/tmp/skillspector-2.13.3-passwd-mount/$case" \+ --no-llm --format json --output "$case.json"+done+```++The placeholder key makes provider availability reproducible without using+credentials. Findings and timestamps must be regenerated and reviewed rather+than copied across scanner releases. Partial LLM-response tests are explicitly+synthetic mutations of these reports; they are not additional captured scans.diff --git a/tests/fixtures/skillspector-2.13.3-passwd-mount/read-only.json b/tests/fixtures/skillspector-2.13.3-passwd-mount/read-only.jsonnew file mode 100644index 00000000..60fcad33--- /dev/null+++ b/tests/fixtures/skillspector-2.13.3-passwd-mount/read-only.json@@ -0,0 +1,563 @@+{+ "skill": {+ "name": "passwd-mount-probe",+ "source": "/private/tmp/skillspector-2.13.3-passwd-mount/read-only",+ "scanned_at": "2026-11-02T20:00:19.555979+00:00"+ },+ "risk_assessment": {+ "score": 39,+ "severity": "MEDIUM",+ "recommendation": "CAUTION",+ "max_issue_severity": "HIGH"+ },+ "components": [+ {+ "path": "SKILL.md",+ "type": "markdown",+ "lines": 8,+ "executable": false,+ "size_bytes": 170,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "build.sh",+ "type": "shell",+ "lines": 2,+ "executable": true,+ "size_bytes": 57,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ }+ ],+ "structured_summaries": [],+ "issues": [+ {+ "id": "PE3",+ "finding_id": "finding-e82bffeb50f5487b9a62bf56959431ab",+ "category": "Privilege Escalation",+ "pattern": "Credential Access",+ "severity": "HIGH",+ "confidence": 0.6,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 14+ },+ "finding": "/etc/passwd",+ "explanation": "Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.",+ "remediation": "Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.",+ "code_snippet": "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image",+ "intent": null,+ "tags": [+ "Privilege Escalation",+ "contextual-triage",+ "likely-benign-context"+ ],+ "evidence": {},+ "match_fingerprint": "ac75eea6ed115d0252fb13bbb10e9c4421764d5a7612787edcde6a78569d8f88",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 14+ }+ ]+ },+ {+ "id": "PE3",+ "finding_id": "finding-06b62172831f44bcad6b4ff73ec9cb0f",+ "category": "Privilege Escalation",+ "pattern": "Credential Access",+ "severity": "HIGH",+ "confidence": 0.6,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 26+ },+ "finding": "/etc/passwd",+ "explanation": "Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.",+ "remediation": "Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.",+ "code_snippet": "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image",+ "intent": null,+ "tags": [+ "Privilege Escalation",+ "contextual-triage",+ "likely-benign-context"+ ],+ "evidence": {},+ "match_fingerprint": "ac75eea6ed115d0252fb13bbb10e9c4421764d5a7612787edcde6a78569d8f88",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 26+ }+ ]+ },+ {+ "id": "RP1",+ "finding_id": "finding-812725d36e59428a80f2d71178ce7f2a",+ "category": "MCP Rug Pull",+ "pattern": null,+ "severity": "MEDIUM",+ "confidence": 0.75,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null+ },+ "finding": null,+ "explanation": "Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.",+ "remediation": "Pin the image: image:tag or image@sha256:abc123",+ "code_snippet": null,+ "intent": null,+ "tags": [+ "ASI16"+ ],+ "evidence": {},+ "match_fingerprint": "c40efebb64946fad1ac9260f3622867d7ffb95e17a1c6f66b67bb614d7a5ba02",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null+ }+ ]+ }+ ],+ "suppressed_count": 0,+ "suppressed": [],+ "metadata": {+ "has_executable_scripts": true,+ "skillspector_version": "2.13.3",+ "llm_requested": false,+ "llm_available": true,+ "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.3",+ "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.3",+ "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.3",+ "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.3",+ "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.3",+ "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": 2,+ "coverage_percent": 100.0,+ "is_complete": true,+ "status": "complete",+ "execution_successful": true,+ "fully_inspected_files": 2,+ "partially_inspected_files": 0,+ "entirely_uninspected_files": 0,+ "ledger_exceptions": [],+ "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": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "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": "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_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": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_anti_refusal",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_data_exfiltration",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_deserialization",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_excessive_agency",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_harmful_content",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_memory_poisoning",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_output_handling",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_privilege_escalation",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_prompt_injection",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_rogue_agent",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_ssrf",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_supply_chain",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_system_prompt_leakage",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_tool_misuse",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "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": [],+ "limitations": [],+ "findings_before_filtering": 3,+ "findings_after_filtering": 3+ }+}\ No newline at end of filediff --git a/tests/fixtures/skillspector-2.13.3-passwd-mount/separate-read.json b/tests/fixtures/skillspector-2.13.3-passwd-mount/separate-read.jsonnew file mode 100644index 00000000..9ddf4d76--- /dev/null+++ b/tests/fixtures/skillspector-2.13.3-passwd-mount/separate-read.json@@ -0,0 +1,595 @@+{+ "skill": {+ "name": "passwd-mount-probe",+ "source": "/private/tmp/skillspector-2.13.3-passwd-mount/separate-read",+ "scanned_at": "2026-11-02T20:00:55.856778+00:00"+ },+ "risk_assessment": {+ "score": 43,+ "severity": "MEDIUM",+ "recommendation": "CAUTION",+ "max_issue_severity": "HIGH"+ },+ "components": [+ {+ "path": "SKILL.md",+ "type": "markdown",+ "lines": 8,+ "executable": false,+ "size_bytes": 170,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ },+ {+ "path": "build.sh",+ "type": "shell",+ "lines": 3,+ "executable": true,+ "size_bytes": 73,+ "source_url": null,+ "source_identity": null,+ "source_digest": null+ }+ ],+ "structured_summaries": [],+ "issues": [+ {+ "id": "PE3",+ "finding_id": "finding-d0a576ce5aec4409a702330440851079",+ "category": "Privilege Escalation",+ "pattern": "Credential Access",+ "severity": "HIGH",+ "confidence": 0.6,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 14+ },+ "finding": "/etc/passwd",+ "explanation": "Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.",+ "remediation": "Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.",+ "code_snippet": "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\ncat /etc/passwd",+ "intent": null,+ "tags": [+ "Privilege Escalation",+ "contextual-triage",+ "likely-benign-context"+ ],+ "evidence": {},+ "match_fingerprint": "ac75eea6ed115d0252fb13bbb10e9c4421764d5a7612787edcde6a78569d8f88",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 14+ }+ ]+ },+ {+ "id": "PE3",+ "finding_id": "finding-b675a96e73d24f3fa02a768eccbfec12",+ "category": "Privilege Escalation",+ "pattern": "Credential Access",+ "severity": "HIGH",+ "confidence": 0.6,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 26+ },+ "finding": "/etc/passwd",+ "explanation": "Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.",+ "remediation": "Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.",+ "code_snippet": "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\ncat /etc/passwd",+ "intent": null,+ "tags": [+ "Privilege Escalation",+ "contextual-triage",+ "likely-benign-context"+ ],+ "evidence": {},+ "match_fingerprint": "ac75eea6ed115d0252fb13bbb10e9c4421764d5a7612787edcde6a78569d8f88",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null,+ "start_column": 26+ }+ ]+ },+ {+ "id": "PE3",+ "finding_id": "finding-2087a9ca41644cd6949cdffa3d051143",+ "category": "Privilege Escalation",+ "pattern": "Credential Access",+ "severity": "HIGH",+ "confidence": 0.6,+ "location": {+ "file": "build.sh",+ "start_line": 3,+ "end_line": null,+ "start_column": 4+ },+ "finding": "/etc/passwd",+ "explanation": "Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.",+ "remediation": "Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.",+ "code_snippet": "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\ncat /etc/passwd",+ "intent": null,+ "tags": [+ "Privilege Escalation"+ ],+ "evidence": {},+ "match_fingerprint": "ac75eea6ed115d0252fb13bbb10e9c4421764d5a7612787edcde6a78569d8f88",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 3,+ "end_line": null,+ "start_column": 4+ }+ ]+ },+ {+ "id": "RP1",+ "finding_id": "finding-3e0f481df87648af91b1ee8a57051b2a",+ "category": "MCP Rug Pull",+ "pattern": null,+ "severity": "MEDIUM",+ "confidence": 0.75,+ "location": {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null+ },+ "finding": null,+ "explanation": "Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.",+ "remediation": "Pin the image: image:tag or image@sha256:abc123",+ "code_snippet": null,+ "intent": null,+ "tags": [+ "ASI16"+ ],+ "evidence": {},+ "match_fingerprint": "c40efebb64946fad1ac9260f3622867d7ffb95e17a1c6f66b67bb614d7a5ba02",+ "occurrences": [+ {+ "file": "build.sh",+ "start_line": 2,+ "end_line": null+ }+ ]+ }+ ],+ "suppressed_count": 0,+ "suppressed": [],+ "metadata": {+ "has_executable_scripts": true,+ "skillspector_version": "2.13.3",+ "llm_requested": false,+ "llm_available": true,+ "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.3",+ "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.3",+ "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.3",+ "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.3",+ "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.3",+ "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": 2,+ "coverage_percent": 100.0,+ "is_complete": true,+ "status": "complete",+ "execution_successful": true,+ "fully_inspected_files": 2,+ "partially_inspected_files": 0,+ "entirely_uninspected_files": 0,+ "ledger_exceptions": [],+ "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": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "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": "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_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": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_anti_refusal",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_data_exfiltration",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_deserialization",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_excessive_agency",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_harmful_content",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_memory_poisoning",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_output_handling",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_privilege_escalation",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_prompt_injection",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_rogue_agent",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_ssrf",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_supply_chain",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_system_prompt_leakage",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "skipped": 0,+ "failed": 0,+ "unaccounted": 0+ },+ {+ "analyzer_id": "static_patterns_tool_misuse",+ "status": "completed",+ "planned_work": 2,+ "completed": 2,+ "partial": 0,+ "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": [],+ "limitations": [],+ "findings_before_filtering": 4,+ "findings_after_filtering": 4+ }+}\ No newline at end of filediff --git a/tests/validators/test_security.py b/tests/validators/test_security.pyindex d593f3b2..18d17a85 100644--- a/tests/validators/test_security.py+++ b/tests/validators/test_security.py@@ -33,6 +33,11 @@ from skillevaluator.validators.security import (_SKILLSPECTOR_2_9_6_NO_LLM_REPORT = (Path(__file__).parents[1] / "fixtures" / "skillspector-2.9.6-no-llm.json")+_SKILLSPECTOR_2_11_1_PE3_REPORT = Path(__file__).parents[1] / "fixtures" / "skillspector-2.11.1-pe3-no-llm.json"+# build.sh as scanned for the captured 2.11.1 PE3 report: line 2 is a+# read-only UID-map mount, line 3 a real credential-file read.+_SKILLSPECTOR_2_11_1_PE3_BUILD_SH = "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\ncat /etc/passwd\n"+_SKILLSPECTOR_2_13_3_PASSWD_REPORTS = Path(__file__).parents[1] / "fixtures" / "skillspector-2.13.3-passwd-mount"_SKILLSPECTOR_2_12_LLM_PROVENANCE = Path(__file__).parents[1] / "fixtures" / "skillspector-2.12.0-llm-provenance.json"_SKILLSPECTOR_2_10_REQUIRED_ANALYZERS = ("artifact_integrity",@@ -207,6 +212,20 @@ def _validate_skillspector_payload(return SecurityValidator(use_llm=False).validate_security_only(sample_skill_dir)+def _passwd_mount_issue(**overrides) -> dict:+ """Return a benign-tagged SkillSpector PE3 row for scripts/build.sh line 1."""+ location = {"file": "scripts/build.sh", "start_line": 1, "end_line": None}+ return {+ "id": "PE3",+ "pattern": "Credential Access",+ "finding": "/etc/passwd",+ "tags": ["Privilege Escalation", "contextual-triage", "likely-benign-context"],+ "location": location,+ "occurrences": [dict(location)],+ **overrides,+ }++def _set_universal_analyzer_work(payload: dict) -> None:"""Keep synthetic complete reports aligned with producer work accounting."""component_count = len(payload["components"])@@ -2333,8 +2352,8 @@ print(json.dumps([finding.metadata["matched_value"] for finding in result.findin[{"llm_requested": True, "llm_available": True},{"llm_requested": True, "llm_available": False},- {"llm_requested": False, "llm_available": True},{"llm_requested": False, "llm_available": False, "meta_analysis_applied": True},+ {"llm_requested": False, "llm_available": True, "meta_analysis_applied": True},],)@patch("skillevaluator.validators.security.Tools")@@ -2535,6 +2554,8 @@ print(json.dumps([finding.metadata["matched_value"] for finding in result.findin# Captured from NVIDIA/SkillSpector v2.11.1 with --no-llm. build.sh:# docker run -v /etc/passwd:/etc/passwd:ro image# cat /etc/passwd+ # build.sh is not on disk here, so the tagged mount row cannot be+ # re-checked against its source and stays reported.payload = json.loads((Path(__file__).parents[1] / "fixtures" / "skillspector-2.11.1-pe3-no-llm.json").read_text(encoding="utf-8"))@@ -2573,6 +2594,347 @@ print(json.dumps([finding.metadata["matched_value"] for finding in result.findin}[mutation]assert any(expected in error for error in result.errors)+ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_ignores_tagged_read_only_passwd_mount(+ self,+ mock_tools,+ sample_skill_dir: Path,+ ) -> None:+ (sample_skill_dir / "build.sh").write_text(_SKILLSPECTOR_2_11_1_PE3_BUILD_SH, encoding="utf-8")+ payload = json.loads(_SKILLSPECTOR_2_11_1_PE3_REPORT.read_text(encoding="utf-8"))++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert not result.is_incomplete+ # The untagged `cat /etc/passwd` on line 3 still blocks.+ assert [+ (finding.file_path, finding.line_number)+ for finding in result.findings+ if finding.check_name.endswith("(PE3)")+ ] == [("build.sh", 3)]+ assert not result.passed+ assert "skillspector ignored 1 read-only /etc/passwd mount issue(s)" in result.messages++ @pytest.mark.parametrize("provider_available", [False, True])+ @pytest.mark.parametrize("case", ["read-only", "separate-read"])+ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_captured_2_13_3_passwd_mount(+ self,+ mock_tools,+ sample_skill_dir: Path,+ case: str,+ provider_available: bool,+ ) -> None:+ content = "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\n"+ if case == "separate-read":+ content += "cat /etc/passwd\n"+ (sample_skill_dir / "build.sh").write_text(content, encoding="utf-8")+ payload = json.loads((_SKILLSPECTOR_2_13_3_PASSWD_REPORTS / f"{case}.json").read_text(encoding="utf-8"))+ # These are real release reports, including distinct source/target PE3+ # identities and provider availability despite --no-llm execution.+ assert payload["metadata"]["skillspector_version"] == "2.13.3"+ assert payload["metadata"]["llm_requested"] is False+ assert payload["metadata"]["llm_available"] is True+ # Also exercise the same contract with no provider credentials.+ payload["metadata"]["llm_available"] = provider_available++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert not result.is_incomplete+ assert result.metadata["skillspector_version"] == "2.13.3"+ assert result.passed is (case == "read-only")+ assert [+ (finding.file_path, finding.line_number)+ for finding in result.findings+ if finding.check_name.endswith("(PE3)")+ ] == ([("build.sh", 3)] if case == "separate-read" else [])+ assert any(finding.check_name.endswith("(RP1)") for finding in result.findings)+ assert "skillspector ignored 2 read-only /etc/passwd mount issue(s)" in result.messages+ assert not any(finding.check_name == "skillspector_risk_score" for finding in result.findings)++ @pytest.mark.parametrize(+ "reason_code",+ [+ "llm_response_refused",+ "llm_response_truncated",+ "llm_response_incomplete",+ "llm_response_missing_fields",+ "llm_response_invalid_tool",+ "llm_response_invalid_schema",+ "llm_response_empty",+ "llm_response_limit",+ ],+ )+ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_2_13_3_passwd_mount_keeps_llm_inspection_incomplete(+ self,+ mock_tools,+ sample_skill_dir: Path,+ reason_code: str,+ ) -> None:+ (sample_skill_dir / "build.sh").write_text(+ "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\n", encoding="utf-8"+ )+ deterministic = json.loads((_SKILLSPECTOR_2_13_3_PASSWD_REPORTS / "read-only.json").read_text(encoding="utf-8"))+ # Model a partial enrichment using 2.13.3's new response reason codes;+ # the stored deterministic report remains the captured CLI output.+ enrichment = json.loads(json.dumps(deterministic))+ enrichment["metadata"].update({"llm_requested": True, "llm_available": True})+ enrichment["metadata"].pop("llm_provenance", None)+ completeness = enrichment["analysis_completeness"]+ message = f"LLM inspection incomplete: {reason_code}."+ completeness.update(+ {+ "is_complete": False,+ "status": "partial",+ "limitations": [message],+ "ledger_exceptions": [{"reason_code": reason_code, "fatal": False}],+ }+ )+ # Replace disabled optional analyzers with valid enrichment accounting.+ for status in completeness["analyzer_statuses"]:+ if status["status"] == "disabled":+ status.update({"status": "completed", "planned_work": 1, "completed": 1})+ status.pop("reason_code", None)+ status.pop("message", None)+ if status["analyzer_id"] == "semantic_security_discovery":+ status.update(+ {+ "status": "degraded",+ "completed": 0,+ "skipped": 1,+ "reason_code": reason_code,+ "message": message,+ }+ )+ mock_tools.skillspector.is_available = True+ mock_tools.skillspector.run.side_effect = [+ ToolResult(success=True, stdout=json.dumps(payload), stderr="", exit_code=0)+ for payload in (deterministic, enrichment)+ ]++ result = SecurityValidator(use_llm=True).validate_security_only(sample_skill_dir)++ assert result.status == "incomplete"+ assert result.metadata["incomplete_scans"] == ["skillspector-llm"]+ assert any("analysis_completeness" in error and "partial" in error for error in result.errors)+ assert "skillspector ignored 2 read-only /etc/passwd mount issue(s)" in result.messages+ assert not any(finding.check_name.endswith("(PE3)") for finding in result.findings)++ @pytest.mark.parametrize(+ "build_sh",+ [+ None,+ "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:rw image\ncat /etc/passwd\n",+ "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd image\ncat /etc/passwd\n",+ "#!/bin/sh\ndocker run -v /tmp/passwd:/etc/passwd:ro image\ncat /etc/passwd\n",+ "#!/bin/sh\ndocker run -v /etc/passwd:/tmp/passwd:ro image\ncat /etc/passwd\n",+ "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image; cat /etc/passwd\ncat /etc/passwd\n",+ "#!/bin/sh\ncat /etc/passwd\ndocker run -v /etc/passwd:/etc/passwd:ro image\n",+ b"#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image \xff\ncat /etc/passwd\n",+ ],+ ids=[+ "missing-source",+ "writable",+ "implicit-mode",+ "other-source",+ "other-target",+ "same-line-read",+ "moved-line",+ "non-utf8",+ ],+ )+ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_tagged_passwd_mount_requires_exact_source_line(+ self,+ mock_tools,+ sample_skill_dir: Path,+ build_sh: str | bytes | None,+ ) -> None:+ if isinstance(build_sh, bytes):+ (sample_skill_dir / "build.sh").write_bytes(build_sh)+ elif build_sh is not None:+ (sample_skill_dir / "build.sh").write_text(build_sh, encoding="utf-8")+ payload = json.loads(_SKILLSPECTOR_2_11_1_PE3_REPORT.read_text(encoding="utf-8"))++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert not result.is_incomplete+ assert len([finding for finding in result.findings if finding.check_name.endswith("(PE3)")]) == 2+ assert not any("read-only /etc/passwd mount" in message for message in result.messages)++ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_passwd_mount_source_check_does_not_follow_links(+ self,+ mock_tools,+ sample_skill_dir: Path,+ tmp_path: Path,+ ) -> None:+ outside = tmp_path / "outside-build.sh"+ outside.write_text(_SKILLSPECTOR_2_11_1_PE3_BUILD_SH, encoding="utf-8")+ try:+ (sample_skill_dir / "build.sh").symlink_to(outside)+ except (NotImplementedError, OSError) as exc:+ pytest.skip(f"symlinks unavailable: {exc}")+ payload = json.loads(_SKILLSPECTOR_2_11_1_PE3_REPORT.read_text(encoding="utf-8"))++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload)++ assert len([finding for finding in result.findings if finding.check_name.endswith("(PE3)")]) == 2++ @patch("skillevaluator.validators.security.Tools")+ def test_skillspector_rescores_after_ignoring_passwd_mount(+ self,+ mock_tools,+ sample_skill_dir: Path,+ ) -> None:+ (sample_skill_dir / "build.sh").write_text(+ "#!/bin/sh\ndocker run -v /etc/passwd:/etc/passwd:ro image\n", encoding="utf-8"+ )+ payload = json.loads(_SKILLSPECTOR_2_11_1_PE3_REPORT.read_text(encoding="utf-8"))+ payload["issues"] = [issue for issue in payload["issues"] if issue["location"]["start_line"] != 3]+ payload["analysis_completeness"]["findings_before_filtering"] -= 1+ payload["analysis_completeness"]["findings_after_filtering"] -= 1+ # A reported score above the policy threshold that only the ignored+ # mount row supports must not re-add a HIGH aggregate finding.+ payload["risk_assessment"].update({"score": 60, "severity": "HIGH", "recommendation": "DO_NOT_INSTALL"})++ result = _validate_skillspector_payload(mock_tools, sample_skill_dir, payload, exit_code=1)++ assert result.passed+ assert not result.errors+ assert not any(finding.check_name == "skillspector_risk_score" for finding in result.findings)+ assert "skillspector ignored 1 read-only /etc/passwd mount issue(s)" in result.messages++ @pytest.mark.parametrize(+ ("content", "line_number"),+ [+ ("podman run --rm --volume='/etc/passwd:/etc/passwd:ro' image\n", 1),+ ('docker run --volume="/etc/passwd:/etc/passwd:ro" image\n', 1),+ ("docker run --rm \\\n -v /etc/passwd:/etc/passwd:ro \\\n image:1.0.0\n", 2),+ ("DOCKER RUN -V /ETC/PASSWD:/ETC/PASSWD:RO image\r\n", 1),+ ],+ )+ def test_skillspector_passwd_mount_accepts_exact_read_only_forms(+ self,+ sample_skill_dir: Path,+ content: str,+ line_number: int,+ ) -> None:+ scripts = sample_skill_dir / "scripts"+ scripts.mkdir()+ (scripts / "build.sh").write_text(content, encoding="utf-8", newline="")+ location = {"file": "scripts/build.sh", "start_line": line_number, "end_line": None}+ safe_lines_by_file: dict[str, frozenset[int]] = {}++ for file_path in ("scripts/build.sh", str(sample_skill_dir / "scripts" / "build.sh")):+ row_location = {**location, "file": file_path}+ assert SecurityValidator._is_read_only_passwd_mount_issue(+ _passwd_mount_issue(location=row_location, occurrences=[dict(row_location)]),+ scanner_version="2.12.0",+ source_root=sample_skill_dir,+ safe_lines_by_file=safe_lines_by_file,+ )++ @pytest.mark.parametrize(+ ("overrides", "scanner_version"),+ [+ pytest.param({}, None, id="missing-version"),+ pytest.param({}, 2.12, id="non-string-version"),+ pytest.param({}, "2.10.0", id="aggregated-classification-2.10.0"),+ pytest.param({}, "2.11.0", id="aggregated-classification-2.11.0"),+ pytest.param({}, "2.12.0rc1", id="prerelease"),+ pytest.param({"tags": None}, "2.12.0", id="no-tags"),+ pytest.param({"tags": []}, "2.12.0", id="empty-tags"),+ pytest.param({"tags": ["contextual-triage"]}, "2.12.0", id="triage-only"),+ pytest.param({"tags": ["likely-benign-context"]}, "2.12.0", id="benign-only"),+ pytest.param(+ {"tags": ["contextual-triage", "likely-benign-context", {"malformed": True}]},+ "2.12.0",+ id="malformed-tag",+ ),+ pytest.param({"tags": "contextual-triage likely-benign-context"}, "2.12.0", id="string-tags"),+ pytest.param({"id": "PE1"}, "2.12.0", id="other-rule"),+ pytest.param({"pattern": "Sudo Usage"}, "2.12.0", id="other-pattern"),+ pytest.param({"finding": "/etc/shadow"}, "2.12.0", id="other-finding"),+ pytest.param(+ {+ "occurrences": [+ {"file": "scripts/build.sh", "start_line": 1, "end_line": None},+ {"file": "scripts/unsafe.sh", "start_line": 1, "end_line": None},+ ]+ },+ "2.12.0",+ id="aggregated-row",+ ),+ pytest.param(+ {"occurrences": [{"file": "scripts/unsafe.sh", "start_line": 1, "end_line": None}]},+ "2.12.0",+ id="occurrence-mismatch",+ ),+ pytest.param({"occurrences": None}, "2.12.0", id="no-occurrences"),+ pytest.param(+ {+ "location": {"file": "scripts/build.sh", "start_line": 1, "end_line": 2},+ "occurrences": [{"file": "scripts/build.sh", "start_line": 1, "end_line": 2}],+ },+ "2.12.0",+ id="multi-line-row",+ ),+ pytest.param(+ {+ "location": {"file": "scripts/build.sh", "start_line": 2, "end_line": None},+ "occurrences": [{"file": "scripts/build.sh", "start_line": 2, "end_line": None}],+ },+ "2.12.0",+ id="line-past-end",+ ),+ pytest.param(+ {+ "location": {"file": "scripts/../../outside.sh", "start_line": 1, "end_line": None},+ "occurrences": [{"file": "scripts/../../outside.sh", "start_line": 1, "end_line": None}],+ },+ "2.12.0",+ id="parent-escape",+ ),+ pytest.param(+ {+ "location": {"file": "/outside.sh", "start_line": 1, "end_line": None},+ "occurrences": [{"file": "/outside.sh", "start_line": 1, "end_line": None}],+ },+ "2.12.0",+ id="absolute-outside-root",+ ),+ pytest.param(+ {+ "location": {"file": "scripts", "start_line": 1, "end_line": None},+ "occurrences": [{"file": "scripts", "start_line": 1, "end_line": None}],+ },+ "2.12.0",+ id="directory",+ ),+ ],+ )+ def test_skillspector_passwd_mount_exemption_fails_closed(+ self,+ sample_skill_dir: Path,+ tmp_path: Path,+ overrides: dict,+ scanner_version: object,+ ) -> None:+ scripts = sample_skill_dir / "scripts"+ scripts.mkdir()+ mount = "docker run --rm -v /etc/passwd:/etc/passwd:ro image\n"+ (scripts / "build.sh").write_text(mount, encoding="utf-8")+ (tmp_path / "outside.sh").write_text(mount, encoding="utf-8")++ assert not SecurityValidator._is_read_only_passwd_mount_issue(+ _passwd_mount_issue(**overrides),+ scanner_version=scanner_version,+ source_root=sample_skill_dir,+ safe_lines_by_file={},+ )+@pytest.mark.parametrize("skillspector_version", ["2.9.6", "2.10.0"])@patch("skillevaluator.validators.security.Tools")def test_skillspector_rejects_missing_required_analyzer_evidence(