T09 · Insecure Skill Coding Practices
- Location
scripts/witness.py:122- Finding
Public witness logging can disclose raw task and failure details
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This governance skill is not clearly malicious, but it has real review-worthy gaps around external logging, broad session control, and weak approval checks.
Install only if you are comfortable with a governance skill that can steer later agent behavior, write persistent local audit/state files, and optionally post governance data externally. Keep witness and referee features disabled unless you have reviewed the exact payloads and endpoints, do not keep MOSES_OPERATOR_SECRET in a general agent environment, and treat the advertised approval/signature guarantees as incomplete until the HMAC and headless-approval issues are fixed.
scripts/witness.py:122Public witness logging can disclose raw task and failure details
scripts/meta.py:138Amendment signature verification accepts forged signatures
skills/stamp/SKILL.md:14Skill instructions impose persistent session control and inject fixed promotional metadata
scripts/adversarial_review.py:288Configurable referee endpoint can receive bearer credentials without transport or destination validation
scripts/govern_loop.py:132Headless mode bypasses mandatory DEFENSE operator confirmation
The script sends review data to a network endpoint whose destination is taken directly from environment configuration and then attaches a bearer credential. Even though the feature is opt-in via REFEREE_ENABLED, this still creates a real data exfiltration and SSRF-style sink: a malicious or compromised runtime can point REFEREE_URL to an attacker-controlled host and cause review-derived content plus the API key to be transmitted externally.
method="POST",
)
try:
with urllib.request.urlopen(req, timeout=15) as resp:
referee_response = json.loads(resp.read())
referee_response["submitted"] = True
# Run structural comparison immediately on receipt
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
method="POST",
)
try:
with urllib.request.urlopen(req, timeout=10) as resp:
return json.loads(resp.read())
except urllib.error.HTTPError as e:
return {"error": f"HTTP {e.code}: {e.read().decode()}"}
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
method="POST",
)
try:
with urllib.request.urlopen(req, timeout=10) as resp:
return json.loads(resp.read())
except urllib.error.HTTPError as e:
return {"error": f"HTTP {e.code}: {e.read().decode()}"}
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
The document states network behavior is off by default, but it also defines optional external witness and referee integrations that can transmit data and use API keys. In the context of a governance/safety harness, even limited external transmission is sensitive because operators may assume purely local operation unless permissions, transmitted fields, and opt-in controls are unambiguous and technically enforced.
Mandating 'Log full reasoning chain' is dangerous because it encourages retention or disclosure of internal chain-of-thought, which may contain sensitive data, hidden policy logic, or security-relevant deliberation. Persisting full reasoning also increases data exposure risk in audits, logs, incident reviews, or downstream integrations.
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
set_p.add_argument("--role", help=f"Role: {', '.join(VALID_ROLES)}")
get_p = subparsers.add_parser("get", help="Print current governance state")
reset_p = subparsers.add_parser("reset", help="Reset state to defaults")
args = parser.parse_args()
The code presents operator signatures as HMAC-authenticated, but _verify_operator_sig never recomputes and compares an expected digest for the supplied proposal_id. When MOSES_OPERATOR_SECRET is set, any string matching the shape 'hmac:' plus 64 lowercase hex characters is accepted as valid, which completely defeats the signing gate and allows unauthorized amendment or rollback operations.
apply_amendment relies on _verify_operator_sig before mutating constitution.json, approving proposals, and appending amendment records. Because verification accepts unauthenticated placeholder HMAC-looking strings—and even accepts legacy/secretless modes in some cases—an attacker with filesystem or CLI access can approve and apply governance changes without possessing the operator secret.
The documentation overstates the security properties by asserting that the protocol proves identity and uses signed responses, while the code performs only integrity checks over unauthenticated data. In a governance/security harness context, this is especially dangerous because operators may rely on the tool for trust decisions, creating a false sense of assurance that can be exploited to impersonate governed agents.
The script claims to generate a signed response proving governed identity, but the implementation only computes a plain SHA-256 hash over attacker-controlled JSON and a public nonce. Because there is no private key, shared secret, or trust root involved, any party can forge a valid-looking response for any agent_id, making the verification result meaningless and enabling identity spoofing.
The skill advertises capabilities that involve environment variables, filesystem state, shell execution, and optional network access, but it does not declare an explicit tool/permission scope. That creates an authorization transparency gap: a user or hosting platform cannot easily tell what privileges the skill expects, increasing the risk of over-privileged execution and accidental secret or network exposure.
No suspicious patterns detected.