python.django-secure-set-cookie

返回列表 · CWE 索引

pythonWARNING规则详情

各语言消息对照

语言消息
de

Django-Cookies sollten sicher behandelt werden, indem in response.set_cookie(...) secure=True, httponly=True und samesite='Lax' gesetzt werden. Verlangt Ihre Situation andere Einstellungen, deaktivieren Sie diese ausdrücklich. Soll das Cookie über HTTP gesendet werden, setzen Sie secure=False. Soll clientseitiges JavaScript das Cookie lesen können, setzen Sie httponly=False. Sollen Cookies an Anfragen an externe Sites angehängt werden, setzen Sie samesite=None.

en

Django cookies should be handled securely by setting secure=True, httponly=True, and samesite='Lax' in response.set_cookie(...). If your situation calls for different settings, explicitly disable the setting. If you want to send the cookie over http, set secure=False. If you want to let client-side JavaScript read the cookie, set httponly=False. If you want to attach cookies to requests for external sites, set samesite=None.

fr

Les cookies Django doivent être gérés de manière sécurisée en définissant secure=True, httponly=True et samesite='Lax' dans response.set_cookie(...). Si votre situation exige d'autres réglages, désactivez-les explicitement : pour envoyer le cookie en HTTP, définissez secure=False ; pour autoriser le JavaScript côté client à lire le cookie, httponly=False ; pour joindre le cookie aux requêtes vers des sites externes, samesite=None.

ja

Django の Cookie は安全に扱う必要があります。response.set_cookie(...) で secure=True、httponly=True、samesite='Lax' を設定してください。実際の状況で異なる設定が必要な場合は、明示的に宣言してください。Cookie を HTTP で送信する場合は secure=False、クライアント側 JavaScript に Cookie の読み取りを許可する場合は httponly=False、外部サイト宛てのリクエストに Cookie を添付する場合は samesite=None を設定します。

ko

Django Cookie는 안전하게 처리해야 합니다. response.set_cookie(...)에 secure=True, httponly=True, samesite='Lax'를 설정하십시오. 실제 상황에서 다른 설정이 필요하다면 명시적으로 선언하십시오. HTTP를 통해 Cookie를 전송하려면 secure=False로, 클라이언트 JavaScript가 Cookie를 읽도록 허용하려면 httponly=False로, 외부 사이트로 보내는 요청에 Cookie를 포함하려면 samesite=None으로 설정하십시오.

ru

Cookie в Django нужно обрабатывать безопасно: в response.set_cookie(...) задавайте secure=True, httponly=True и samesite='Lax'. Если ситуация требует иного, отключайте настройку явно: чтобы отправлять cookie по HTTP — secure=False; чтобы разрешить чтение cookie клиентскому JavaScript — httponly=False; чтобы передавать cookie в запросах к внешним сайтам — samesite=None.

zh

Django Cookie 应安全处理:在 response.set_cookie(...) 中设置 secure=True、httponly=True、samesite='Lax'。若实际情况需要不同设置,请显式声明:要通过 HTTP 发送 Cookie 就设 secure=False;要允许客户端 JavaScript 读取 Cookie 就设 httponly=False;要随对外站点的请求附带 Cookie 就设 samesite=None。

zh-Hant

Django Cookie 應安全處理:在 response.set_cookie(...) 中設定 secure=True、httponly=True、samesite='Lax'。若實際情況需要不同設定,請顯式宣告:要透過 HTTP 傳送 Cookie 就設 secure=False;要允許用戶端 JavaScript 讀取 Cookie 就設 httponly=False;要隨對外站點的請求附帶 Cookie 就設 samesite=None。

CWE 知识卡

语言名称修复建议
deSensibles Cookie ohne Secure-AttributWeisen Sie dem sensiblen Cookie die Attribute Secure, HttpOnly und SameSite zu.
en——
frCookie sensible dans une session HTTPS sans l'attribut 'Secure'Ajoutez aux cookies sensibles les attributs Secure, HttpOnly et SameSite.
ja機密性の高い Cookie の Secure 属性未設定機密性の高い Cookie に Secure、HttpOnly、SameSite の各属性を追加してください。
ko민감 Cookie의 Secure 속성 미설정민감 Cookie에 Secure·HttpOnly·SameSite 속성을 추가하십시오.
ruЧувствительная cookie без атрибута SecureДобавляйте чувствительным cookie атрибуты Secure, HttpOnly и SameSite.
zh敏感 Cookie 未设置 Secure 属性敏感 Cookie 增加 Secure、HttpOnly 与 SameSite 属性。
zh-Hant敏感 Cookie 未設定 Secure 屬性敏感 Cookie 增加 Secure、HttpOnly 與 SameSite 屬性。

OWASP

A05:2021 - Security Misconfiguration

元数据

likelihoodLOW
impactLOW
confidenceLOW

修复字段

fix无
fix-regex无

上游规则源

github.com/opengrep/opengrep-rules/tree/main/python/django/security/audit/secure-cookies.yaml