T09 · Insecure Skill Coding Practices
- Location
core/s2_bms_lord.py:71- Finding
Dispatch signatures do not authenticate the complete command envelope
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is local and not clearly malicious, but it asks for sensitive building-control authority while its safety, key-handling, and approval boundaries are not strong enough for that role.
Review carefully before installing. Treat this as a research or simulation skill only unless you add strict deployment controls: isolate the master signing key, remove private-key access from subsystem agents, sign complete command envelopes with replay protection, pin dependencies, require explicit human approval for physical or financial actions, and define privacy controls before using occupancy, EV, or wearable data.
core/s2_bms_lord.py:71Dispatch signatures do not authenticate the complete command envelope
core/s2_chiller_agent.py:129Subsystem agents are granted access to the central signing key and master secret
requirements.txt:1Install process resolves an unpinned third-party cryptography package
The document proposes using employee EV battery capacity and wearable-derived biometric signals to influence building control decisions, yet it does not clearly define informed consent, opt-in boundaries, revocation, data minimization, or protection of sensitive personal data. This is especially risky because biometric and vehicle-energy data can expose health status, presence, routines, and personal assets, creating substantial privacy, labor, and compliance exposure if collected or acted on improperly.
This markdown file contains feature and change descriptions written in Chinese, including headings and body text, but does not indicate that the user can choose the language or that the locale is intentionally region-specific. Under the policy, forcing a specific language or mixed-language output without opt-in is a natural-language policy concern.
This code includes natural-language comments, docstrings, exceptions, and print messages written exclusively in Chinese, such as the policy-defining comment and all user-facing status/warning text. Because the file does not offer any language selection or explain that the skill is intentionally region-specific, it appears to impose a specific language/locale without user opt-in.
The implementation contradicts its security claims by silently generating a local random password when the required environment variable is absent, instead of failing closed. In a building-control orchestration context, this can create unpredictable key lifecycle behavior, break operational trust assumptions, and cause unauthorized or unverifiable dispatch tokens after restart if operators believe external key management is enforced.
The docstring and user-facing print messages are written entirely in Chinese and present operational/security guidance in that language only. This imposes a specific language on users/operators without any opt-in, fallback, or justification that the skill is region-specific.
The status text claims a 'single-use, self-destructing' salt and that old keys become invalid after restart, but the code persists encrypted key files to disk. Misleading security messaging is dangerous because operators may make deployment and incident-response decisions based on false assumptions about key ephemerality and revocation behavior.
Multiple docstrings and printed operational messages in the execution path are primarily in Chinese, including arbitration and dispatch output. Because these are user/operator-facing strings and there is no option to select another language, the file violates the language/locale policy criteria.
User-visible comments and console messages throughout the file are written in Chinese, and the script does not provide any language-selection or opt-in mechanism. Under the stated policy, forcing a specific language without user choice is a natural-language policy violation unless clearly justified as region-specific.
The script accesses S2_BMS_MASTER_KEY, which is a sensitive credential-like environment variable used to unlock a private key. Although it prints an error only when the variable is missing, there is no upfront warning or explanatory disclosure before attempting to use sensitive host credentials.
This Python file contains multiple user-facing print strings and generated insight text entirely in Chinese, including the main execution output and report narrative. The skill does not offer a language/locale option or explain that it is intentionally restricted to a Chinese-speaking context, which creates a natural-language locale policy issue.
This file contains extensive natural-language strings and comments in Chinese, including operational messages and setup instructions, but does not provide an opt-in or alternative locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation unless clearly justified as region-specific.
The demo/test block is labeled as a harmless exercise, but it loads the actual Ed25519 private key from disk and uses it to mint valid authorization tokens. In an operational environment, any code path that signs live control messages with production keys expands the attack surface: an operator, test harness, or compromised runtime could misuse the script to generate real actuator commands.
This file contains multiple natural-language strings shown to the user entirely in Chinese, including operational status, errors, and setup instructions. Because the skill does not offer opt-in language selection or justify a Chinese-only locale, it violates the language/locale policy criteria.
The demo/test path reads an encrypted private signing key from disk and unlocks it with a master secret taken from an environment variable, then uses that key to generate authorization tokens. In a control-agent context, bundling signing capability into the same skill that executes physical actions weakens separation of duties and creates a dangerous pathway where compromise of the host or runtime environment can enable forging trusted commands.
This Python file contains user-facing comments, status messages, and operational output entirely in Chinese, beginning with the section headings and continuing throughout runtime prints. The policy requires flagging language or locale constraints when the skill forces a specific language without user opt-in, and no alternative language selection or justification is present in the file.
The section header at L123 says this is a '无损测试版' (non-destructive test version), which implies no operational actuation should occur. However, the main routine generates a signed dispatch token and calls execute_proposal(), whose behavior at L116 explicitly issues a PCS inverter command ('物理落闸' / dispatch to inverter), contradicting the stated test-only intent.
This Python file contains comments, docstrings, and printed user-facing status/report text primarily in Chinese, with no indication that the user can select another language or that the skill is intentionally limited to a Chinese-speaking region. The policy for SQP-3 applies to all file types and flags language/locale constraints that are imposed without opt-in or justification.
The document explicitly describes centralized collection of room-level demand signals, weather feeds, and real-time pricing data to drive building-wide decisions, but it provides no notice, limitation, or governance language for monitoring, retention, or access control. In a building automation context, even operational telemetry can reveal occupancy patterns and behavioral data, so omitting privacy and data-handling safeguards creates a real privacy and surveillance risk.
The whitepaper describes autonomous acceptance of grid demand-response events and automatic purchases through external carbon-credit trading interfaces without any warning, approval gate, or transaction-control requirements. In an agent skill for building operations, this is dangerous because it normalizes financially and operationally consequential external actions that could be triggered incorrectly, abused by compromised integrations, or violate contractual and regulatory constraints.
The whitepaper explicitly proposes syncing employee smartwatch HRV data so the central building agent can infer fatigue and autonomously alter the environment, but it provides no consent model, notice, minimization, retention limits, or access-control/privacy safeguards. Biometric and health-adjacent telemetry is sensitive personal data, and in a building-automation context this creates meaningful privacy, profiling, and workplace-surveillance risk if implemented as described.
The manifest explicitly requires a master-key environment variable, which indicates the skill depends on highly sensitive credential material to operate. Declaring this without any accompanying guidance on secure provisioning, storage, rotation, or least-privilege handling increases the risk that users will expose the key through shell history, logs, process listings, CI/CD settings, or unsafe local configuration.
The title and prompt hard-code Chinese labels and UI text, including the action button, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking context. This matches the language/locale policy concern for natural-language content that forces a specific language without opt-in.
The prompt describes an energy arbitrage control workflow and includes an authorization action for dispatch, but it does not define operating guardrails such as SOC bounds, export/import limits, battery health constraints, safety interlocks, or conditions under which arbitrage must be blocked. In a microgrid/VPP context, an unconstrained agent-generated recommendation or UI flow could encourage unsafe or economically harmful dispatch decisions, especially because the logic explicitly prioritizes discharge at peak and charging at valley without qualification.
The title and dashboard content are specified in Chinese, including user-facing labels such as KPI names and the board-level dashboard title, with no indication that language choice is optional. This creates a locale policy concern because the skill appears to enforce a specific language rather than offering user selection or documenting a justified region-specific requirement.
Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.
Article 3: Strict Restrictions on Commercial Use & Integration
Unauthorized commercial use of this Software is strictly prohibited. Any commercial activity that does not fall under personal end-use or academic research requires prior written authorization from the Software Developer (Space2.world / Miles Xiang) and the payment of applicable commercial licensing fees.
Strictly prohibited unauthorized commercial activities include, but are not limited to:
Building Automation (BA) enterprises, System Integrators (SIs), or engineering contractors deploying, installing, or configuring this Software for their clients as a paid third-party service.