mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
35 lines (34 loc) • 914 B
YAML
rules:
- id: ruby-jwt-exposed-credentials
languages:
- ruby
metadata:
cwe:
- 'CWE-522: Insufficiently Protected Credentials'
owasp:
- A02:2017 - Broken Authentication
- A04:2021 - Insecure Design
source-rule-url: https://semgrep.dev/blog/2020/hardcoded-secrets-unverified-tokens-and-other-common-jwt-mistakes/
references:
- https://cwe.mitre.org/data/definitions/522.html
category: security
technology:
- jwt
cwe2021-top25: true
subcategory:
- audit
likelihood: LOW
impact: LOW
confidence: LOW
message: >-
Password is exposed through JWT token payload. This is not encrypted and
the password could be compromised. Do not store passwords in JWT tokens.
patterns:
- pattern-inside: |
require 'jwt'
...
- pattern: |
$PAYLOAD = {...,password:...,...}
...
JWT.encode($PAYLOAD,...)
severity: ERROR