UNPKG

mcp-server-semgrep

Version:

MCP Server for Semgrep Integration - static code analysis with AI

70 lines (69 loc) 1.8 kB
rules: - id: httpclient-http-request message: >- Checks for requests sent via HttpClient to http:// URLS. This is dangerous because the server is attempting to connect to a website that does not encrypt traffic with TLS. Instead, send requests only to https:// URLS. severity: WARNING metadata: likelihood: MEDIUM impact: MEDIUM confidence: MEDIUM category: security cwe: 'CWE-319: Cleartext Transmission of Sensitive Information' owasp: 'A03:2017 - Sensitive Data Exposure' references: - https://openjdk.java.net/groups/net/httpclient/intro.html subcategory: - vuln technology: - java vulnerability: Insecure Transport languages: - java fix-regex: regex: '[Hh][Tt][Tt][Pp]://' replacement: https:// count: 1 pattern-either: - patterns: - pattern: | URI.create("=~/[hH][tT][tT][pP]://.*/", ...) - pattern-inside: | HttpClient $CLIENT = ...; ... HttpRequest $REQ = ...; ... $CLIENT.sendAsync(...); - patterns: - pattern: | URI.create("=~/[hH][tT][tT][pP]://.*/", ...) - pattern-inside: | HttpClient $CLIENT = ...; ... HttpRequest $REQ = ...; ... $CLIENT.send(...); - patterns: - pattern: | URI.create($URI) - pattern-inside: | String $URI = "=~/[hH][tT][tT][pP]://.*/"; ... HttpClient $CLIENT = ...; ... HttpRequest $REQ = ...; ... $CLIENT.send(...); - patterns: - pattern: | URI.create($URI) - pattern-inside: | String $URI = "=~/[hH][tT][tT][pP]://.*/"; ... HttpClient $CLIENT = ...; ... HttpRequest $REQ = ...; ... $CLIENT.sendAsync(...);