T07 · Tool Hijacking and Spoofing
Error
- Location
- energy.py:41
- Finding
- Synthetic Appliance Data Is Presented as Real Household Telemetry<![CDATA[ ## Vulnerability Details **File Location**: `energy.py:41-50`, `energy.py:68-78`, `energy.py:97-105`, and `AGENT-EXAMPLES.md:27-49` **Vulnerability Type**: Data and tool-output spoofing **Risk Level**: High ### Vulnerable Code ```python # 1. 构建模拟的 20 个设备全屋盘点底座 data = [ {"Room": "Living Room", "Device": "Main AC", "Power_W": 2000}, {"Room": "Living Room", "Device": "Smart TV", "Power_W": 150}, {"Room": "Master Bed", "Device": "Bedroom AC", "Power_W": 1000}, {"Room": "Kitchen", "Device": "Refrigerator", "Power_W": 150}, {"Room": "Kitchen", "Device": "Microwave", "Power_W": 1000}, {"Room": "Bathroom", "Device": "Water Heater", "Power_W": 2000}, # ... 模拟 20 个设备缩略 {"Room": "Study", "Device": "Desktop PC", "Power_W": 300} ] df = pd.DataFrame(data) ``` ```python np.random.seed(42) days = np.arange(1, 31) daily_matrix = np.zeros((30, len(df))) for i, row in df.iterrows(): base_h = 4.0 # 模拟基准小时 noise = np.random.normal(loc=base_h, scale=base_h * 0.2, size=30) weekend_multiplier = np.where((days % 7 == 6) | (days % 7 == 0), 1.3, 1.0) hours = np.clip(noise * weekend_multiplier, 0, 24) daily_matrix[:, i] = (hours * row["Power_W"]) / 1000.0 ``` ```python return { "action": "generate_dashboard", "status": "success", "total_devices_analyzed": len(df), "peak_daily_kwh": round(float(np.max(total_daily_kwh)), 2), "generated_charts_uris": chart_paths, "vendor_nl": "Advanced data visualization generated locally. No cloud analytics used. / 高级可视化图表已在本地生成,零云端分析介入。" } ``` The accompanying Agent instructions state: ```markdown I know from the 20-device inventory that Main AC (2000W) and Water Heater (2000W) are the biggest power hogs. The tool reports a peak of 28.5 kWh. I should hypothesize this correlates with weekend usage patterns. Cross-Domain Action Plan: I will propose a specific, executable action using my other skills (like adjusting the AC via s2-atmos-perception or cutting standby p ...[truncated 2218 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Label every generated value and chart prominently as demonstration or simulated data. 2. Do not use the success schema for simulated reports unless the schema includes an explicit field such as: ```json { "data_source": "simulation", "is_measured": false } ``` 3. Accept measured input only through a documented, validated telemetry interface. 4. Attach provenance to every reported metric, including sensor identifier, collection time, units, and whether the value was measured or estimated. 5. Remove Agent instructions that characterize simulated results as actual household observations. 6. Ensure the documented number of devices matches the records actually processed. 7. Prevent physical-control recommendations when the input is synthetic or lacks trustworthy provenance. 8. Add tests that fail if demonstration data is returned without a conspicuous simulation marker. ]]>
