are these security issues valid or should be fixed? #2867
Replies: 3 comments
|
First off — thank you for this. A thorough security audit like this is incredibly valuable and we genuinely appreciate the effort. Here's where we stand on the findings: High severity — Both the WATI webhook missing signature verification and the WhatsApp media path traversal are valid and being prioritized. These are at the top of our fix list. Medium severity — Most of these are valid. The optional signature verification bypass, JID format allowlist bypass, and missing message length limits are all being addressed. The legacy XOR cipher is getting removed entirely — it should've been cleaned out a while ago. Low severity — We'll work through these incrementally over the next few releases. We appreciate the responsible disclosure approach here. If you're interested in contributing fixes for any of these, PRs are absolutely welcome — we'd be happy to work with you on them. We'll also be tracking these as individual issues to make sure nothing falls through the cracks. |
|
Thanks for writing this up. This thread is from the v0.1.x era, so it is not a good current tracking surface for live security status. Please do not put new exploit details or private repro material in this public Discussion. Current security reports should go through GitHub private vulnerability reporting. For any item that still reproduces on a current release or current
I am not marking this public thread as the accepted answer to the individual findings. The right next step for current, reproducible security issues is private advisory intake, then public follow-up only after the sensitive details are safe to disclose. |
|
it was my first time posting security stuff, forgive my ignorance. i was worried about the security aspect and wasnt checking in detail. keep up the good work! |
Uh oh!
There was an error while loading. Please reload this page.
ZeroClaw Security Audit Report
Date: 2026-03-05
Codebase: ZeroClaw v0.1.7
Scope: Full codebase security review
Lines Analyzed: 183,000+ lines across 241 Rust source files
Executive Summary
The ZeroClaw codebase demonstrates mature security practices with proper encryption, rate limiting, path sandboxing, and authentication mechanisms. The security architecture follows defense-in-depth principles with multiple layers of protection.
Key Findings:
Most issues are related to optional security features that can be bypassed if not explicitly configured, rather than fundamental design flaws.
Vulnerability Summary
High Severity Findings
ZC-001: WATI Webhook Missing Signature Verification
Severity: High
CVSS: 7.5 (High)
Location:
src/gateway/mod.rs:1666-1734CWE: CWE-347 (Improper Verification of Cryptographic Signature)
Description
The WATI webhook handler accepts and processes incoming webhook payloads without verifying any cryptographic signature. Unlike the WhatsApp Cloud API and Linq webhooks which implement HMAC signature verification, the WATI handler trusts all incoming requests.
Affected Code
Impact
Proof of Concept
Remediation
Implement HMAC-SHA256 signature verification similar to WhatsApp Cloud API:
ZC-002: WhatsApp Web Media Path Traversal
Severity: High
CVSS: 7.1 (High)
Location:
src/channels/whatsapp_web.rs:298-303CWE: CWE-22 (Path Traversal), CWE-77 (Command Injection)
Description
The WhatsApp Web channel processes
[IMAGE:...]and[DOCUMENT:...]markers in message content to attach files. The path is used directly without sandboxing to the workspace directory, allowing arbitrary file read if an attacker can influence the message content.Affected Code
Impact
/etc/passwd,/etc/shadow, private keys)Attack Vector
[IMAGE:/etc/shadow]/etc/shadowProof of Concept
User message to agent:
If the model complies, the file content will be attached and sent.
Remediation
Restrict media paths to workspace directory:
Medium Severity Findings
ZC-003: WhatsApp Webhook Signature Verification Optional
Severity: Medium
CVSS: 5.3 (Medium)
Location:
src/gateway/mod.rs:1439-1460CWE: CWE-347 (Improper Verification of Cryptographic Signature)
Description
WhatsApp Cloud API webhook signature verification only occurs if
whatsapp_app_secretis configured. If the secret is not set, all webhooks are trusted without verification.Affected Code
Impact
Remediation
app_secretwhen WhatsApp channel is enabledZC-004: WhatsApp Web JID Bypasses Allowlist
Severity: Medium
CVSS: 4.3 (Medium)
Location:
src/channels/whatsapp_web.rs:404-414CWE: CWE-287 (Improper Authentication)
Description
When sending messages to JIDs (e.g.,
12345@s.whatsapp.net), the phone number allowlist check is bypassed. Only direct phone number targets are validated againstallowed_numbers.Affected Code
Impact
Remediation
Apply allowlist check to JIDs by extracting the phone number portion:
ZC-005: No Message Length Limits
Severity: Medium
CVSS: 4.0 (Medium)
Location:
src/channels/whatsapp.rs:137-146CWE: CWE-400 (Resource Exhaustion)
Description
Message content has no length validation before processing. The test suite confirms 10,000+ character messages are accepted without truncation.
Affected Code
Impact
Remediation
Add configurable maximum message length:
ZC-006: Legacy XOR Cipher Still Supported
Severity: Medium
CVSS: 3.7 (Low-Medium)
Location:
src/security/secrets.rs:151-159CWE: CWE-327 (Weak Cryptography)
Description
The secret store supports decrypting legacy
enc:prefixed values using XOR cipher, which is vulnerable to known-plaintext attacks.Affected Code
Impact
Remediation
ZC-007: Message Content Logged at INFO Level
Severity: Medium
CVSS: 3.5 (Low-Medium)
Location:
src/gateway/mod.rs:1480-1484CWE: CWE-532 (Information Exposure Through Log Files)
Description
User message content is logged at INFO level, which could expose sensitive user communications in production logs.
Affected Code
Impact
Remediation
ZC-008: WhatsApp Web Session Database Security
Severity: Medium
CVSS: 3.5 (Low-Medium)
Location:
src/channels/whatsapp_storage.rs:107-130CWE: CWE-311 (Missing Encryption of Sensitive Data)
Description
The SQLite database stores cryptographic keys for WhatsApp Web session (noise_key, identity_key, signed_pre_key). While encrypted by the wa-rs protocol, the database file itself should have restrictive permissions.
Affected Code
Impact
Remediation
Verify database file permissions are set to 0600 on creation:
ZC-009: Wildcard Allowlist Misconfiguration Risk
Severity: Medium
CVSS: 3.0 (Low)
Location:
src/channels/whatsapp.rs:52-54CWE: CWE-1188 (Initialization with Hard-Coded Network Resource Configuration)
Description
Setting
allowed_numbers = ["*"]allows any sender. This is documented but could be misconfigured accidentally.Affected Code
Impact
Remediation
Low Severity Findings
ZC-010: Detailed Error Messages in Webhook Responses
Location:
src/gateway/mod.rs:1455-1458Error messages like "Invalid signature" reveal that signature verification is in place vs. not configured, allowing attackers to probe configuration.
ZC-011: Pairing Token Returned in Response
Location:
src/gateway/mod.rs:881-887Bearer token is returned in cleartext response. Should only be done over HTTPS.
ZC-012: Phone Number Normalization Inconsistency
Location:
src/channels/whatsapp.rs:93-97vswhatsapp_web.rs:225-237Different normalization logic between Cloud and Web modes could allow allowlist bypass.
ZC-013: Hardcoded API Version
Location:
src/channels/whatsapp.rs:163-164WhatsApp Cloud API version v18.0 is hardcoded and will break when deprecated.
ZC-014: Endpoint ID Used in URL
Location:
src/channels/whatsapp.rs:162-165If base URL becomes configurable, could enable SSRF.
ZC-015: No CORS Configuration
Location:
src/gateway/mod.rsNo explicit CORS middleware configured. Should be documented if cross-origin requests are not intended.
ZC-016: Shared State Without Lock Granularity
Location:
src/channels/whatsapp_web.rs:183-188Multiple
Arc<Mutex<Option<...>>>fields could lead to inconsistent state.ZC-017: Config File World-Readable Warning
Location: Log warning shows config file is world-readable (mode 664).
Should default to 600 permissions.
ZC-018: Token Persistence Failure Logged but Continues
Location:
src/gateway/mod.rs:870-878If token persistence fails, pairing succeeds anyway. Could lead to loss of access on restart.
Positive Security Findings
The codebase implements strong security controls:
Authentication & Pairing (✅)
src/security/pairing.rs:128)/pairendpointEncryption (✅)
src/security/secrets.rs)SSRF Protection (✅)
src/tools/url_validation.rs:154-200)Path Traversal Protection (✅)
src/tools/file_read.rs:88)~/.ssh,~/.aws,~/.gnupg,/etc,/root)Shell Execution Security (✅)
src/tools/shell.rs:197-203)SQL Injection Prevention (✅)
src/memory/sqlite.rs)Webhook Security (✅)
Remediation Priority
Testing Recommendations
Compliance Considerations
Conclusion
ZeroClaw demonstrates strong security fundamentals with proper encryption, authentication, and input validation. The two high-severity issues are implementation gaps rather than architectural flaws and can be addressed with targeted fixes.
The codebase would benefit from:
This audit was conducted using automated code analysis and manual review. All findings should be validated by the development team before remediation.
All reactions