Back to skill

Security audit

Ralph Wiggum Loop

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it can send full user-supplied source files to a configurable LLM API endpoint without strong disclosure or endpoint safeguards.

Review this before installing if you work with private code. Only use it with a trusted local LM Studio endpoint, avoid setting LMSTUDIO_URL or --api-url to remote services unless you accept that submitted files and prompts may be sent there, and do not process secrets or proprietary repositories without additional safeguards.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generator.py:44
Finding

Arbitrary API Endpoint Can Receive Sensitive Source-Code Contents

Content
View full analysis

Vulnerability Details

File Location: scripts/generator.py:44-45, 125-129, 189-197; also present in scripts/critic.py:111-115, 192-214 and scripts/ralph-loop.sh:10, 120-131
Vulnerability Type: Unrestricted transmission of user-provided files and source code to a configurable network endpoint
Risk Level: Medium

Vulnerable Code

scripts/generator.py:44-45 allows the destination to be supplied through an argument or environment variable without restricting it to a local LM Studio instance:

python
def __init__(self, api_url: str = None, model: str = None):
    self.api_url = api_url or os.getenv("LMSTUDIO_URL", self.DEFAULT_API_URL)

scripts/generator.py:125-129 transmits the generated prompt, including input_content, to that endpoint:

python
response = self.session.post(
    f"{self.api_url}/chat/completions",
    json=payload,
    timeout=300
)

scripts/generator.py:189-197 reads the complete user-selected file and passes it into the network-backed generation operation:

python
input_content = ""
if args.file:
    try:
        with open(args.file, 'r', encoding='utf-8') as f:
            input_content = f.read()
    except Exception as e:
        print(f"Error reading file: {e}", file=sys.stderr)
        sys.exit(1)

gen = Generator(api_url=args.api_url, model=args.model)

The same trust model is used by the critic. scripts/critic.py:111-115 accepts an unrestricted destination:

python
def __init__(self, api_url: str = None, model: str = None):
    self.api_url = api_url or os.getenv("LMSTUDIO_URL", self.DEFAULT_API_URL)
    self.model = model or os.getenv("LMSTUDIO_MODEL_CRITIC")
    self.session = requests.Session()
    self.session.headers.update({"Content-Type": "application/json"})

scripts/critic.py:206-214 sends the reviewed code in the request payload:

python
messages = [
    {"role": "system", "content": self.SYSTEM_PROMPT},
    {"role": "user", "content": user_prompt}
]

