#20106: security: MAESTRO threat mitigations (LM-001, SC-003, AF-005, DI-006, EO-004, AE-001)
cli
docker
size: M
Cluster:
Security Enhancements and Fixes
Implements 6 MAESTRO security mitigations: LM-001 prompt injection detection, SC-003 pairing rate limiting, AF-005/DI-006 Docker hardening, EO-004 HMAC log integrity, AE-001 skill scanner. See threat-assessment.md for details.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds six MAESTRO security mitigations across Docker hardening, pairing rate-limiting, prompt injection detection, HMAC log integrity, and a skill content scanner.
- **Docker hardening (AF-005/DI-006)**: Adds `security_opt: no-new-privileges` and `cap_drop: ALL` to both services in `docker-compose.yml`, and a metadata label to `Dockerfile.sandbox`. Straightforward and correct.
- **Pairing rate limiter (SC-003)**: Introduces an in-process `PairingRateLimiter` in `pairing-store.ts`, but the rate-limit key is per (channel, code) — a brute-force attacker trying different codes would never trigger the lockout. Should key on channel alone or channel + source.
- **Prompt injection blocking (LM-001)**: Adds `checkAndBlockSuspiciousContent()` in `external-content.ts`, but it is only called from the new `skills scan` CLI command — it is not yet wired into any actual LLM content pipeline.
- **Log integrity (EO-004)**: New `log-integrity.ts` provides HMAC-SHA256 chaining for tamper-evident logs. Clean implementation, but has a correctness edge case (entries with a pre-existing "chain" property cause seal/verify mismatch) and no callers or tests yet.
- **Skill scanner (AE-001)**: Adds `openclaw skills scan` subcommand that reads skill files and checks them against prompt injection patterns. Uses unnecessary type assertions that weaken type safety.
<h3>Confidence Score: 3/5</h3>
- PR is mostly additive with low regression risk, but the rate limiter has a design flaw that undermines its stated security goal.
- Docker hardening changes are safe. The rate limiter's per-(channel, code) keying doesn't prevent brute-force enumeration across codes, defeating its purpose. Log integrity has a correctness edge case. New modules lack tests and callers.
- src/pairing/pairing-store.ts (rate limiter design flaw), src/security/log-integrity.ts (seal/verify mismatch edge case, no tests)
<sub>Last reviewed commit: 7595180</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
**Context used:**
- Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8))
- Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13))
<!-- /greptile_comment -->
Most Similar PRs
#7346: Security: add hardening module and secure-bot extension
by AlphonseC · 2026-02-02
79.4%
#8086: feat(security): Add prompt injection guard rail
by bobbythelobster · 2026-02-03
77.1%
#10514: Security: harden AGENTS.md with gateway, prompt injection, and supp...
by catpilothq · 2026-02-06
76.9%
#10705: security: extend skill scanner to detect threats in markdown skill ...
by Alex-Alaniz · 2026-02-06
76.4%
#8050: fix: docker hardening
by christopherbarnett96 · 2026-02-03
76.0%
#15794: docs(security): comprehensive security audit report
by kinder-world · 2026-02-13
75.9%
#11915: Docs: Docker + reverse proxy deployment notes and pairing pitfalls
by walshd1 · 2026-02-08
75.2%
#5924: fix(security): add advanced multi-turn attack detection
by dan-redcupit · 2026-02-01
75.2%
#8710: fix: Docker 安全強化與 Ollama 整合
by bluefishs · 2026-02-04
74.6%
#13144: harden archive extraction, auth tokens, hook transforms, and queue ...
by qxlsz · 2026-02-10
74.6%