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

JS/Ruby/Python: Add neutralModel extensible predicate #14631

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions codeql-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ provide:
- "swift/extractor-pack/codeql-extractor.yml"
- "swift/integration-tests/qlpack.yml"
- "ql/extractor-pack/codeql-extractor.yml"
- ".github/codeql/extensions/**/codeql-pack.yml"

versionPolicies:
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ extensible predicate sourceModel(string type, string path, string kind);
extensible predicate sinkModel(string type, string path, string kind);

/**
* Holds if calls to `(type, path)`, the value referred to by `input`
* Holds if in calls to `(type, path)`, the value referred to by `input`
* can flow to the value referred to by `output`.
*
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
* respectively.
*/
extensible predicate summaryModel(string type, string path, string input, string output, string kind);

/**
* Holds if calls to `(type, path)` should be considered neutral. The meaning of this depends on the `kind`.
* If `kind` is `summary`, the call does not propagate data flow. If `kind` is `source`, the call is not a source.
* If `kind` is `sink`, the call is not a sink.
*/
extensible predicate neutralModel(string type, string path, string kind);

/**
* Holds if `(type2, path)` should be seen as an instance of `type1`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ extensions:
extensible: summaryModel
data: []

- addsTo:
pack: codeql/javascript-all
extensible: neutralModel
data: []

- addsTo:
pack: codeql/javascript-all
extensible: typeModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ extensible predicate sourceModel(string type, string path, string kind);
extensible predicate sinkModel(string type, string path, string kind);

/**
* Holds if calls to `(type, path)`, the value referred to by `input`
* Holds if in calls to `(type, path)`, the value referred to by `input`
* can flow to the value referred to by `output`.
*
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
* respectively.
*/
extensible predicate summaryModel(string type, string path, string input, string output, string kind);

/**
* Holds if calls to `(type, path)` should be considered neutral. The meaning of this depends on the `kind`.
* If `kind` is `summary`, the call does not propagate data flow. If `kind` is `source`, the call is not a source.
* If `kind` is `sink`, the call is not a sink.
*/
extensible predicate neutralModel(string type, string path, string kind);

/**
* Holds if `(type2, path)` should be seen as an instance of `type1`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ extensions:
extensible: summaryModel
data: []

- addsTo:
pack: codeql/python-all
extensible: neutralModel
data: []

- addsTo:
pack: codeql/python-all
extensible: typeModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ extensible predicate sourceModel(string type, string path, string kind);
extensible predicate sinkModel(string type, string path, string kind);

/**
* Holds if calls to `(type, path)`, the value referred to by `input`
* Holds if in calls to `(type, path)`, the value referred to by `input`
* can flow to the value referred to by `output`.
*
* `kind` should be either `value` or `taint`, for value-preserving or taint-preserving steps,
* respectively.
*/
extensible predicate summaryModel(string type, string path, string input, string output, string kind);

/**
* Holds if calls to `(type, path)` should be considered neutral. The meaning of this depends on the `kind`.
* If `kind` is `summary`, the call does not propagate data flow. If `kind` is `source`, the call is not a source.
* If `kind` is `sink`, the call is not a sink.
*/
extensible predicate neutralModel(string type, string path, string kind);

/**
* Holds if `(type2, path)` should be seen as an instance of `type1`.
*/
Expand Down
5 changes: 5 additions & 0 deletions ruby/ql/lib/codeql/ruby/frameworks/data/internal/model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ extensions:
extensible: summaryModel
data: []

- addsTo:
pack: codeql/ruby-all
extensible: neutralModel
data: []

- addsTo:
pack: codeql/ruby-all
extensible: typeModel
Expand Down
Loading