SkillSpector icon indicating copy to clipboard operation
SkillSpector copied to clipboard

obfuscated_instruction_text on a Docker argv list (--cap-drop) in Python source

Open elliottwaves-20 opened this issue 2 months ago • 2 comments

Summary

build_declared_marker_views reads a Docker argv list in Python as an ambiguous text-removal directive (the verb drop in --cap-drop, followed by several quoted strings) and marks the file obfuscated_instruction_text. The file then counts as partially inspected, so the target cannot reach safe_to_install. Related to the JSON case fixed in #515, but this is plain Python code and still reproduces on current main.

Versions: v2.12.0 (c7958a3) and main at 2226747, --no-llm.

Reproducer

repro/capture.py:

import subprocess


def capture_argv(name, image):
    return ["docker", "run", "-d", "--name", name,
            "--cap-drop", "ALL", "--cap-add", "NET_RAW", "--read-only", image]


def docker(*args):
    return subprocess.run(["docker", *args], capture_output=True, text=True)

skillspector scan repro --no-llm --format json --output r.json

Actual

"partially_inspected_files": 1,
"ledger_exceptions": [{"reason_code": "obfuscated_instruction_text", "path": "capture.py", ...}]

Writing the flag as one token ("--cap-drop=ALL") in the same list still triggers it. In a larger file we saw the same for dictionary keys such as {"Path": path, "Read": True, "Write": False, "Delete": False}.

Expected

A removal verb that is part of a command-line flag, a code identifier or a dictionary key, inside source code, is not a natural-language instruction, and the file completes static analysis.

elliottwaves-20 avatar Sep 30 '26 11:09 elliottwaves-20

I'd like to work on this. I'll reproduce the Docker argv false positive on current main, trace the declaration-marker heuristic, and add focused regression coverage.

efegokdemir avatar Sep 30 '26 15:09 efegokdemir

Resolution verified on 2026-10-04: PR #697 has merged, and GitHub automatically closed this issue.

The parser now distinguishes removal words inside hyphen-prefixed CLI tokens (including Docker --cap-drop) and exact quoted mapping keys from actual text-removal directives. Ambiguous prose, quoted instructions, and non-key quoted values remain analyzable.

Focused verification on merged main (05d7882): 129 marker/flag/dictionary/quoted-instruction regressions passed, including the Docker argv fragment and malicious controls.

rng1995 avatar Oct 04 '26 10:10 rng1995