Files
codeql/python/ql/test/query-tests/Security/CWE-614-InsecureCookie/test.py
Owen Mansel-Chan 5a97348e78 python: Inline expectation should have space after $
This was a regex-find-replace from `# \$(?! )` (using a negative lookahead) to `# $ `.
2026-03-04 12:45:05 +00:00

13 lines
481 B
Python

from flask import Flask, request, make_response
app = Flask(__name__)
@app.route("/test")
def test():
resp = make_response()
resp.set_cookie("authKey", "value1") # $ Alert[py/insecure-cookie]
resp.set_cookie("authKey", "value2", secure=True)
resp.set_cookie("sessionID", "value2", httponly=True) # $ Alert[py/insecure-cookie]
resp.set_cookie("password", "value2", samesite="Strict") # $ Alert[py/insecure-cookie]
resp.set_cookie("notSensitive", "value3")