Back to skill

Security audit

Quantum Bridge

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Quantum Bridge API helper, but its bundled CLI can send API keys and local circuit files to any endpoint set by an environment variable.

Review this before installing if you handle proprietary circuits, research data, or paid API credits. Use a protected environment variable or secret store for QUANTUM_BRIDGE_KEY, do not put the key in shared project files, confirm where QUANTUM_BRIDGE_URL points before running the CLI, and avoid submitting sensitive circuit or JSON files unless you intend to upload them to the Quantum Bridge service.

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/qbridge.sh:18
Finding

Unvalidated API Endpoint Override Can Expose Credentials and User Data

Content
View full analysis

Vulnerability Details

File Location: scripts/qbridge.sh, lines 18-68
Vulnerability Type: Unvalidated remote endpoint configuration leading to credential and data disclosure
Risk Level: Medium

Vulnerable Code

bash
BASE="${QUANTUM_BRIDGE_URL:-https://quantum-api.gpupulse.dev/api/v1}"
KEY="${QUANTUM_BRIDGE_KEY:-}"

if [[ -z "$KEY" ]]; then
  echo "Error: Set QUANTUM_BRIDGE_KEY env var (get one free at https://quantum-api.gpupulse.dev)" >&2
  exit 1
fi

AUTH="Authorization: Bearer $KEY"
CT="Content-Type: application/json"

cmd="${1:-help}"
shift || true

case "$cmd" in
  transpile)
    file="${1:?Usage: qbridge transpile <file.qasm>}"
    qasm=$(cat "$file")
    curl -s -X POST "$BASE/transpile" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg q "$qasm" '{qasm: $q}')"
    ;;
  reverse)
    file="${1:?Usage: qbridge reverse <file.originir>}"
    ir=$(cat "$file")
    curl -s -X POST "$BASE/reverse" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg o "$ir" '{originir: $o}')"
    ;;
  validate)
    file="${1:?Usage: qbridge validate <file.originir>}"
    ir=$(cat "$file")
    curl -s -X POST "$BASE/validate" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg o "$ir" '{originir: $o}')"
    ;;
  consensus)
    file="${1:?Usage: qbridge consensus <agents.json>}"
    curl -s -X POST "$BASE/consensus" -H "$AUTH" -H "$CT" -d @"$file"
    ;;
  submit)
    file="${1:?Usage: qbridge submit <file.qasm> [simulator|wukong]}"
    backend="${2:-simulator}"
    qasm=$(cat "$file")
    curl -s -X POST "$BASE/submit" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg q "$qasm" --arg b "$backend" '{qasm: $q, backend: $b, shots: 1000}')"
    ;;
  poll)
    task_id="${1:?Usage: qbridge poll <task_id>}"
    curl -s "$BASE/submit/$task_id" -H "$AUTH"
    ;;
  balance)
    curl -s "$BASE/balance" -H "$AUTH"
    ;;
  backends)
    curl -s "$BASE/backends" -H "$AUTH"
    ;;

