T09 · Insecure Skill Coding Practices
- Location
services/invariance.py:60- Finding
Unauthenticated Remote Evaluation of Attacker-Controlled Python Expressions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a runnable microservice stack, but it exposes unauthenticated network APIs including client-controlled Python evaluation and broad mutable event/state endpoints.
Install only in an isolated development environment unless you first add authentication, bind backend ports to localhost or an internal Docker network, remove or replace the eval-based invariant engine, add input limits/rate limits, and review the Terraform targets. Do not expose these ports to a shared or public network as provided.
services/invariance.py:60Unauthenticated Remote Evaluation of Attacker-Controlled Python Expressions
services/gateway.py:35Unauthenticated Gateway and Direct Publication of Privileged Backend APIs
services/daw_agent.py:80Unbounded BPM Input Allows Remote CPU and Memory Exhaustion
services/machine_voice.py:73Unbounded Voice Sessions and Formant Parameters Permit Memory Exhaustion
services/event_spine.py:110Event Spine Allows Unauthenticated Event Injection and Record Disclosure
services/Dockerfile:1Unpinned Build Dependencies and Root Container Execution
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
status:
@echo "═══ EVEZ-OS FULL STATUS ═══"
@curl -sf http://localhost:9117/status 2>/dev/null | python3 -m json.tool || echo "Mesh health not available"
@echo ""
@curl -sf http://localhost:9116/status 2>/dev/null | python3 -m json.tool || echo "Event spine not available"
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@echo "═══ EVEZ-OS FULL STATUS ═══"
@curl -sf http://localhost:9117/status 2>/dev/null | python3 -m json.tool || echo "Mesh health not available"
@echo ""
@curl -sf http://localhost:9116/status 2>/dev/null | python3 -m json.tool || echo "Event spine not available"
# Individual service control
consciousness:
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
# Individual service control
consciousness:
@curl -sf http://localhost:9111/state | python3 -m json.tool
dream:
@curl -sf -X POST http://localhost:9111/dream | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf http://localhost:9111/state | python3 -m json.tool
dream:
@curl -sf -X POST http://localhost:9111/dream | python3 -m json.tool
synthesize:
@curl -sf -X POST "http://localhost:9112/synthesize?bpm=170&style=breakcore" | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf -X POST http://localhost:9111/dream | python3 -m json.tool
synthesize:
@curl -sf -X POST "http://localhost:9112/synthesize?bpm=170&style=breakcore" | python3 -m json.tool
voice-transform:
@curl -sf -X POST "http://localhost:9113/transform?stage=5" | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf -X POST "http://localhost:9112/synthesize?bpm=170&style=breakcore" | python3 -m json.tool
voice-transform:
@curl -sf -X POST "http://localhost:9113/transform?stage=5" | python3 -m json.tool
correlate:
@curl -sf -X POST "http://localhost:9114/correlate" -H "Content-Type: application/json" -d '{"domain_a":"physics","domain_b":"economics"}' | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf -X POST "http://localhost:9113/transform?stage=5" | python3 -m json.tool
correlate:
@curl -sf -X POST "http://localhost:9114/correlate" -H "Content-Type: application/json" -d '{"domain_a":"physics","domain_b":"economics"}' | python3 -m json.tool
falsify:
@curl -sf -X POST "http://localhost:9115/falsify" | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf -X POST "http://localhost:9114/correlate" -H "Content-Type: application/json" -d '{"domain_a":"physics","domain_b":"economics"}' | python3 -m json.tool
falsify:
@curl -sf -X POST "http://localhost:9115/falsify" | python3 -m json.tool
spine:
@curl -sf http://localhost:9116/status | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf -X POST "http://localhost:9115/falsify" | python3 -m json.tool
spine:
@curl -sf http://localhost:9116/status | python3 -m json.tool
replay:
@curl -sf "http://localhost:9116/replay?domain=consciousness" | python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
@curl -sf http://localhost:9116/status | python3 -m json.tool
replay:
@curl -sf "http://localhost:9116/replay?domain=consciousness" | python3 -m json.tool
# RQNS pipeline
rqns:
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).
$(eval NAME=$(word 1,$(subst :, ,$(svc)))) \
if [ -f $(PIDS_DIR)/$(NAME).pid ]; then \
kill `cat $(PIDS_DIR)/$(NAME).pid` 2>/dev/null && echo " Stopped $(NAME)" || true; \
rm -f $(PIDS_DIR)/$(NAME).pid; \
fi; \
)
@echo "Mesh stopped."
This is a true code-execution risk. Although the eval environment tries to restrict builtins, untrusted Python expressions are still being executed from the /assert API, which is attacker-controlled input; Python sandboxing via eval is brittle and can often be escaped or abused for denial of service through expensive expressions. In this service context, invariant expressions are a core feature, so the dangerous part is that arbitrary clients can submit executable expressions that are later run against service state.
"None": None, "round": round,
}}
safe_globals["state"] = state
result = eval(expression, safe_globals, {})
return bool(result), None
except Exception as e:
return False, str(e)
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
@curl -sf -X POST "http://localhost:9113/transform?stage=5" | python3 -m json.tool
correlate:
@curl -sf -X POST "http://localhost:9114/correlate" -H "Content-Type: application/json" -d '{"domain_a":"physics","domain_b":"economics"}' | python3 -m json.tool
falsify:
@curl -sf -X POST "http://localhost:9115/falsify" | python3 -m json.tool
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Security
audit:
@echo "═══ SECURITY AUDIT ═══"
@sudo fail2ban-client status sshd 2>/dev/null | head -5
@sudo ufw status | head -10
@echo "Open ports:"
@ss -tlnp | grep LISTEN | awk '{print " " $$4}'
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Security
audit:
@echo "═══ SECURITY AUDIT ═══"
@sudo fail2ban-client status sshd 2>/dev/null | head -5
@sudo ufw status | head -10
@echo "Open ports:"
@ss -tlnp | grep LISTEN | awk '{print " " $$4}'
The terraform-destroy target invokes infrastructure teardown with -auto-approve, allowing irreversible destruction to proceed without any interactive confirmation or guardrail. In a Makefile intended for convenient operator use, this increases the chance of accidental or scripted misuse leading to loss of cloud resources, downtime, and possible data destruction.
Using terraform destroy -auto-approve enables autonomous destructive execution with no human verification at the point of action. If triggered unintentionally, by automation, or by a compromised workflow, it can rapidly delete infrastructure and associated stateful resources.
@cd terraform && terraform apply evez-firmament.tfplan
terraform-destroy:
@cd terraform && terraform destroy -auto-approve
requests.post(SPINE_URL, json=...) transmits internal state and request-derived data to another service, creating an external communication path from this component. Even though the destination is localhost, this is still a separate trust boundary; if the receiving service is compromised, misconfigured, or persists logs insecurely, user data and internal state can be exposed.
def spine_log(domain, action, data):
try:
requests.post(SPINE_URL, json={
"domain": domain,
"action": action,
"data": data,
The service forwards runtime data to another local service via spine_log, and that data includes content derived from incoming requests, such as the /pipeline input and /system/SENSE body. There is no consent, minimization, sanitization, or disclosure mechanism, so sensitive user-supplied data may be propagated beyond the original service boundary and exposed to additional logging, retention, or compromise risks.
The service automatically transmits observation and hypothesis metadata to another local HTTP service without any user-facing disclosure, consent, or configuration gate. Even though the destination is localhost, the transmitted data may still contain sensitive operational or user-supplied content, and silent forwarding increases privacy and data-governance risk in multi-service environments.
The code sends structured runtime data to an external service via HTTP using requests.post, with no authentication, encryption, validation of the receiver, or restriction on what may be included in the payload. In this skill context, observations and hypothesis results are derived from inbound request bodies, so untrusted client-supplied data can be exfiltrated or exposed to any local process able to intercept or impersonate the logging endpoint.
def spine_log(domain, action, data):
try:
requests.post(SPINE_URL, json={"domain": domain, "action": action, "data": data, "timestamp": time.time()}, timeout=2)
except Exception:
pass
The agent transmits request-derived parameters to another local HTTP service via spine_log without any user disclosure, consent mechanism, or configuration to disable telemetry. Even though the payload appears limited to music-generation parameters and targets localhost, it still creates an undisclosed data flow that can expose user activity or become sensitive if the receiving service forwards, stores, or correlates requests.
The code performs an outbound HTTP POST to http://localhost:9116/append containing request context, creating an external transmission path from the service to another process. While localhost limits remote exfiltration, this is still a true data-transmission behavior and can leak usage data to any local service bound to that port, especially on shared hosts or if the downstream service is compromised.
def spine_log(domain, action, data):
try:
requests.post(SPINE_URL, json={"domain": domain, "action": action, "data": data, "timestamp": time.time()}, timeout=2)
except Exception:
pass
The service exposes append, project, replay, status, verify, and recent-event endpoints over plain HTTP on 0.0.0.0:9116 with no authentication, authorization, or transport protection. If event data contains sensitive operational or user information, any reachable party on the network can read it in transit or query stored records directly, making unintended disclosure likely.
The gateway advertises authentication, rate limiting, and event logging, but the implementation exposes unauthenticated proxy routes with permissive CORS and no throttling or audit trail. This is dangerous because operators or downstream users may rely on stated protections that do not actually exist, leaving internal microservices directly reachable through a public entry point and making abuse or incident response much harder.