rules:
- id: jwt-python-exposed-data
  message: >-
    The object is passed strictly to jwt.encode(...)
    Make sure that sensitive information is not exposed through JWT token payload.
  severity: WARNING
  metadata:
    owasp: 'A3: Sensitive Data Exposure'
    cwe: 'CWE-522: Insufficiently Protected Credentials'
    source-rule-url: https://r2c.dev/blog/2020/hardcoded-secrets-unverified-tokens-and-other-common-jwt-mistakes/
    category: security
    technology:
    - jwt
  languages: [python]
  patterns:
  - pattern-inside: |
      def $FUNC(...,$INPUT,...):
        ...
  - pattern: |-
      jwt.encode($INPUT,...)
