Back to skill

Security audit

The Holographic Memory Matrix

Security checks for vulnerabilities and agentic risk

Overview

The skill is not deceptive or destructive, but its life-safety memory claims are much stronger than the implemented logging and compression controls support.

Review this before installing in any real smart-home, safety, incident-review, or compliance workflow. It appears local and non-exfiltrating, but its database may omit relevant environmental changes and does not enforce the safety and retention controls it describes.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.py:80
Finding

Delta compression silently discards changes in four monitored dimensions

Content
View full analysis

Vulnerability Details

File Location: SKILL.py, lines 80-104
Vulnerability Type: Incomplete state comparison causing loss of security-relevant timeline data
Risk Level: High

python
def inject_6_elements_timeline(unit_id, full_6_elements_state):
    """
    ⏳ 环境六要素注入引擎:完全继承 Phase 1 的数据模型,并执行压缩法则
    """
    conn = sqlite3.connect(DB_PATH)
    cursor = conn.cursor()
    ts = datetime.now()
    
    # 提取六要素的 JSON 字符串以便对比与存储
    e1 = json.dumps(full_6_elements_state.get("element_1_light", {}))
    e2 = json.dumps(full_6_elements_state.get("element_2_air_hvac", {}))
    e3 = json.dumps(full_6_elements_state.get("element_3_sound", {}))
    e4 = json.dumps(full_6_elements_state.get("element_4_electromagnetic", {}))
    e5 = json.dumps(full_6_elements_state.get("element_5_energy", {}))
    e6 = json.dumps(full_6_elements_state.get("element_6_visual", {}))
    
    # 模拟获取上一分钟状态进行 Delta 压缩比对
    cursor.execute("SELECT element_1_light, element_2_air_hvac FROM env_timeline WHERE unit_id=? ORDER BY timestamp DESC LIMIT 1", (unit_id,))
    last_state = cursor.fetchone()
    
    is_compressed = False
    if last_state:
        # 如果光和空气等核心要素的 JSON 完全一致,触发压缩折叠
        if last_state[0] == e1 and last_state[1] == e2:
            is_compressed = True
            print(f"   [Delta Compression] 6-Element payload is identical to previous minute in Unit {unit_id}. Folded. (六要素数据模型未变化,触发压缩)")
            conn.close()
            return "COMPRESSED_SKIP"

Technical Analysis

The function receives and serializes six environmental dimensions, but its compression decision retrieves and compares only element_1_light and element_2_air_hvac. Changes to sound, electromagnetic conditions, energy, or visual state are therefore ignored whenever light and HVAC remain unchanged.

The function then returns COMPRESSED_SKIP without writing the changed state to SQLite. This is a fail-open data-inte ...[truncated 1692 chars]

Remediation
View remediation

Remediation Suggestions

  1. Retrieve and compare all six stored dimensions before suppressing a write.
  2. Treat a change in any dimension as a state transition requiring a new record.
  3. Canonicalize JSON serialization with stable key ordering, such as sort_keys=True, before comparison.
  4. Use dimension-specific comparison logic for numeric measurements rather than raw JSON equality.
  5. Add automated tests that independently change each of the six dimensions and verify that every change creates a timeline record.
  6. Consider storing a canonical hash of the complete six-element state and comparing that hash only after validating that every expected dimension is present.
  7. Fail closed when required dimensions are missing or malformed instead of substituting an empty object without validation.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.py:81
Finding

Declared timing and compression safeguards are not enforced

Content
View full analysis

Vulnerability Details

File Location: SKILL.py, lines 81-82 and 133-143; chronos_config.json, lines 16-25
Vulnerability Type: Security-relevant configuration is loaded but ignored
Risk Level: Medium

Relevant implementation:

python
conn = sqlite3.connect(DB_PATH)
cursor = conn.cursor()
ts = datetime.now()
python
print("\n[ T=0 : Initializing Spatial Memory / 初始化空间记忆 ]")
inject_6_elements_timeline("U_Bedroom_01", primitive_state)

print("\n[ T+1m : Simulating Unchanged State / 模拟状态无变化 ]")
inject_6_elements_timeline("U_Bedroom_01", primitive_state) # 触发折叠!

