Repository navigation
v4.1.0
Highlights
iOS / Mobile Platform β Full CrustKit SDK for iOS with gomobile bindings, bringing the same 14-step
evaluation pipeline to mobile apps. Includes local reverse proxy, URLProtocol interceptor, async APIs, text
DLP, content scanning, and URL scheme validation.
DNS-based Loopback Detection β New defense-in-depth layer (Step 4) that resolves extracted hostnames via DNS
and blocks custom domains pointing to 127.0.0.0/8 or ::1 that target the crust management API. Catches
attacks that bypass regex and rebinding heuristics. Bounded LRU cache (256 entries, 60s TTL).
31 Bug Fixes β Data race in proxy, streaming bypass, hop-by-hop header leak, DLP ordering, clipboard thread
safety, shell parser crashes, selfprotect regex false positive, and more.
Features
- libcrust β Pure-Go library exposing the rule engine via gomobile for iOS/Android (#81)
- CrustKit Swift SDK β Type-safe Swift wrapper with CrustEngine, CrustURLProtocol, async variants,
Codable/Sendable types (#82, #86) - Mobile local proxy β On-device HTTP reverse proxy for intercepting AI API traffic on iOS
- Text DLP in AI responses β Scan Anthropic, OpenAI, and OpenAI Responses text blocks for leaked secrets;
auto-redact - Content scanning API β scanContent(), scanOutbound(), validateURL(), scanClipboard() for mobile apps
- URL scheme validation β Block dangerous mobile URL schemes (tel:, sms:, facetime:, itms-services:,
app-settings:) - DNS loopback detection β Resolve hostnames and check for loopback IPs using net.LookupNetIP + netip.Addr
comparison (no string matching)
Bug Fixes
- Proxy data race β Snapshot proxy config under lock to prevent race with StopProxy
- Streaming bypass β Force non-streaming upfront for full security evaluation (single request, no wasteful
retry) - Hop-by-hop header leak β Strip hop-by-hop headers from proxy responses per RFC 7230
- Oversized response bypass β Skip interception on >16MB responses to prevent mobile OOM
- Double body close β Eliminate double resp.Body.Close on streaming path
- Google AI misparse β Remove generativelanguage.googleapis.com from default intercepted hosts
- DLP ordering β Run DLP scan before warning message append to avoid scanning our own warnings
- Clipboard thread safety β Fix scanClipboard sync variant for concurrent access
- Shell parser crashes β Pin mvdan.cc/sh/v3 to latest master; remove guards for 2 panics fixed upstream
(${var@Q}, declClause); restore heredoc-in-pipe guard after fuzz found crash (<<0|''\n0) - Selfprotect regex β Fix [:/.\w~] false positive on localhost8080crust (β [:/.~])
- DLP verify β Fix phantom builtin:dlp-turso-token vector β builtin:dlp-jwt-token
- Selfprotect verify β Sync socket regex copy (add UNIX-CLIENT:, UNIX-LISTEN: vectors)
- AST fallback escapes β Fix diacritical mark bypass, upgrade to sh v3.13.0 (#80)
- DLP word boundaries β Add \b anchors to Twilio and Resend API key patterns to reduce false positives
Improvements
- 14-step evaluation pipeline (was 13) β DNS loopback check added as Step 4, all steps renumbered
- Code deduplication β getEngine()/getInterceptor() helpers, dlpRedact(), contentTypeText constant,
CrustEngineTestCase Swift base class - Selfprotect hardening β Iterative URL decoding (catches double/triple %25-encoding), socat
UNIX-CLIENT:/UNIX-LISTEN: patterns - SwiftLint + SwiftFormat pre-commit hooks for iOS code quality
Dependencies