Files
codeql/python/ql/lib/semmle/python/dataflow/new/RemoteFlowSources.qll
Rasmus Wriedt Larsen 5ec8e5dd30 Python: Setup support for threat-models
Naming in other languages:
- `SourceNode` (for QL only modeling)
- `ThreatModelFlowSource` (for active sources from QL or data-extensions)

However, since we use `LocalSourceNode` in Python, and `SourceNode` in
JS (for local source nodes), it seems a bit confusing to follow the same
naming convention as other languages, and instead I came up with new names.
2024-08-19 10:54:47 +02:00

32 lines
1.0 KiB
Plaintext

/**
* Provides an extension point for modeling user-controlled data.
* Such data is often used as data-flow sources in security queries.
*/
private import python
private import semmle.python.dataflow.new.DataFlow
// Need to import since frameworks can extend `RemoteFlowSource::Range`
private import semmle.python.Frameworks
private import semmle.python.Concepts
/**
* A data flow source of remote user input.
*
* Extend this class to refine existing API models. If you want to model new APIs,
* extend `RemoteFlowSource::Range` instead.
*/
class RemoteFlowSource extends ThreatModelSource instanceof RemoteFlowSource::Range { }
/** Provides a class for modeling new sources of remote user input. */
module RemoteFlowSource {
/**
* A data flow source of remote user input.
*
* Extend this class to model new APIs. If you want to refine existing API models,
* extend `RemoteFlowSource` instead.
*/
abstract class Range extends ThreatModelSource::Range {
override string getThreatModel() { result = "remote" }
}
}