Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Python: Promote cookie injection query from experimental #16893

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

joefarebrother
Copy link
Contributor

Part of https://github.com/github/codeql-python-team/issues/792 promoting #6360;
Depends on #16696

Promotes the Cookie Injection query from experimental, finding instances of user input being used to set the name or value of a cookie.

Comment on lines 1 to 20
/**
* @name Construction of a cookie using user-supplied input.
* @description Constructing cookies from user input may allow an attacker to perform a Cookie Poisoning attack.
* @kind path-problem
* @problem.severity error
* @precision high
* @id py/cookie-injection
* @tags security
* external/cwe/cwe-614
*/

import python
import semmle.python.dataflow.new.DataFlow
import semmle.python.security.dataflow.CookieInjectionQuery
import CookieInjectionFlow::PathGraph

from CookieInjectionFlow::PathNode source, CookieInjectionFlow::PathNode sink
where CookieInjectionFlow::flowPath(source, sink)
select sink.getNode(), source, sink, "Cookie is constructed from a $@.", source.getNode(),
"user-supplied input"

Check warning

Code scanning / CodeQL

Missing security metadata Warning

This query file is missing a @security-severity tag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant