Back to skill

Security audit

LEGO MOC

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because it reports guidance to bypass network restrictions and to publish the user's original request, while its scan coverage is incomplete.

Consider avoiding installation until the reported bypass guidance and public sharing of the original request have been reviewed. The scan is incomplete: it covered 75% of components, and parts of the skill instructions could not be fully evaluated, so these results do not establish that unreported behavior is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (39)

Tainted flow: 'req' from os.environ.get (line 462, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/lego.py (reported line 467)May include surrounding context.

python
for key, value in (headers or {}).items():
        req.add_header(key, value)
    try:
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            return resp.status, resp.read()
    except urllib.error.HTTPError as e:
        try:

Network-error guidance encourages bypassing sandbox and proxy restrictions as routine recovery.

High
Category
Prompt Injection
Confidence
98% confidence
Finding

For certain non-JSON HTTP errors, the client advises running outside the sandbox or bypassing the proxy, without establishing whether the restriction is an intentional security control. Because these messages are consumed by an agent, an ordinary service failure can become guidance to circumvent the environment's network or execution boundaries; the code does not itself perform the bypass.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/lego.py (reported line 2638)May include surrounding context.

python
log("The agent then starts the bridge itself: no shell commands are needed for scanning and designing.")
        log("Claude Code: claude mcp add {} -- {} {} mcp".format(
            MCP_NAME, json.dumps(entry["command"]), json.dumps(entry["args"][0])))
        log("Codex, in ~/.codex/config.toml:\n[mcp_servers.{}]\ncommand = {}\nargs = {}".format(
            MCP_NAME, json.dumps(entry["command"]), json.dumps(entry["args"])))
        if not server_configured(ctx["server"]):
            log("WARNING: " + no_server_message())

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, network.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
prefix, no wrapper script. Then the user can approve "always allow" once for `python3 <path>/lego.py`. Tell the
  user this the first time an approval appears, and mention the MCP setup (section 1), which avoids them.
- The script needs three things, all of which the user can allow once: run `lego.py`, reach the server host shown by
  `lego.py whoami`, and read/write `~/.lego-parts/`.
- Don't run the same step twice, don't poll in a loop of short commands (use `--wait`), and don't call the server
  with curl or code of your own.
- Write `model.ldr` with your file-writing tool in as few steps as you can; avoid a series of throw-away scripts.

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 335)May include surrounding context.

md
parts are recognised poorly (`pile_photo`).
- **Be honest about the design.** The verifier checks physics only, never whether the model looks like its subject.
  Say what you built; if you could not see the previews, say that you have not seen the result.
- **No verification, no claim.** If neither the tools nor the script can reach the server, you may still write an
  `.ldr` from the guide, but tell the user plainly that it was not verified and has no building instructions.

## 7. Files in `~/.lego-parts/`

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/lego.py (reported line 557)May include surrounding context.