payload = {

...[truncated 3688 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enforce the local-only default trust boundary

    • Parse the configured URL with a standard URL parser.
    • Permit only localhost, 127.0.0.0/8, and ::1 by default.
    • Reject malformed URLs, embedded credentials, unexpected schemes, and non-loopback hosts.
  2. Require explicit authorization for remote endpoints

    • Add a clearly named option such as --allow-remote-api.
    • Display the destination hostname and warn that complete source contents will be transmitted.
    • Require interactive confirmation unless running under an explicitly configured noninteractive policy.
  3. Require transport security

    • Require HTTPS for every non-loopback destination.
    • Preserve TLS certificate validation.
    • Do not provide an option that silently disables certificate verification.
  4. Use endpoint allowlisting

    • Support an administrator-controlled list of approved model-service hosts.
    • Resolve hostnames and validate resulting addresses to reduce hostname-based bypasses.
    • Revalidate redirects or disable redirects for API requests.
  5. Minimize transmitted data

    • Warn users before sending file contents.
    • Add optional scanning and redaction for credentials, private keys, tokens, and environment values.
    • Avoid transmitting unrelated file content or metadata.
    • Consider chunking or selecting only the relevant code region.
  6. Improve documentation

    • State prominently that supplied source files and prompts are sent to the configured API.
    • Explain the security implications of changing LMSTUDIO_URL or using --api-url.
    • Clarify that remote LM Studio-compatible services have access to all submitted content.
  7. Harden all affected components consistently

    • Apply the same URL validation to Generator, Critic, and ralph-loop.sh.
    • Centralize endpoint validation rather than implementing independent checks in each component.
    • Add tests proving that loopback URLs ar ...[truncated 64 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (19)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill sends the full analyzed source code, plus optional context, to a chat-completions API endpoint. If the code under review contains proprietary logic, credentials, tokens, customer data, or internal URLs, this behavior can leak sensitive material outside the immediate execution context without any trust boundary enforcement or declared justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill description and example prompts are presented entirely in Polish, effectively imposing a specific language context on users. There is no indication that users may choose another language or that the skill is intentionally restricted to a Polish-speaking context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill repeatedly instructs users to submit code or text to the tool, and the requirements/debug sections show that content is sent to a local LM Studio API endpoint. However, the documentation does not clearly warn users that their submitted material will be transmitted to another service for processing, which can lead to inadvertent disclosure of sensitive source code, secrets, or proprietary text. The fact that the endpoint is localhost reduces remote exposure, but it still does not remove the need for explicit disclosure because a local model server is still a separate processing boundary.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The module description states "Bezwzględny code reviewer" in Polish, and the system prompt and docstrings are written to operate in Polish without presenting any language/locale option to the user. This is a locale policy concern because the skill effectively fixes interaction language rather than allowing user opt-in or documenting a region-specific requirement.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

No manifest is available, so there is no stated purpose that would justify network access or environment-based configuration handling. The code initializes an HTTP client, queries a model list endpoint, and reads environment variables to choose a backend, which are material capabilities beyond simple local code inspection.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The prompt design does not include robust defenses against instructions embedded in the analyzed code or context, so the model may obey adversarial text present in those inputs. In a code-review skill, this is dangerous because untrusted source files can contain comments or strings that manipulate the model into leaking, omitting, or fabricating findings.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-supplied context is interpolated directly into the prompt without sanitization or boundary marking beyond plain formatting. An attacker can place prompt-injection instructions in context that steer the model to disclose sensitive snippets from the analyzed code, alter output structure, or ignore the intended review task.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code posts analyzed source and user-provided context to an HTTP API without any user-facing warning at runtime. Even if the endpoint is local by default, users may override it, and the absence of disclosure prevents informed consent about where potentially sensitive code is being sent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The module docstring and embedded prompts are written in Polish and direct behavior in that language without indicating that the user may choose another language. This creates a locale/language policy concern because the skill implicitly enforces a specific language rather than making language selection explicit or optional.

Content

No source excerpt is available for this finding.

Ssd 1

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The model-selection logic explicitly prioritizes names like 'uncensored' and 'liberated', which strongly suggests preference for models with weaker safety controls. In a tool that forwards arbitrary task, context, and file content to an LLM, this increases the likelihood of unsafe outputs, policy bypass, mishandling of sensitive content, or generation of harmful instructions compared with neutral model selection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

When the --file option is used, the entire file contents are read and then included in the prompt sent to the LM Studio chat/completions API. Although the default endpoint is localhost, this still transmits potentially sensitive data to another service without any explicit warning, consent flow, or data classification checks, which can lead to unintended disclosure if LM Studio is remote, proxied, logged, or configured with external backends.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

All user-facing help and status text in the script is written only in Polish, with no indication that language choice is configurable or optional. This can constitute a natural-language policy violation when a skill imposes a locale-specific interaction style without offering user choice or documenting the constraint.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/ralph-loop.sh (reported line 60)May include surrounding context.

sh
# Sprawdź czy LM Studio działa
check_lmstudio() {
    if ! curl -s "$LMSTUDIO_URL/models" > /dev/null 2>&1; then
        log_error "LM Studio nie odpowiada na $LMSTUDIO_URL"
        log_error "Upewnij się że LM Studio jest uruchomione z włączonym API"
        exit 1

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The generate path constructs prompts from user task/context and sends them to the LM Studio API without any user-facing warning that supplied content will leave the script process. This creates a privacy and data-handling risk, especially if users provide proprietary code, secrets, or sensitive context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script sends the full source code and issue details to an HTTP chat-completions API during the fix phase. Even if the default endpoint is localhost, the URL is configurable via environment variable, there is no consent prompt, allowlist, or sensitivity check, so arbitrary code may be exfiltrated to an unintended service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language comments in Polish, such as 'do przetestowania' and multiple 'brak ...' notes, which imposes a specific language on users or maintainers without any opt-in or justification. The policy allows locale constraints only when they are documented and justified or when users are given a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains natural-language comments and docstring text in Polish, including the main description and inline problem notes. Under the policy, forcing a specific language without user opt-in can be a locale-policy violation, and no justification or alternative language option is provided here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

Because no manifest is available, there is no declared reason for this skill to access local files. The code accepts an arbitrary file path, reads its contents, and later uses that content in critique/fix operations, expanding capability beyond what can be justified from the provided context.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script can read code from a user-specified file and write JSON or code output to a user-specified output path, but there is no explicit warning in the help text or comments about file creation or overwrite effects. For safety-sensitive file operations, the rubric requires some form of disclosure when no confirmation or warning is present.

Content

No source excerpt is available for this finding.