Do not put sensitive data in objects

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください。

Metadata

ID: javascript-node-security/jwt-sensitive-data

Language: JavaScript

Severity: Warning

Category: Security

CWE: 312

Description

Never include sensitive information in a JWT. Instead, only use non-personal information to identify the end-user.

Non-Compliant Code Examples

jwt.sign(
    {user: { email: 'foo@bar.com'}}
)

jwt.sign(
    {user: { lastname: 'babar'}}
)

Compliant Code Examples

jwt.sign(
    {user: { id: 42}}
)
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: rtrieu/product-analytics-ui-changes