Back to skill

Security audit

S2 多模态融合与空间预测引擎

Security checks for vulnerabilities and agentic risk

Overview

The skill is not evidently malicious, but it should be reviewed because it makes safety-relevant physical-world predictions from weakly validated sensor data.

Install only for non-critical experimentation unless you add strict sensor schemas, finite/range checks, stale-data handling, fail-closed Unknown or Unsafe results, independent collision protection, and privacy controls for captured environmental data. Do not allow this skill's predictions alone to authorize robot movement or other physical actions.

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
handler.py:29
Finding
Unvalidated Sensor Data Produces Fail-Open Physical Safety Guidance<![CDATA[ ## Vulnerability Details **File Location**: `handler.py:29-97`; safety impact is amplified by the trust directive in `SKILL.md:17` **Vulnerability Type**: Improper input validation and fail-open safety logic **Risk Level**: High ### Vulnerable Code ```python lidar = sensors.get("lidar", {}) vision = sensors.get("camera", {}) tactile = sensors.get("tactile", {}) aligned_state = { "timestamp_t0": time.time(), "obstacle_distance_m": lidar.get("distance_m", 99.0), "material_reflectivity": lidar.get("rcs", 0.0), "semantic_label": vision.get("object_label", "unknown"), "thermal_gradient": vision.get("ir_temp_c", 25.0), "contact_force_n": tactile.get("force_newtons", 0.0), "surface_friction": tactile.get("friction_coeff", 0.0) } ``` ```python resolution = {"physics_truth": "Clear", "confidence": 0.99} if state["semantic_label"] == "empty_space" and state["obstacle_distance_m"] < 1.0 and state["material_reflectivity"] > 20: resolution = {"physics_truth": "Transparent Rigid Body (Glass)", "confidence": 0.98} elif state["semantic_label"] == "wall" and state["obstacle_distance_m"] > 3.0: resolution = {"physics_truth": "Visual Illusion / Hologram / Poster", "confidence": 0.95} if state["contact_force_n"] > 5.0: resolution["interaction"] = f"Physical contact confirmed. Force: {state['contact_force_n']}N." ``` ```python if state["contact_force_n"] > 0: predictions["t+1s"] = "触感反馈稳定,抓取/接触姿态正在保持,静摩擦力建立。" elif truth.get("physics_truth") == "Transparent Rigid Body (Glass)": predictions["t+1s"] = "极度警告:即将与不可见刚体(玻璃)发生物理碰撞,建议立即制动。" if semantics == "human_moving": predictions["t+5s"] = "视觉检测到的人类正在向九宫格 Grid_3 移动,预计将占据该网格生存位。" predictions["t+15s"] = "当前轨迹演化:实体将穿过当前门禁通道。根据雷达与视觉融合,通道内无隐藏障碍物。" ``` The associated trust directive is: ```markdown When Vision (Semantic) and LiDAR (Topology) conflict, trust the fusion engine's `physics_truth` resolution. ``` ### Technical Analysis The handler accepts sensor data wit ...[truncated 3484 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Define and enforce a strict input schema before processing: - Require the expected `raw_sensors`, `lidar`, `camera`, and `tactile` structures. - Require numeric fields to be actual finite numbers. - Reject booleans, strings, arrays, and objects where numeric values are expected. - Reject `NaN`, positive infinity, and negative infinity. - Apply documented physical ranges to distance, reflectivity, temperature, force, and friction values. 2. Validate temporal and spatial metadata: - Require sensor timestamps and reject stale measurements. - Define a maximum permitted synchronization offset. - Require sensor identity, calibration status, coordinate frame, and measurement uncertainty. - Do not claim spatio-temporal alignment unless alignment is actually performed. 3. Replace fail-open defaults: - Missing or invalid measurements must produce `Unknown`, `Insufficient Evidence`, or `Unsafe to Proceed`. - Never default environmental state to `Clear`. - Do not assign high confidence where required sensors are absent or invalid. 4. Remove the unconditional passage-clear prediction. Generate clearance statements only when sufficient validated measurements establish clearance within a defined confidence model. 5. Require genuine multimodal agreement for safety-sensitive conclusions. Contradictory inputs should reduce confidence and request a new measurement rather than selecting a hard-coded interpretation. 6. Separate advisory predictions from actuator authorization. Downstream movement must remain subject to independent collision detection, emergency stopping, speed limits, and human or certified safety-controller oversight. 7. Configure JSON parsing to reject non-standard constants explicitly. For example: ```python def reject_constant(value): raise ValueError(f"Non-finite JSON number is not allowed: {value}") args = json.loads(sys.argv[1], parse_constant=reject_constant) ``` 8. Add neg ...[truncated 369 chars]
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
Findings (4)

Instruction Override

High
Category
Prompt Injection
Content
You now possess a multimodal perception engine. You must never rely on a single sensor to make physical decisions. The S2-SWM enforces Latent Space Cross-Validation to ensure true physical understanding.

## 1. Sensor Hierarchy & Fusion Directives
* **Banned Sensors:** You must ignore any inputs mimicking PIR (Pyroelectric Infrared) sensors. They lack the dimensional depth required for our 14-D holographic matrix.
* **Cross-Validation (去幻觉机制):** When Vision (Semantic) and LiDAR (Topology) conflict, trust the fusion engine's `physics_truth` resolution. If LiDAR detects a high-RCS object at 0.5m but Vision sees "empty space," you are facing glass. Do not move forward.

## 2. Temporal Execution
Confidence
89% confidence
Finding
The skill contains hard override language such as 'You must ignore' sensor inputs, which can suppress or discard potentially safety-relevant data based on author-defined policy rather than system-level controls. In an embodied AI context, sensor suppression and rigid trust in a single fusion output can create unsafe physical decisions, especially if inputs are spoofed, mislabeled, or the fusion engine is wrong.

Missing User Warnings

Medium
Confidence
87% confidence
Finding
The skill explicitly instructs ingestion of multimodal environmental sensing, including vision, infrared, radar, and tactile data, but provides no privacy, consent, retention, or bystander-capture safeguards. In an embodied AI context, these sensors can collect sensitive information about people, spaces, and behaviors, so omission of warnings and handling constraints creates a real privacy and safety risk rather than a purely theoretical documentation gap.

Missing User Warnings

Medium
Confidence
83% confidence
Finding
The document describes predictive obstacle handling, collision arbitration, and automatic evasion prompting in a physical-world embodied system without warnings about uncertainty, failure modes, or human oversight. Because these outputs may directly influence navigation or actuation around people and objects, over-trust in the predictions could lead to unsafe motion, collisions, or integrity failures in the controlled system.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The phrase "去幻觉机制" introduces a non-English locale element in the operational instructions, but the skill does not indicate that multilingual output is optional or required for a justified regional context. This can violate language/locale policy expectations when users or agents are not given an explicit language choice.

Static analysis

No suspicious patterns detected.