Back to skill

Security audit

ratsinfo-de

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its stated civic-records purpose, but its promised same-host network boundary can be bypassed through redirects, so it should be reviewed before installation.

Install only if you are comfortable with a CLI that makes public web requests to OParl endpoints and dev.oparl.org, writes a local cache, and can create user-named PDF or calendar files. Avoid untrusted endpoints and untrusted logo PNG files until redirect handling is fixed to validate before following redirects and the logo parser has size limits.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ratsinfo.py:205
Finding

Cross-Host Restriction Bypass Through Automatic HTTP Redirects

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pdfreport.py:45
Finding

Unbounded PNG Decompression and Memory Allocation

Content
View full analysis
I", data[pos:pos + 4]) kind = data[pos + 4:pos + 8] body = data[pos + 8:pos + 8 + length] pos += 12 + length if kind == b"IHDR": width, height, depth, colour = struct.unpack(">IIBB", body[:10]) elif kind == b"IDAT": idat += body elif kind == b"IEND": break ``` It then performs unrestricted decompression and allocates buffers using dimensions controlled by the file: ```python raw = zlib.decompress(bytes(idat)) stride = width * channels out = bytearray() previous = bytearray(stride) pos = 0 for _ in range(height): filt = raw[pos] pos += 1 line = bytearray(raw[pos:pos + stride]) pos += stride for i in range(stride): left = line[i - channels] if i >= channels else 0 up = previous[i] upleft = previous[i - channels] if i >= channels else 0 if filt == 1: line[i] = (line[i] + left) & 0xFF elif filt == 2: line[i] = (line[i] + up) & 0xFF elif filt == 3: line[i] = (line[i] + ((left + up) >> 1)) & 0xFF elif filt == 4: line[i] = (line[i] + _paeth(left, up, upleft)) & 0xFF out += line previous = line rgb = bytearray(width * height * 3) ``` ### Technical Analysis The PNG parser imposes no limits on: - Input file size. - Accumulated `IDAT` size. - Decompressed byte count. - Image width or height. - Total pixel count. - Compression ...[truncated 2147 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (38)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is a data-access/retrieval skill focused on reading German municipal council records through the OParl API. The actual code chunk is unrelated infrastructure for producing PDF reports. It includes PNG parsing, text wrapping, page layout, footer/header rendering, and PDF serialization to a file path. These are materially different capabilities from the declared purpose, and key declared behaviors—API access, municipal record lookup, topic filtering, committee/member lookup, or monitoring new papers—are absent. This is therefore a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared purpose is a user-facing skill for reading and tracking German municipal council records through OParl. This code chunk does not primarily implement that behavior; instead, it records a demo session and orchestrates integration tests. It launches mock servers, invokes a CLI repeatedly, checks healthy and broken endpoints, writes temp files, runs a test script, and captures outputs. Most notably, it includes a 'get file:///etc/passwd' command, which indicates local file retrieval behavior not reflected in the description. While some invoked commands (papers, track, watch, scan, report) are related to council-record functionality, the chunk’s actual purpose and capabilities are test/demo automation with additional filesystem and diagnostic actions, so the description does not accurately represent this code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This code does not implement or support the declared behavior of querying or reading German municipal council records through the OParl API. Its primary purpose is quality assurance for generated PDF dossiers: validating that a PDF contains expected headings and terms. It accesses a local file path from argv, performs PDF content extraction, and exits with validation errors if expected phrases are missing. That is a materially different purpose and resource usage from the declared skill description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared purpose is to access and interpret German municipal council information via the OParl API. This code does not query OParl, municipalities, committees, papers, or any civic records at all. Its primary function is unrelated: generating a demo video from a prerecorded local session transcript. It accesses local files, image rendering libraries, temporary directories, and ffmpeg for video creation, which are materially different resources and capabilities from the declared council-record lookup behavior. This is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The code broadly aligns with the declared domain: it accesses municipal council information from OParl/RIS-style endpoints and supports papers, meetings, bodies, people, and tracking decisions. However, the code chunk shows materially broader capabilities than the description states. In particular, it can generate PDF dossier/report outputs, create ICS calendar files, and scan multiple municipality endpoints to produce comparative/market reports. Those are substantive user-facing capabilities, not merely internal implementation details. The description mentions being told about new council papers on a subject, but not calendar export, PDF generation, or bulk cross-municipality reporting. Therefore the declared description understates important actual behaviors, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ratsinfo.py (reported line 68)May include surrounding context.

