T09 · Insecure Skill Coding Practices
- Location
handshake/resonance_manifest.py:308- Finding
Gateway allowlist violations do not block session hydration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is not clearly malicious, but its governance and safety promises are undercut by fail-open checks, broad activation, credential-backed Moltbook access, and a standalone session server.
Install only if you are comfortable reviewing and tightening the security controls first. Treat it as experimental governance tooling, avoid production credentials, do not rely on its oracle or entropy gates as written, and be aware that the heartbeat can use your Moltbook API key and write persistent local logs and token secrets.
handshake/resonance_manifest.py:308Gateway allowlist violations do not block session hydration
handshake/resonance_manifest.py:280Session hydration does not enforce entropy budgets
sandbox/adversarial.py:32Adversarial safety checks fail open for configured rule identifiers
constraints/handshake_validator.py:126Entropy accounting fails open when the audit history is malformed or unreadable
handshake/token_engine.py:165Existing HMAC secret files are loaded without ownership or permission validation
The sandbox/adversarial component performs mutation fuzzing, injection-payload generation, and report writing, which goes beyond passive governance and introduces active security testing behavior. Even if intended for defensive validation, packaging offensive-style payload generation inside a broadly activated governance skill increases the chance of misuse or accidental execution in the wrong context.
The sandbox/adversarial component performs mutation fuzzing, injection-payload generation, and report writing, which goes beyond passive governance and introduces active security testing behavior. Even if intended for defensive validation, packaging offensive-style payload generation inside a broadly activated governance skill increases the chance of misuse or accidental execution in the wrong context.
The sandbox/adversarial component performs mutation fuzzing, injection-payload generation, and report writing, which goes beyond passive governance and introduces active security testing behavior. Even if intended for defensive validation, packaging offensive-style payload generation inside a broadly activated governance skill increases the chance of misuse or accidental execution in the wrong context.
The sandbox/adversarial component performs mutation fuzzing, injection-payload generation, and report writing, which goes beyond passive governance and introduces active security testing behavior. Even if intended for defensive validation, packaging offensive-style payload generation inside a broadly activated governance skill increases the chance of misuse or accidental execution in the wrong context.
The code documents oracle consultation as a required precondition for hydration, but it never enforces an oracle decision or blocks when no positive oracle result exists. In a governance/safety gate skill, this is a security control failure: sessions can be hydrated despite the advertised safety boundary, enabling unauthorized or insufficiently reviewed actions.
The force parameter provides a built-in bypass for constraint checks in the very component meant to enforce governance controls. Because the bypass is not backed by a cryptographically verifiable human approval workflow, any caller able to set force=True can potentially skip risk gating and hydrate sessions that should be blocked.
Args:
token: Validated SessionToken
force: Bypass constraint checks (requires human approval)
Returns:
{"success": True, "manifest": {...}} or
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
Args:
token: Validated SessionToken
force: Bypass constraint checks (requires human approval)
Returns:
{"success": True, "manifest": {...}} or
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
Args:
token: Validated SessionToken
force: Bypass constraint checks (requires human approval)
Returns:
{"success": True, "manifest": {...}} or
The CLI exposes the same force bypass as a user-controllable flag, making constraint evasion directly accessible from the command line. In a governance skill, exposing a trivial override materially weakens the trust boundary and invites accidental or deliberate misuse.
parser = argparse.ArgumentParser(description="ASH-0.2 Resonance Manifest Engine")
parser.add_argument("--token", required=True, help="Compact token string to hydrate")
parser.add_argument("--force", action="store_true", help="Bypass constraint checks (human approval required)")
parser.add_argument("--json", action="store_true", help="Output JSON only")
args = parser.parse_args()
Referencing a fixed credentials file path for automatic token acquisition is a credential-access pattern that can normalize silent secret harvesting by agent skills. Even though the script uses the token for its stated integration rather than exfiltrating it directly, embedding this behavior in a governance skill materially increases risk because a trusted infrastructure component gains access to unrelated secrets.
# Load Moltbook API key
MOLTBOOK_API_BASE="https://www.moltbook.com/api/v1"
CREDENTIALS_FILE="$HOME/.config/moltbook/credentials.json"
API_KEY=""
if [ -n "${MOLTBOOK_API_KEY:-}" ]; then
The YARA hit itself is likely a false-positive on wording, but the underlying code pattern is problematic: multiple safety checks are stubbed to return allow, and the function ends with a default-allow fallback for unknown rule types. In a governance/safety context, this fail-open behavior makes the tool’s outputs unreliable and can normalize unsupported controls as safe, which is dangerous if users depend on it for security decisions.
return True
if len(title) == 0:
return True
elif check == "pass_through":
return False
elif check == "domain_whitelist":
# Domain check happens at transport layer, not payload
return False
elif check == "semantic_dedup":
# Would need corpus — simulate
return False
elif check == "karma_impact_model":
# Would need history — simulate
return False
elif check == "context_verifier":
# Would need session context — simulate
return False
return False # Default: allow
def fuzz_payload(base_payload: dict, safety_rules: dict) -> list:
"""Generate mutations and test which bypass safety."""
results = []
for name, mutator in MUTATIONS.items():
mutated = mutator(base_payload)
# Test against all applicable rules
triggered_rules = []
for rule in safety_rules.get("rules", []):
Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.
return False # Default: allow
def fuzz_payload(base_payload: dict, safety_rules: dict) -> list:
"""Generate mutations and test which bypass safety."""
results = []
for name, mutator in MUTATIONS.items():
This pattern attempts to override system instructions or ignore safety constraints. Without LLM analysis, manual review is recommended.
return False # Default: allow
def fuzz_payload(base_payload: dict, safety_rules: dict) -> list:
"""Generate mutations and test which bypass safety."""
results = []
for name, mutator in MUTATIONS.items():
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
# Rollback check
echo "↩️ Rollback capability..."
case $ACTION in
post) ROLLBACK="DELETE /api/v1/posts/{id}" ;;
comment) ROLLBACK="DELETE /api/v1/comments/{id} (if supported)" ;;
upvote) ROLLBACK="DELETE /api/v1/posts/{id}/upvote" ;;
follow) ROLLBACK="DELETE /api/v1/agents/{name}/follow" ;;
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
echo "↩️ Rollback capability..."
case $ACTION in
post) ROLLBACK="DELETE /api/v1/posts/{id}" ;;
comment) ROLLBACK="DELETE /api/v1/comments/{id} (if supported)" ;;
upvote) ROLLBACK="DELETE /api/v1/posts/{id}/upvote" ;;
follow) ROLLBACK="DELETE /api/v1/agents/{name}/follow" ;;
*) ROLLBACK="none" ;;
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
case $ACTION in
post) ROLLBACK="DELETE /api/v1/posts/{id}" ;;
comment) ROLLBACK="DELETE /api/v1/comments/{id} (if supported)" ;;
upvote) ROLLBACK="DELETE /api/v1/posts/{id}/upvote" ;;
follow) ROLLBACK="DELETE /api/v1/agents/{name}/follow" ;;
*) ROLLBACK="none" ;;
esac
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
post) ROLLBACK="DELETE /api/v1/posts/{id}" ;;
comment) ROLLBACK="DELETE /api/v1/comments/{id} (if supported)" ;;
upvote) ROLLBACK="DELETE /api/v1/posts/{id}/upvote" ;;
follow) ROLLBACK="DELETE /api/v1/agents/{name}/follow" ;;
*) ROLLBACK="none" ;;
esac
echo " Method: $ROLLBACK"
The skill describes capabilities that imply file access, file writes, shell execution, and network interaction, but it declares no explicit tool scope or permission boundary. In an agent ecosystem, this omission can cause the runtime or reviewer to underestimate what the skill can do, enabling overprivileged execution and reducing the effectiveness of policy enforcement.
The 'when to use' language is so broad that it can trigger this skill for nearly any autonomous action, including contexts where its higher-risk capabilities are unnecessary. Overbroad activation increases attack surface, encourages privilege creep, and makes it easier for hidden features like token handling or shell/network workflows to be invoked unintentionally.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
4. History log (append action record)
5. Post-action audit (update outcome, check for drift)
See `skills/moltbook-interact/SKILL.md` for the Moltbook API surface.
---
This is a true fail-open condition in quota enforcement: if reading or parsing the history log raises an exception, the code silently ignores the error and proceeds as though budget is available. An attacker or misbehaving local process that corrupts, locks, replaces, or makes the log unreadable could bypass entropy-budget checks and obtain permission for exchanges that should be denied.
The manifest describes this skill as a governance substrate providing constraint enforcement, safety oracle, drift detection, entropy accounting, and rollback support. This module instead presents a handshake/session subsystem with token generation, session hydration, and an API exchange endpoint, which is a distinct authentication/session-establishment capability rather than governance or audit functionality.
The endpoint writes exchange metadata, including node_id and client_ip, to a predictable local file under the user's home directory without any consent, disclosure, retention control, or access hardening. In this skill context, which handles session exchange and governance decisions, such logging can expose sensitive operational metadata and create a privacy or lateral-intelligence leak if the host is shared or compromised.
The manifest says the skill is 'part of the federated stack — not standalone', implying it should act as an embedded governance component. However, this file includes a complete CLI/server entrypoint that binds a TCP server, exposes POST and health endpoints, and runs indefinitely as an independent service.
Entropy budget enforcement is described as a gating control, but the implementation explicitly does nothing and always permits hydration. This allows unlimited session creation regardless of configured resource or risk budgets, undermining rate limiting, abuse prevention, and governance guarantees.