mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
PS: Use the existing MaD rows to model file reads as flow sources.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
private import semmle.code.powershell.dataflow.internal.DataFlowPublic as DataFlow
|
||||
import semmle.code.powershell.dataflow.flowsources.Remote
|
||||
import semmle.code.powershell.dataflow.flowsources.Local
|
||||
import semmle.code.powershell.dataflow.flowsources.Stored
|
||||
import semmle.code.powershell.frameworks.data.internal.ApiGraphModels
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Provides classes representing sources of stored data.
|
||||
*/
|
||||
|
||||
import powershell
|
||||
private import FlowSources
|
||||
|
||||
/** A data flow source of stored user input. */
|
||||
abstract class StoredFlowSource extends SourceNode {
|
||||
override string getThreatModel() { result = "local" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A node with input from a database.
|
||||
*/
|
||||
abstract class DatabaseInputSource extends StoredFlowSource {
|
||||
override string getThreatModel() { result = "database" }
|
||||
|
||||
override string getSourceType() { result = "database input" }
|
||||
}
|
||||
|
||||
private class ExternalDatabaseInputSource extends DatabaseInputSource {
|
||||
ExternalDatabaseInputSource() { this = ModelOutput::getASourceNode("database", _).asSource() }
|
||||
}
|
||||
|
||||
/** A file stream source is considered a stored flow source. */
|
||||
abstract class FileStreamStoredFlowSource extends StoredFlowSource {
|
||||
override string getThreatModel() { result = "file" }
|
||||
|
||||
override string getSourceType() { result = "file stream" }
|
||||
}
|
||||
|
||||
private class ExternalFileStreamStoredFlowSource extends FileStreamStoredFlowSource {
|
||||
ExternalFileStreamStoredFlowSource() { this = ModelOutput::getASourceNode("file", _).asSource() }
|
||||
}
|
||||
Reference in New Issue
Block a user