Back to skill

Security audit

API Mock Server

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent API mock-server skill, but it exposes an unauthenticated server on all network interfaces by default and has under-scoped safety documentation.

Install only if you are comfortable reviewing and running the Python code yourself. Bind the server to 127.0.0.1 unless you intentionally need remote access, avoid putting sensitive test data in exposed routes, use firewall controls for shared networks, and consider pinning dependencies before use.

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

Warning
Location
scripts/mock_server.py:33
Finding

Mock Server Listens on All Network Interfaces by Default

Content
View full analysis

Vulnerability Details

File Location: scripts/mock_server.py:33-39, scripts/mock_server.py:140-143, and scripts/mock_server.py:167-177
Vulnerability Type: Unsafe default network exposure
Risk Level: Medium

Vulnerable Code

python
def __init__(self, port=3000, host="0.0.0.0", latency=0):
    self.port = port
    self.host = host
    self.latency = latency
    self.app = Flask(__name__)
    self._routes = {}
    self.fake = Faker()
python
server = cls(
    port=config.get("port", 3000),
    host=config.get("host", "0.0.0.0"),
    latency=config.get("latency", 0)
)
python
parser = argparse.ArgumentParser(description="API Mock Server")
parser.add_argument("--config", help="Path to routes JSON config")
parser.add_argument("--port", type=int, default=3000, help="Server port")
parser.add_argument("--host", default="0.0.0.0", help="Server host")
parser.add_argument("--latency", type=int, default=0, help="Artificial latency in ms")
args = parser.parse_args()

if args.config:
    server = MockServer.from_config(args.config)
else:
    server = MockServer(port=args.port, host=args.host, latency=args.latency)

Technical Analysis

Every supported initialization path uses 0.0.0.0 as the default listening address. This binds the Flask server to all available network interfaces rather than limiting access to the local machine.

The mock server implements no authentication or authorization. Consequently, any system that can route traffic to the selected port can invoke the configured mock endpoints. The exposure may include a local network, a shared development environment, a container network, or an externally reachable interface, depending on host firewall and network configuration.

Safe development-server behavior should follow a deny-by-default model. A service intended primarily for local prototyping should bind to 127.0.0.1 unless the operator exp ...[truncated 1134 chars]

Remediation
View remediation

Remediation Suggestions

  • Change every default listening address from 0.0.0.0 to 127.0.0.1, including the constructor, configuration loader, and command-line parser.
  • Require an explicit --host 0.0.0.0 or equivalent configuration property when external access is genuinely required.
  • Display a prominent warning when the selected address is not a loopback address.
  • Document that externally exposed instances require network-level access controls or application authentication.
  • Consider an explicit option such as --allow-remote before accepting a non-loopback binding.
  • Add tests confirming that constructor, CLI, and configuration-file defaults all resolve to 127.0.0.1.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/mock_server.py:110
Finding

Falsy JSON Bodies Bypass Configured Schema Validation

Content
View full analysis

Vulnerability Details

File Location: scripts/mock_server.py:110-115
Vulnerability Type: Improper input-validation enforcement
Risk Level: Medium

Vulnerable Code

python
# Validate request body
if route_data.get("validate") and request.get_json(silent=True):
    try:
        validate(instance=request.get_json(silent=True), schema=route_data["validate"])
    except ValidationError as e:
        return jsonify({"error": "Validation failed", "details": str(e)}), 400

Technical Analysis

Schema validation is conditional on both the presence of a validation schema and the truthiness of the parsed JSON value. Python treats an empty object, None, and other empty values as false. Flask's request.get_json(silent=True) also returns None when JSON is absent or cannot be parsed.

As a result, the following inputs bypass validation entirely:

  • An empty JSON object: {}.
  • A JSON null value.
  • A request without a JSON body.
  • Malformed JSON when silent parsing returns None.

This is especially significant for schemas containing required properties. An empty object should fail such a schema, but the current conditional skips jsonschema.validate() and proceeds directly to the route handler.

The body is also parsed repeatedly, making behavior harder to reason about. Parsing should occur once, with missing or malformed JSON distinguished from valid JSON values.

Attack Path

  1. A route is configured with a JSON Schema requiring one or more properties.
  2. A requester sends {}, null, malformed JSON, or no JSON body.
  3. request.get_json(silent=True) returns a falsy value.
  4. The validation condition evaluates to false.
  5. jsonschema.validate() is never called.
  6. The route handler executes despite the request violating its configured schema.

Impact Assessment

The vulnerability does not grant additional operating-system privileges. It bypasses the validation ...[truncated 424 chars]

Remediation
View remediation

