Skip to content

v0.4.2 - IOC Enrichment & Security Hardening

Latest

Choose a tag to compare

@CooperCyberCoffee CooperCyberCoffee released this 24 Nov 12:10
· 3 commits to main since this release
1a2d5cd

[0.4.2] - 2025-11-24

🎉 Release Highlights

Version 0.4.2 is the IOC Enrichment Expansion Release with unified observable search:

🔍 Multi-Observable Search - One tool to search them all! The search_observable tool now auto-detects and enriches 6 observable types: IPv4, IPv6, domains, URLs, emails, and file hashes (MD5, SHA1, SHA256). No more guessing which tool to use for different IOC types.

User Experience Impact: Simplified workflow - just provide any observable and get instant enrichment with type-specific recommendations.

Backward Compatibility: ✅ Fully backward compatible. All previous search_by_hash functionality preserved within the new search_observable tool.


🔒 Security - Critical CVE Fixes and Hardening

CVE Fixes:

  • CRITICAL: Updated cryptography dependency from 41.0.7 to 43.0.1+ to fix 4 CVEs:
    • PYSEC-2024-225 (HIGH): NULL pointer crash in PKCS12
    • GHSA-3ww4-gg4f-jr7f (HIGH): RSA key exchange vulnerability (TLS decrypt)
    • GHSA-9v9h-cgj8-h64p (MEDIUM): PKCS12 parsing DoS
    • GHSA-h4gh-qq45-vh27 (HIGH): OpenSSL vulnerability
    • Impact: pycti uses TLS for OpenCTI connections - these CVEs posed MITM/DoS risk
    • Action required: Run pip install -r requirements.txt --upgrade after pulling v0.4.2

Security Hardening:

  • Changed default bind address from 0.0.0.0 to 127.0.0.1 (localhost only)
    • Rationale: Secure by default - MCP servers typically run locally
    • Previous behavior: Bandit flagged 0.0.0.0 binding as MEDIUM severity issue
    • Migration: No action needed for standard deployments
    • Network access: Set MCP_SERVER_HOST=0.0.0.0 in .env if needed (advanced use case)
    • Documentation: Added security considerations and best practices to README
    • Configuration: Updated .env.example with security guidance for network binding

Zero-Knowledge TLP Filtering:

  • Fixed TLP marking detection - objectMarking field now properly passed through in search_observable results

    • Root cause: Formatted indicator dict was missing objectMarking field from pycti response
    • Impact: TLP:CLEAR indicators were incorrectly flagged as "no_marking" and filtered out
    • File: src/opencti_mcp/opencti_client.py - Added objectMarking to formatted results
  • Fixed null indicator_types crash - Handle None values in indicator_types field

    • Root cause: Used dict default ['unknown'] which doesn't handle None (only missing keys)
    • Fix: Changed to or ['unknown'] pattern which handles both None and missing keys
    • File: src/opencti_mcp/server.py - _handle_search_observable method
  • Eliminated TLP metadata leakage in search responses - Zero-knowledge principle enforced

    • Before: Filtered results showed "Found in database" with "Matches: 0" (leaked existence)
    • After: Filtered results indistinguishable from genuine "not found"
    • Security principle: If data is filtered, the response reveals nothing about its existence
    • File: src/opencti_mcp/server.py - Removed "TLP Policy Violation" message block
  • Eliminated TLP metadata leakage in strict mode stats (from v0.4.2 pre-release)

    • Before: Stats revealed filtered_objects count even when data was restricted
    • After: Stats return zeros when filtering occurs - no metadata exposure
    • File: src/opencti_mcp/tlp_filter.py - filter_objects method returns empty stats in strict mode

🔍 Added - Multi-Observable Search with Auto-Detection

NEW: Unified observable search supporting 6 indicator types

  • search_observable tool - Replaces search_by_hash_with_context

    • Accepts any observable value (IP, domain, URL, email, or hash)
    • Automatic type detection via regex pattern matching
    • Type-specific enrichment and recommendations
    • No manual type specification required
  • Supported Observable Types:

    • IPv4 addresses - Firewall blocking rules and network defense
    • IPv6 addresses - Comprehensive IPv6 pattern support
    • Domain names - DNS blocking and SIEM integration
    • URLs - Web filtering and proxy configuration
    • Email addresses - Email security gateway rules
    • File hashes - MD5, SHA1, SHA256 with malware context
  • Type-Specific Recommendations:

    • IPv4/IPv6: Firewall rules, IDS/IPS signatures, threat hunting queries
    • Domains: DNS blackhole, SIEM correlation, certificate monitoring
    • URLs: Web proxy blocking, browser protection, incident response
    • Emails: Email gateway rules, phishing analysis, user awareness
    • Hashes: EDR/antivirus updates, file integrity monitoring, sandbox analysis
  • Detection Logic (src/opencti_mcp/utils.py)

    • detect_observable_type() function with comprehensive regex patterns
    • Priority-based detection (most specific to least specific)
    • Validation for each observable type
    • Returns both human-readable type and OpenCTI indicator type

🔧 Changed - Tool Naming and Signatures

Tool renamed for clarity and expanded scope

  • Tool name: search_by_hash_with_contextsearch_observable
  • Parameter: hashvalue (more generic for all observable types)
  • Handler: _handle_search_by_hash()_handle_search_observable()
  • OpenCTI method: search_by_hash()search_observable()

📝 Updated - Tool Descriptions

Documentation reflects expanded capabilities

  • Tool description updated in tools.py
  • README.md examples show all 6 observable types
  • Usage examples demonstrate auto-detection workflow
  • Type-specific mitigation guidance included

⚙️ Technical Details

Implementation Notes:

  • Detection order: URL → Email → IPv6 → IPv4 → Hash → Domain (most to least specific)
  • IPv6 pattern supports all standard notations (full, compressed, leading zeros)
  • Hash detection by length (32=MD5, 40=SHA1, 64=SHA256)
  • OpenCTI indicator type mapping for proper API queries

Performance:

  • Observable type detection: <1ms overhead
  • No performance regression vs hash-only search
  • Same caching and optimization as v0.4.1

Files Modified:

  • src/opencti_mcp/utils.py - Added detect_observable_type() function
  • src/opencti_mcp/tools.py - Renamed tool, updated descriptions
  • src/opencti_mcp/opencti_client.py - Renamed method, added type detection
  • src/opencti_mcp/server.py - Renamed handler, type-specific recommendations

📊 Metrics

  • Observable types supported: 6 (IPv4, IPv6, domain, URL, email, hash)
  • Hash types supported: 3 (MD5, SHA1, SHA256)
  • Backward compatibility: 100% (all hash searches work identically)
  • Code additions: ~150 lines for detection logic and expanded recommendations