print("\n[ T+Xm : Simulating Causality Event / 模拟因果律事件 ]")
print(" 🤖 Agent modifies Element 1 (Light) based on Avatar Mandate.")
primitive_state["element_1_light"]["illuminance_lux"] = 0 # 关灯事件,打破压缩!
inject_6_elements_timeline("U_Bedroom_01", primitive_state)

Declared configuration:

json
"timeline_baseline": {
  "granularity_seconds": 60,
  "delta_compression": {
    "enabled": true,
    "tolerance_fluctuation": {
      "light_lux_diff": 5.0,
      "temp_celsius_diff": 0.5,
      "sound_db_diff": 2.0
    },
    "description": "If variance is below tolerance, the engine folds the state to save space. / 如果要素波动低于容忍度,引擎将进行折叠压缩以节省空间。"
  }
}

Technical Analysis

Although chronos_config.json is loaded globally, the timeline implementation does not consult granularity_seconds, delta_compression.enabled, or any configured tolerance. Consecutive calls are made immediately, despite labels claiming that one minute or an unspecified interval has elapsed.

Compression is always active whenever the two compared JSON strings match. Disabling compression in configuration would have no effect. Numeric tolerance values likewise have no effect because the implementation performs exact serialized-string equality rather than threshold-based comparisons.

This creates a security-relevant mismatch betwe ...[truncated 1442 chars]

Remediation
View remediation

Remediation Suggestions

  1. Read and validate CFG["timeline_baseline"]["granularity_seconds"] before accepting or aggregating samples.
  2. Track the last accepted timestamp per unit and explicitly define whether early samples are rejected, queued, aggregated, or recorded as discrete events.
  3. Honor delta_compression.enabled; when it is false, persist every accepted sample.
  4. Implement typed, per-dimension tolerance comparisons using the configured thresholds.
  5. Validate threshold values as finite, non-negative numbers and reject malformed configuration at startup.
  6. Separate demonstration code from the production entry point. If calls are simulations, use explicit simulated timestamps rather than labels that do not correspond to elapsed time.
  7. Add tests covering disabled compression, altered granularity, boundary tolerance values, early samples, and discrete safety events.
  8. Update the documentation to distinguish implemented controls from planned controls until enforcement is complete.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The whitepaper explicitly hardcodes a 1-minute environmental sampling baseline and frames the resulting blind spot as acceptable, but it does not provide user-facing warnings about missed transient hazards, reduced forensic fidelity, or cases where sub-minute changes matter. In a smart-home or life-safety context, this can cause dangerous under-monitoring of rapid environmental changes and loss of evidence needed to diagnose incidents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The file includes prominent natural-language comments and user-facing strings in Chinese, including mandatory phrasing such as Imports MUST come first alongside Chinese-only instructional text, but nowhere offers a user opt-in or language selection. Under the language/locale policy rule, forcing a specific language without documented choice or justification is a policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill persists environment-state data into a local SQLite database under the working directory without any consent flow, retention notice, access controls, or minimization. In a memory/logging skill, this can accumulate potentially sensitive contextual data about a user's environment and behavior, increasing privacy and forensic exposure if the host is shared or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill text explicitly states it will automatically build a local s2_chronos.db, which implies writing potentially sensitive operational and decision data to disk without any clear user notice, consent flow, storage location disclosure, or retention limits. In this context, the database is described as containing environment timelines, agent decisions, and avatar mandates, so silent persistence increases privacy and data exposure risk even if the write itself is local.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The docstring at L24-L27 describes load_chronos_config as loading global configuration for the memory array. However, the inline comment at L34 says the resulting config object will be used for later compression algorithms and API calls, while the file contains no API call implementation at all. This is an intent/documentation inconsistency within the file's own comments about what the code is for.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This JSON file describes the skill as a master configuration file but provides no explicit activation conditions, trigger phrases, or exclusion conditions. For manifest-style files, that absence can make it unclear when the associated skill should activate versus when it should not.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
65% confidence
Finding

The description and warning are hard-coded in English and Chinese, which may imply a fixed language/locale presentation without any stated user preference mechanism. This can be a natural-language policy concern if the organization requires language choice or explicit locale opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.