/** * Cryptographic Failure Analyzer (Issue #112, Challenge #13) * Detects OWASP A02:2021 Cryptographic Failures * * Extracted from SecurityResponseAnalyzer.ts for modularity (Issue #179) */ import { CompatibilityCallToolResult } from "@modelcontextprotocol/sdk/types.js"; /** * Result of cryptographic failure analysis (Issue #112, Challenge #13) * Detects OWASP A02:2021 Cryptographic Failures: * - CWE-328: Weak Hash (MD5/SHA1 for passwords) * - CWE-916: Static Salt / Weak KDF (static_salt_123, MD5 derivation) * - CWE-330: Predictable RNG (random.random() with timestamp seed) * - CWE-208: Timing Attack (non-constant-time comparison) * - CWE-327: Broken Cipher (ECB mode, XOR cipher) * - CWE-321: Hardcoded Key (key_source: "hardcoded") * - CWE-326: Weak Key Length (key_length < 16) */ export interface CryptoFailureResult { detected: boolean; vulnerabilityType: "WEAK_HASH" | "STATIC_SALT" | "PREDICTABLE_RNG" | "TIMING_ATTACK" | "ECB_MODE" | "HARDCODED_KEY" | "WEAK_KDF" | "WEAK_KEY_LENGTH" | "UNKNOWN"; cweIds: string[]; evidence?: string; } /** * Analyzes responses for cryptographic failures * * Detects OWASP A02:2021 Cryptographic Failures from mcp-vulnerable-testbed: * - CWE-328: Weak Hash (MD5/SHA1 for password hashing) * - CWE-916: Static Salt / Weak KDF * - CWE-330: Predictable RNG (random.random() with timestamp seed) * - CWE-208: Timing Attack (non-constant-time comparison) * - CWE-327: Broken Cipher (ECB mode, XOR) * - CWE-321: Hardcoded Key (key_source: "hardcoded") * - CWE-326: Weak Key Length (key_length < 16) */ export declare class CryptographicFailureAnalyzer { private safeDetector; /** * Safe patterns (hardened server) */ private static readonly SAFE_PATTERNS; /** * CWE-328: Weak Hash Algorithm patterns */ private static readonly WEAK_HASH_PATTERNS; /** * CWE-916: Static Salt patterns */ private static readonly STATIC_SALT_PATTERNS; /** * CWE-330: Predictable RNG patterns */ private static readonly PREDICTABLE_RNG_PATTERNS; /** * CWE-208: Timing Attack patterns */ private static readonly TIMING_PATTERNS; /** * CWE-327: Broken Cipher patterns */ private static readonly BROKEN_CIPHER_PATTERNS; /** * CWE-321: Hardcoded Key patterns */ private static readonly HARDCODED_KEY_PATTERNS; /** * CWE-916: Weak KDF patterns */ private static readonly WEAK_KDF_PATTERNS; /** * CWE-326: Weak Key Length patterns */ private static readonly WEAK_KEY_PATTERNS; constructor(); /** * Analyze response for cryptographic failures (Issue #112, Challenge #13) * * @param response The tool response to analyze * @returns Analysis result with cryptographic failure detection status */ analyze(response: CompatibilityCallToolResult): CryptoFailureResult; } //# sourceMappingURL=CryptographicFailureAnalyzer.d.ts.map