python
user = load_user(ctx)  # another agent may have created it meanwhile
        if user is None:
            say("No user ID on this computer yet; requesting one from", ctx["server"])
            resp = api(ctx, "POST", "/users", body=b"", retry="refused", auth=False)
            if not valid_id(resp.get("user_id")):
                raise Fatal("the server did not return a valid user ID")
            user = {"user_id": resp["user_id"], "server": ctx["server"],

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/lego.py (reported line 1326)May include surrounding context.

python
raise UsageError("parts file not found: " + args.parts_file)
    setup(ctx)
    folder = moc_dir(ctx)
    _, guide = not_ready_retry(ctx, lambda: api_raw(ctx, "GET", "/moc/guide", auth=False,
                                                    accept="text/markdown, text/plain, */*"))
    if not guide.strip():
        raise ApiError(200, "bad_response", "the server sent an empty design guide")

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/lego.py (reported line 1388)May include surrounding context.

python
raise UsageError("give 1-80 characters: words from the part name (e.g. slope 45 2 x 2) or a part number")
    setup(ctx)
    path = "/moc/parts?" + urllib.parse.urlencode({"q": query, "offset": args.offset, "limit": 100})
    data = not_ready_retry(ctx, lambda: api(ctx, "GET", path, auth=False))
    parts = [p for p in (data.get("parts") or []) if isinstance(p, dict)]
    say("{} supported part(s) match '{}'{}".format(data.get("total", len(parts)), query,
                                                  "; showing {}-{}".format(args.offset + 1, args.offset + len(parts))

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · scripts/lego.py (reported line 1355)May include surrounding context.

python
body = json.dumps({"parts": batch}).encode("utf-8")
        try:
            _, raw = not_ready_retry(ctx, lambda b=body: api_raw(
                ctx, "POST", "/moc/connectors", b, "application/json", auth=False, accept="text/plain, */*"))
        except ApiError as e:
            raise Fatal("could not fetch connector sheets (request {}/{}): {}. connectors.txt was not "
                        "updated.".format(n, len(batches), describe(e)))

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1973)May include surrounding context.

python
'items': {'type': 'object',
                                                           'required': ['op'],
                                                           'properties': {'op': {'type': 'string',
                                                                                 'enum': ['set_quantity',
                                                                                          'remove',
                                                                                          'confirm',
                                                                                          'replace',

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1974)May include surrounding context.

python
'required': ['op'],
                                                           'properties': {'op': {'type': 'string',
                                                                                 'enum': ['set_quantity',
                                                                                          'remove',
                                                                                          'confirm',
                                                                                          'replace',
                                                                                          'add',

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1975)May include surrounding context.

python
'properties': {'op': {'type': 'string',
                                                                                 'enum': ['set_quantity',
                                                                                          'remove',
                                                                                          'confirm',
                                                                                          'replace',
                                                                                          'add',
                                                                                          'undo',

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1976)May include surrounding context.

python
'enum': ['set_quantity',
                                                                                          'remove',
                                                                                          'confirm',
                                                                                          'replace',
                                                                                          'add',
                                                                                          'undo',
                                                                                          'undo_all']},

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1977)May include surrounding context.

python
'remove',
                                                                                          'confirm',
                                                                                          'replace',
                                                                                          'add',
                                                                                          'undo',
                                                                                          'undo_all']},
                                                                          'key': {'type': 'string',

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1978)May include surrounding context.

python
'confirm',
                                                                                          'replace',
                                                                                          'add',
                                                                                          'undo',
                                                                                          'undo_all']},
                                                                          'key': {'type': 'string',
                                                                                  'description': 'Row key from '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1979)May include surrounding context.

python
'replace',
                                                                                          'add',
                                                                                          'undo',
                                                                                          'undo_all']},
                                                                          'key': {'type': 'string',
                                                                                  'description': 'Row key from '
                                                                                                 'inventory, e.g. '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1994)May include surrounding context.

python
'e.g. '
                                                                                                        '"3001".'},
                                                                          'ldraw_color': {'type': 'integer',
                                                                                          'description': 'LDraw '
                                                                                                         'colour '
                                                                                                         'code, '
                                                                                                         'e.g. 4 '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1981)May include surrounding context.

python
'undo',
                                                                                          'undo_all']},
                                                                          'key': {'type': 'string',
                                                                                  'description': 'Row key from '
                                                                                                 'inventory, e.g. '
                                                                                                 '"3001|4".'},
                                                                          'quantity': {'type': 'integer',

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1982)May include surrounding context.

python
'undo_all']},
                                                                          'key': {'type': 'string',
                                                                                  'description': 'Row key from '
                                                                                                 'inventory, e.g. '
                                                                                                 '"3001|4".'},
                                                                          'quantity': {'type': 'integer',
                                                                                       'minimum': 0,

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1983)May include surrounding context.

python
'key': {'type': 'string',
                                                                                  'description': 'Row key from '
                                                                                                 'inventory, e.g. '
                                                                                                 '"3001|4".'},
                                                                          'quantity': {'type': 'integer',
                                                                                       'minimum': 0,
                                                                                       'maximum': 999},

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1985)May include surrounding context.

python
'inventory, e.g. '
                                                                                                 '"3001|4".'},
                                                                          'quantity': {'type': 'integer',
                                                                                       'minimum': 0,
                                                                                       'maximum': 999},
                                                                          'ldraw_part': {'type': 'string',
                                                                                         'description': 'LDraw '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1986)May include surrounding context.

python
'"3001|4".'},
                                                                          'quantity': {'type': 'integer',
                                                                                       'minimum': 0,
                                                                                       'maximum': 999},
                                                                          'ldraw_part': {'type': 'string',
                                                                                         'description': 'LDraw '
                                                                                                        'part '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1988)May include surrounding context.

python
'minimum': 0,
                                                                                       'maximum': 999},
                                                                          'ldraw_part': {'type': 'string',
                                                                                         'description': 'LDraw '
                                                                                                        'part '
                                                                                                        'number, '
                                                                                                        'e.g. '

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/lego.py (reported line 1989)May include surrounding context.

python
'maximum': 999},
                                                                          'ldraw_part': {'type': 'string',
                                                                                         'description': 'LDraw '
                                                                                                        'part '
                                                                                                        'number, '
                                                                                                        'e.g. '
                                                                                                        '"3001".'},