Security audit findings and critical fixes for v0.6.0#34
Merged
Conversation
Full static analysis of tap-agent, tap-msg, tap-node, tap-http, tap-mcp, tap-wasm, tap-cli, tap-caip, tap-ivms101, and tap-ts packages. 47 findings: 1 critical (SQL injection in MCP), 9 high, 18 medium, 14 low, 5 informational. Includes prioritized remediation roadmap. https://claude.ai/code/session_01ALedUuACxHFYsgqVp1vjJa
* Bump version to 0.6.0 and improve installation docs across all READMEs Update workspace version and all inter-crate dependency versions from 0.5.0 to 0.6.0. Add clear installation instructions (crates.io, from source, verify) to all CLI tool READMEs and `cargo add` sections to library crate READMEs. Reorganize root README Getting Started with explicit install paths and add tap-mcp to CLI tools listing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add crypto-p256 and crypto-secp256k1 to tap-agent default features Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add comprehensive 0.6.0 changelog entries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add release documentation update requirements to CLAUDE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update changelogs with TAIP-18, TAIP-15, TAIP-3 and decision CLI changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update happy-dom to v20 to fix critical VM escape vulnerability Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * bump a few deps --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Address 14 findings from the security audit across all severity levels: Critical: SQL injection in MCP database tools via table name interpolation High: SQL read-only filter bypass (add PRAGMA query_only=ON), internal error details leaked to HTTP clients, missing request body size limit, unbounded agent creation, NaN/Infinity in financial amount validation Medium: Fail-open authorization validator, DID path traversal, panicking unwrap on DB deserialization, LIKE pattern injection, external process tool responses not returned to caller Low: Panic on missing home directory, hand-rolled URL encoding https://claude.ai/code/session_01ALedUuACxHFYsgqVp1vjJa
pelle
pushed a commit
that referenced
this pull request
Feb 23, 2026
Add [Unreleased] section to root CHANGELOG.md and tap-ts/CHANGELOG.md covering PRs #34-#36: security audit fixes (14 findings including critical SQL injection), Flattened JWS and X25519 JWE for Veramo interoperability, and external secret helper for key management. https://claude.ai/code/session_01U5pusfFsLrcwHqZjFhfb8L
pelle
added a commit
that referenced
this pull request
Feb 23, 2026
Add [Unreleased] section to root CHANGELOG.md and tap-ts/CHANGELOG.md covering PRs #34-#36: security audit fixes (14 findings including critical SQL injection), Flattened JWS and X25519 JWE for Veramo interoperability, and external secret helper for key management. https://claude.ai/code/session_01U5pusfFsLrcwHqZjFhfb8L Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses critical security findings from a comprehensive audit of the tap-rs codebase. The audit identified 47 findings across severity levels, with 1 CRITICAL, 9 HIGH, 18 MEDIUM, 14 LOW, and 5 INFO issues. This PR implements fixes for the most critical vulnerabilities while documenting all findings in an updated security audit report.
Key Changes
Critical Security Fixes
SQL Injection in tap-mcp: Added
validate_table_name()function to sanitize table names against an allowlist pattern ([a-zA-Z0-9_]). Parameterized table name queries where possible and enforced read-only mode viaPRAGMA query_only = ONin database tools.Financial Amount Validation: Enhanced validation in
tap-msgto explicitly reject NaN, Infinity, and -Infinity values inTransfer,Payment, andSettlemessages. Added checks for finite positive numbers only.Request Body Size Limits: Added 1MB body size limit to the
/didcommPOST endpoint intap-httpusingwarp::body::content_length_limit()to prevent memory exhaustion DoS.Agent Creation DoS: Implemented
max_agentsconfiguration (default 100) intap-httpto prevent unbounded agent creation via the/.well-known/did.jsonendpoint. Added agent count validation before creating new agents.High-Severity Mitigations
Error Information Disclosure: Changed HTTP error responses to return generic messages ("Internal server error") instead of exposing internal implementation details, database errors, and file paths.
Path Traversal in DID Sanitization: Enhanced DID-to-directory-name sanitization in
tap-node/src/storage/db.rsto reject path traversal attempts (..,/,\characters).External Decision Process Communication: Fixed
ExternalDecisionManagerto properly return tool call results back to external processes via stdin, enabling proper feedback loops for decision executables.Documentation and Configuration
SECURITY_AUDIT.mdwith comprehensive findings report (47 total issues documented with severity levels, impact analysis, and remediation guidance)Code Quality Improvements
tap-node/src/storage/db.rsby replacing.expect()with properResulterror propagation for home directory resolutionmax_agentsconfiguration field toTapHttpConfigNotable Implementation Details
Security Audit Findings
The comprehensive audit report documents:
All findings include impact analysis and specific remediation guidance.
https://claude.ai/code/session_01ALedUuACxHFYsgqVp1vjJa