mirror of
https://github.com/github/codeql.git
synced 2026-04-16 12:34:02 +02:00
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
/**
|
|
* Provides default sources, sinks and sanitizers for detecting
|
|
* "cookie injection"
|
|
* vulnerabilities, as well as extension points for adding your own.
|
|
*/
|
|
|
|
private import python
|
|
private import semmle.python.dataflow.new.DataFlow
|
|
private import semmle.python.Concepts
|
|
private import semmle.python.dataflow.new.RemoteFlowSources
|
|
|
|
/**
|
|
* Provides default sources, sinks and sanitizers for detecting
|
|
* "cookie injection"
|
|
* vulnerabilities, as well as extension points for adding your own.
|
|
*/
|
|
module CookieInjection {
|
|
/**
|
|
* A data flow source for "cookie injection" vulnerabilities.
|
|
*/
|
|
abstract class Source extends DataFlow::Node { }
|
|
|
|
/**
|
|
* A data flow sink for "cookie injection" vulnerabilities.
|
|
*/
|
|
abstract class Sink extends DataFlow::Node { }
|
|
|
|
/**
|
|
* A sanitizer for "cookie injection" vulnerabilities.
|
|
*/
|
|
abstract class Sanitizer extends DataFlow::Node { }
|
|
|
|
/**
|
|
* DEPRECATED: Use `ActiveThreatModelSource` from Concepts instead!
|
|
*/
|
|
deprecated class RemoteFlowSourceAsSource = ActiveThreatModelSourceAsSource;
|
|
|
|
/**
|
|
* An active threat-model source, considered as a flow source.
|
|
*/
|
|
private class ActiveThreatModelSourceAsSource extends Source, ActiveThreatModelSource { }
|
|
|
|
/**
|
|
* A write to a cookie, considered as a sink.
|
|
*/
|
|
class CookieWriteSink extends Sink {
|
|
CookieWriteSink() {
|
|
exists(Http::Server::CookieWrite cw |
|
|
this = [cw.getNameArg(), cw.getValueArg(), cw.getHeaderArg()]
|
|
)
|
|
}
|
|
}
|
|
}
|