python
# Only http and https. Building our own opener removes urllib's file and ftp
# handlers entirely, so a hostile endpoint cannot point links.next at
# file:///home/you/.ssh/id_rsa and have us read it back to the agent.
_OPENER = urllib.request.build_opener(
    urllib.request.HTTPHandler,
    urllib.request.HTTPSHandler,

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/ratsinfo.py (reported line 68)May include surrounding context.

python
# Only http and https. Building our own opener removes urllib's file and ftp
# handlers entirely, so a hostile endpoint cannot point links.next at
# file:///home/you/.ssh/id_rsa and have us read it back to the agent.
_OPENER = urllib.request.build_opener(
    urllib.request.HTTPHandler,
    urllib.request.HTTPSHandler,

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · tests/capture_demo.py (reported line 14)May include surrounding context.

python
R = ["python3", "scripts/ratsinfo.py"]

def town(port, name, ags):
    env = dict(os.environ, MOCK_PORT=str(port), MOCK_TOWN=name, MOCK_AGS=ags)
    return subprocess.Popen(["python3", "tests/mock_ris.py"], env=env)

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The demo explicitly invokes the skill with file:///etc/passwd, demonstrating and validating local file read capability unrelated to the stated municipal-records purpose. In an agent environment, accepting file:// URLs can enable arbitrary local file disclosure, and /etc/passwd is a classic probe indicating filesystem access testing rather than legitimate business logic.

Content

Scanner excerpt · tests/capture_demo.py (reported line 39)May include surrounding context.

python
R + ["watch", OK, "--term", "Sanierung"],
    R + ["check", BAD + "/dead"],
    R + ["check", BAD + "/blocked"],
    R + ["get", "file:///etc/passwd"],
    R + ["scan", "--endpoints", "/tmp/eps.txt", "--term", "Sanierung",
         "--pdf", "/tmp/markt.pdf", "--logo", "/tmp/aq.png", "--org",
         "ALPHA QUADRAT  Bauplanung und Projektmanagement"],

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · tests/render_demo.py (reported line 111)May include surrounding context.

python
if stripped.startswith("error:") or "passed," in line and "0 failed" not in line:
        return ERR
    if stripped.startswith("$"):
        return PROMPT
    return OUT

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · tests/run_tests.sh (reported line 21)May include surrounding context.

sh
MOCK_T2=$!
python3 tests/mock_broken.py &
MOCK_BAD=$!
trap 'kill $MOCK_OK $MOCK_T2 $MOCK_BAD 2>/dev/null; rm -rf "$RATSINFO_CACHE"' EXIT
sleep 1

PASS=0

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · tests/run_tests.sh (reported line 95)May include surrounding context.

sh
# --- the guards. each of these caught a real defect during review. ---
expect "a file:// url is refused" 2 "Only http and https" \
    python3 scripts/ratsinfo.py get "file:///etc/passwd"
expect "a cross host link is not followed" 2 "not the endpoint you asked for" \
    python3 scripts/ratsinfo.py check "http://127.0.0.1:8799/evil-system"
expect "--allow-cross-host lets it through" 2 "body list is empty" \

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill advertises network access, cache/file writes, environment-variable control, and shell execution via Python, but it does not declare a constrained tool scope such as allowed tools or permissions. That increases the blast radius if the skill is invoked in a broader agent runtime, because the runtime may permit more capabilities than are necessary for the stated use case.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation states that report writes a one-page PDF dossier 'in German', which imposes a specific language on generated output. The file does not indicate any user opt-in, alternative locale support, or justification as a strict region-specific compliance requirement for the output language itself.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 259)May include surrounding context.

md
such as expert reports, photographs and plans often carry third party
copyright, and paper texts routinely name private individuals who were
never public figures. A full text index of those names changes their
situation without asking them.

Read the `license` field, keep the source with every document you store,
and think before you publish. `references/recht-und-etikette.md` has the

Tainted flow: 'tmp' from os.environ.get (line 744, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/ratsinfo.py (reported line 617)May include surrounding context.

python
def save_state(endpoint: str, kind: str, state: dict) -> None:
    path = _state_path(endpoint, kind)
    tmp = path + ".tmp"
    with open(tmp, "w", encoding="utf-8") as handle:
        json.dump(state, handle, ensure_ascii=False, indent=1)
    os.replace(tmp, path)  # never leave a half written state behind

Tainted flow: 'tmp' from os.environ.get (line 744, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/ratsinfo.py (reported line 745)May include surrounding context.

python
def save_state(endpoint: str, kind: str, state: dict) -> None:
    path = _state_path(endpoint, kind)
    tmp = path + ".tmp"
    with open(tmp, "w", encoding="utf-8") as handle:
        json.dump(state, handle, ensure_ascii=False, indent=1)
    os.replace(tmp, path)  # never leave a half written state behind

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill goes beyond read/query behavior by writing PDF dossiers and calendar files to arbitrary user-supplied local paths. In an agent setting, filesystem write capabilities expand the blast radius from passive data retrieval to persistent local side effects, which can overwrite files, leak queried data into artifacts, or be abused by downstream prompts to place files in sensitive locations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The scan command performs broad multi-endpoint reconnaissance across many municipalities and can generate market-intelligence style reports, which materially exceeds the manifest’s municipality-specific lookup framing. In an agent context, this increases privacy/compliance and misuse risk because a seemingly narrow civic-records skill can be repurposed for bulk monitoring and profiling at scale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code declares the tool as a client for German council information systems, and several user-facing outputs and report text are hard-coded in German. The skill does not offer the user a language choice or opt-in for this locale, which matches the policy concern about forcing a specific language without user choice.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/capture_demo.py (reported line 7)May include surrounding context.

python
os.environ["RATSINFO_MIN_INTERVAL"] = "0"
os.environ["RATSINFO_CACHE"] = "/tmp/ratsinfo-demo-cache"
subprocess.run(["rm", "-rf", "/tmp/ratsinfo-demo-cache"])

OK = "http://127.0.0.1:8799/system"
BAD = "http://127.0.0.1:8798"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script deletes /tmp/ratsinfo-demo-cache with rm -rf, which is a destructive file operation. Although the module docstring describes recording a demo session, there is no specific warning, confirmation, or inline comment disclosing that the script will remove filesystem data at this path.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/capture_demo.py (reported line 15)May include surrounding context.

python
def town(port, name, ags):
    env = dict(os.environ, MOCK_PORT=str(port), MOCK_TOWN=name, MOCK_AGS=ags)
    return subprocess.Popen(["python3", "tests/mock_ris.py"], env=env)


servers = [

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · tests/capture_demo.py (reported line 22)May include surrounding context.

python
town(8799, "Stadt Musterhausen", "05124000"),
    town(8801, "Stadt Beispielstadt", "05158000"),
    town(8802, "Gemeinde Musterdorf", "05170032"),
    subprocess.Popen(["python3", "tests/mock_broken.py"]),
]
open("/tmp/eps.txt", "w").write(
    "http://127.0.0.1:8799/system\n"

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The demo script intentionally exercises capabilities outside the municipal-records use case, including local file access and execution of additional scripts. In an agent-skill context, showcasing and normalizing such behavior can mask dangerous capability creep and encourages paths that could expose host data if similar functionality is reachable in production.

Content

No source excerpt is available for this finding.