UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

40 lines (39 loc) 1.34 kB
rules: - id: insufficient-ec-key-size patterns: - pattern-inside: cryptography.hazmat.primitives.asymmetric.ec.generate_private_key(...) - pattern: cryptography.hazmat.primitives.asymmetric.ec.$SIZE - metavariable-pattern: metavariable: $SIZE pattern-either: - pattern: SECP192R1 - pattern: SECT163K1 - pattern: SECT163R2 - focus-metavariable: $SIZE fix: | SECP256R1 message: >- Detected an insufficient curve size for EC. NIST recommends a key size of 224 or higher. For example, use 'ec.SECP256R1'. metadata: cwe: - 'CWE-326: Inadequate Encryption Strength' owasp: - A03:2017 - Sensitive Data Exposure - A02:2021 - Cryptographic Failures source-rule-url: https://github.com/PyCQA/bandit/blob/b1411bfb43795d3ffd268bef17a839dee954c2b1/bandit/plugins/weak_cryptographic_key.py references: - https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf - https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#elliptic-curves category: security technology: - cryptography subcategory: - audit likelihood: MEDIUM impact: MEDIUM confidence: MEDIUM functional-categories: - crypto::search::key-length::cryptography languages: [python] severity: WARNING