Ensure JWT signatures are verified

이 페이지는 아직 한국어로 제공되지 않으며 번역 작업 중입니다. 번역에 관한 질문이나 의견이 있으시면 언제든지 저희에게 연락해 주십시오.

Metadata

ID: python-security/insecure-jwt

Language: Python

Severity: Notice

Category: Security

CWE: 287

Description

Use "verify_signature": False when decoding a JWT bypasses security and may authenticate users that should not be authenticated.

See Also

Non-Compliant Code Examples

import jwt

def insecure_verify(token):
    decoded = jwt.decode(token, verify=False)
    print decoded
    return True
import jwt

jwt.decode(encoded, options={"verify_signature": False})

Compliant Code Examples

import jwt

jwt.decode(encoded, bla={"verify_signature": False})

jwt.decode(encoded, options={"foobar": False})
import jwt

jwt.decode(encoded, options={"verify_signature": True})
jwt.decode(encoded, options={"verify_signature": False})
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis

PREVIEWING: may/add-individual-processors