...[truncated 2293 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove QUANTUM_BRIDGE_URL configurability if custom endpoints are unnecessary and use a fixed trusted HTTPS endpoint.
  2. If endpoint overrides are required, parse and validate the URL before constructing any authenticated request.
  3. Require the https scheme and reject plaintext HTTP.
  4. Enforce an explicit hostname allowlist, such as quantum-api.gpupulse.dev, unless the user deliberately enables a documented custom-endpoint mode.
  5. Never attach the bearer credential when the destination is outside the approved allowlist.
  6. Reject URLs containing unexpected user information, fragments, ports, redirects, or malformed hostnames as appropriate for the deployment.
  7. Configure curl to fail safely and restrict redirects. If redirects are enabled, ensure authorization headers cannot be forwarded to an untrusted host.
  8. Document custom endpoint behavior and require explicit confirmation before transmitting credentials or file contents to a non-default service.
  9. Store the API key in a dedicated secret manager or protected environment variable. Avoid plaintext project files such as TOOLS.md; if such storage is unavoidable, restrict permissions and exclude the file from version control.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill demonstrates shell-based network operations but does not declare any explicit tool scope such as allowed-tools or permissions. This increases the chance that an agent can invoke shell/network capabilities more broadly than intended, reducing containment and reviewability for a skill that can transmit data and spend credits on external services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs sending user-provided quantum circuits to a third-party API and even real quantum hardware, but it does not clearly warn that user data leaves the local environment. Users may unknowingly submit proprietary, research-sensitive, or regulated circuit designs to an external operator.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill tells users to place an API key in TOOLS.md or environment variables but does not emphasize that the key is a sensitive secret that must not be exposed, echoed, logged, or committed. This can lead to credential leakage and unauthorized use of the paid external service.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
94% confidence
Finding

This example performs external transmission of user-supplied QASM plus an authorization credential to a remote service. In context, the transmission is the skill's intended function, but it is still security-relevant because sensitive circuit data and API usage leave the local trust boundary.

Content

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

Transpile QASM → OriginIR (1 credit)

bash
curl -X POST "$BASE/transpile" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"qasm": "OPENQASM 2.0;\ninclude \"qelib1.inc\";\nqreg q[2];\ncreg c[2];\nh q[0];\ncx q[0],q[1];\nmeasure q[0] -> c[0];\nmeasure q[1] -> c[1];"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This finding correctly identifies external transmission of local file content to a third-party API. Although this behavior aligns with the tool's functionality, it remains security-relevant because users may expose sensitive local data if they are not clearly informed that processing occurs remotely.

Content

Scanner excerpt · scripts/qbridge.sh (reported line 36)May include surrounding context.

sh
transpile)
    file="${1:?Usage: qbridge transpile <file.qasm>}"
    qasm=$(cat "$file")
    curl -s -X POST "$BASE/transpile" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg q "$qasm" '{qasm: $q}')"
    ;;
  reverse)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The transpile command reads a local QASM file and sends its full contents to a remote API, but the script provides no explicit user-facing warning or confirmation that local data is being transmitted externally. In a developer tool this can lead to unintended disclosure of proprietary circuits, research IP, or sensitive data embedded in files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The reverse command uploads a local OriginIR file to the external service without warning the user that file contents leave the local environment. This creates a confidentiality risk if users assume the conversion is local or if the file contains sensitive quantum program details.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The validate command posts local OriginIR content to a remote endpoint while presenting validation as a simple CLI operation, without clearly informing users of external transmission. Users may unintentionally expose internal or proprietary circuit definitions when expecting a local syntax check.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The consensus command sends an entire local JSON file to a remote API with no warning about external transmission. Because JSON inputs may contain prompts, agent configurations, internal endpoints, or tokens, silent upload increases the risk of accidental data leakage.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This line sends local QASM content to the remote submit endpoint for execution on simulator or hardware. The skill context makes this expected rather than malicious, but it is still a true security concern because it transmits potentially proprietary circuits and uses an authorization token for an external service.

Content

Scanner excerpt · scripts/qbridge.sh (reported line 59)May include surrounding context.

sh
file="${1:?Usage: qbridge submit <file.qasm> [simulator|wukong]}"
    backend="${2:-simulator}"
    qasm=$(cat "$file")
    curl -s -X POST "$BASE/submit" -H "$AUTH" -H "$CT" \
      -d "$(jq -n --arg q "$qasm" --arg b "$backend" '{qasm: $q, backend: $b, shots: 1000}')"
    ;;
  poll)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The submit command uploads local QASM content to remote simulator or hardware endpoints without an explicit warning or consent step. In the context of a skill designed to submit circuits to real hardware, remote transmission is expected, but the lack of transparent disclosure still makes accidental exfiltration of sensitive circuit data more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill describes submitting jobs to simulator and hardware services that consume credits, but the usage workflow does not prominently warn that these actions can spend the user's balance. An agent could trigger billable operations without sufficiently informed user consent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.