Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `java/partial-path-traversal` and `java/partial-path-traversal-from-remote` queries now correctly recognize file separator appends using `+=`.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ private class CharacterLiteralFileSeparatorExpr extends FileSeparatorExpr, Chara
CharacterLiteralFileSeparatorExpr() { this.getValue() = "/" or this.getValue() = "\\" }
}

private class FileSeparatorAppend extends AddExpr {
FileSeparatorAppend() { this.getRightOperand() instanceof FileSeparatorExpr }
private class FileSeparatorAppend extends BinaryExpr {
FileSeparatorAppend() {
this.(AddExpr).getRightOperand() instanceof FileSeparatorExpr or
this.(AssignAddExpr).getRightOperand() instanceof FileSeparatorExpr
}
}

private predicate isSafe(Expr expr) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
Security/CWE/CWE-023/PartialPathTraversal.ql
query: Security/CWE/CWE-023/PartialPathTraversal.ql
postprocess:
- utils/test/PrettyPrintModels.ql
- utils/test/InlineExpectationsTestQuery.ql
Loading
Loading