Remediation Suggestions

  • Whenever a validation schema is configured, perform validation regardless of whether the parsed body is truthy.
  • Parse the request body once and retain the result.
  • Reject missing, malformed, or incorrectly typed JSON explicitly before schema validation where a JSON body is required.
  • Avoid silent parse failures when validation is enabled, or check request.is_json and handle parsing exceptions.
  • Use logic such as:
python
schema = route_data.get("validate")
if schema is not None:
    if not request.is_json:
        return jsonify({"error": "A JSON request body is required"}), 400

    try:
        body = request.get_json()
        validate(instance=body, schema=schema)
    except ValidationError as e:
        return jsonify({
            "error": "Validation failed",
            "details": str(e)
        }), 400
    except Exception:
        return jsonify({"error": "Malformed JSON request body"}), 400
  • Add integration tests covering valid data, {}, null, absent bodies, malformed JSON, incorrect content types, and schemas with required properties.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (11)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README advertises webhook callback simulation, which implies the tool can make outbound network requests, but it does not clearly warn users about that behavior or its security implications. In an agent or automated environment, undocumented outbound callbacks can surprise operators, trigger unintended requests to internal or external systems, and increase SSRF-like or data egress risk if callback targets are user-controlled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill documentation sets MOCK_HOST=0.0.0.0, which exposes the mock server on all network interfaces by default, but does not warn users about the security implications. In a development/testing tool, this can unintentionally make mock endpoints reachable from other hosts, potentially exposing test data, internal API behavior, or an unsafe service to a broader network than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The document switches to a Chinese-only section headed "中文说明" without stating that multilingual content is optional or offering language selection guidance. Because policy violations include forcing a specific language without user opt-in, this mixed-language presentation can create ambiguity about the expected language experience.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

Flask is specified with a lower-bound version constraint only, so installations may resolve to different versions over time. This weakens supply-chain reproducibility and can unintentionally introduce vulnerable or incompatible releases into deployments.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
Flask>=2.3.0
Faker>=19.0.0
jsonschema>=4.17.0
requests>=2.31.0

Unverifiable Dependency: Flask has 10 known advisory(ies) (CVE-2025-47278 (Flask uses fallback key instead of current signing key); CVE-2018-1000656 (Flask is vulnerable to Denial of Service via incorrect encoding of JSON data); CVE-2019-1010083 (Pallets Project Flask is vulnerable to Denial of Service via Unexpected memory u) +7 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

Flask has known advisories, but the manifest does not pin a specific version, so it is impossible to verify whether the installed release is affected. This uncertainty is itself a supply-chain security weakness because vulnerable versions may be installed depending on resolution time and environment.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

Faker is also unpinned, which makes builds non-reproducible and allows future installs to pull newer releases without review. While Faker is typically lower risk than network-facing packages, it still represents avoidable supply-chain uncertainty.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
Flask>=2.3.0
Faker>=19.0.0
jsonschema>=4.17.0
requests>=2.31.0
pytest>=7.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
93% confidence
Finding

jsonschema is declared with a permissive minimum version rather than an exact version, so dependency resolution may select unreviewed future releases. This increases the chance of unexpected security or behavior changes across environments.

Content

Scanner excerpt · requirements.txt (reported line 3)May include surrounding context.

text
Flask>=2.3.0
Faker>=19.0.0
jsonschema>=4.17.0
requests>=2.31.0
pytest>=7.0.0

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
97% confidence
Finding

requests is unpinned despite being a security-relevant HTTP client library. Because future installations can resolve to different versions, the project may unknowingly consume a release with known vulnerabilities or changed security behavior.

Content

Scanner excerpt · requirements.txt (reported line 4)May include surrounding context.

text
Flask>=2.3.0
Faker>=19.0.0
jsonschema>=4.17.0
requests>=2.31.0
pytest>=7.0.0

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
91% confidence
Finding

requests has multiple known advisories and is not pinned, so deployments may end up with an affected version without visibility. Because requests often handles outbound HTTP, credentials, redirects, and TLS-related behavior, uncertain versioning can have direct security consequences.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
90% confidence
Finding

pytest is unpinned, which affects reproducibility and may expose development or CI environments to vulnerable or incompatible releases. Even though it is usually a dev dependency, compromised test tooling can still affect build integrity.

Content

Scanner excerpt · requirements.txt (reported line 5)May include surrounding context.

text
Faker>=19.0.0
jsonschema>=4.17.0
requests>=2.31.0
pytest>=7.0.0

Unverifiable Dependency: pytest has 2 known advisory(ies) (CVE-2025-71176 (pytest has vulnerable tmpdir handling); CVE-2025-71176 (pytest has vulnerable tmpdir handling)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
83% confidence
Finding

pytest is not pinned even though advisories exist for some versions, making it unclear whether CI or development environments are exposed. While primarily a test dependency, vulnerable tooling can still undermine pipeline security or local developer systems.

Content

No source excerpt is available for this finding.