Back to skill

Security audit

Pydaqua SpaceAutonomySkill

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but it should be reviewed because malformed sensor input can bypass its advertised safety check and return a PROCEED decision.

Review this before installing if you expect safety-critical navigation behavior. It appears to be a local simulation rather than a backdoor or data-stealing skill, but its advertised fail-safe is unreliable for malformed sensor data, so it should not be used to drive real autonomous decisions without input validation and fail-closed handling.

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

Error
Location
scripts/quantum_nav.py:50
Finding
Non-Finite Sensor Input Causes the Safety Decision to Fail Open<![CDATA[ ## Vulnerability Details **File Location**: `scripts/quantum_nav.py:50-121` **Vulnerability Type**: Improper input validation and fail-open safety logic **Risk Level**: High ### Complete Vulnerable Code ```python def compute_kernel(vec_a, vec_b): """Computes similarity using the optical simulator.""" sim = OpticalQuantumSimulator(num_modes=2) kernel_sum = 0 # simplified element-wise comparison for robustness for i in range(min(len(vec_a), len(vec_b))): sim.state[0] = np.exp(1j * vec_a[i]) sim.state[1] = np.exp(1j * vec_b[i]) sim.evolve() sim.interfere() intensities = sim.measure() # Heuristic: Destructive interference at port 2 implies similarity? # Let's use a standard visibility metric. # If phases are equal, port 1 -> bright, port 2 -> dark (depending on BS phase) # We assume standard BS where equal inputs -> port 0 activates. diff = intensities[0] - intensities[1] # Derived physics: diff = 2 * sin(phi_a - phi_b) # We want Kernel = 1 when diff = 0 (identical phases) # We use a linear decay based on the interference contrast # Range of diff is [-2, 2]. similarity = 1.0 - (0.5 * np.abs(diff)) kernel_sum += similarity return kernel_sum / len(vec_a) ``` ```python def decide_action(self, sensor_input): scores = self.classify_terrain(sensor_input) best_match = max(scores, key=scores.get) confidence = scores[best_match] print("\n--- Quantum Kernel Analysis ---") for t, s in scores.items(): print(f" {t}: {s:.4f}") print(f"\nBest Match: {best_match} (Confidence: {confidence:.4f})") # SAFETY FAILSAFE if confidence < self.safety_threshold: return ">>> TRIGGERING FAILSAFE: SAFE MODE (UNCERTAIN TERRAIN) <<<" if "SAFE" in best_match: return f"Action: PROCEED (Terrain is {best_match})" else: return f"Action: AVOID / HALT (Detected {b ...[truncated 3000 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate the parsed vector before classification: - Require exactly three values to match the built-in signatures. - Reject empty vectors. - Reject every value for which `math.isfinite(value)` is false. - Enforce the documented input range, such as `0.0 <= value <= 1.0`. 2. Validate all calculated scores and the selected confidence: ```python if not scores or any(not math.isfinite(float(score)) for score in scores.values()): return ">>> TRIGGERING FAILSAFE: SAFE MODE (INVALID CLASSIFICATION) <<<" ``` 3. Make the safety check explicitly fail closed: ```python if not math.isfinite(float(confidence)) or confidence < self.safety_threshold: return ">>> TRIGGERING FAILSAFE: SAFE MODE (UNCERTAIN TERRAIN) <<<" ``` 4. Use exact terrain-state comparisons rather than substring matching: ```python if best_match == "SAFE_FLAT": return f"Action: PROCEED (Terrain is {best_match})" return f"Action: AVOID / HALT (Detected {best_match})" ``` 5. Treat parsing, dimensional, simulation, and scoring errors as safety events. Catch relevant exceptions at the application boundary and return safe mode or halt rather than continuing or crashing. 6. Add regression tests for `nan`, `inf`, `-inf`, empty input, vectors of incorrect length, out-of-range values, and non-finite intermediate scores. Every invalid or anomalous case should deterministically produce a halt or safe-mode decision. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.