Skip to content

Commit a1d3667

Browse files
committed
Refactor Hudson file methods to MaD
1 parent 3a75c0f commit a1d3667

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

java/ql/lib/ext/hudson.model.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ extensions:
3636
pack: codeql/java-all
3737
extensible: sourceModel
3838
data:
39+
- ["hudson", "FilePath", False, "newInputStreamDenyingSymlinkAsNeeded", "", "", "ReturnValue", "file", "manual"]
40+
- ["hudson", "FilePath", False, "openInputStream", "", "", "ReturnValue", "file", "manual"]
41+
- ["hudson", "FilePath", False, "read", "", "", "ReturnValue", "file", "manual"]
42+
- ["hudson", "FilePath", False, "readFromOffset", "", "", "ReturnValue", "file", "manual"]
43+
- ["hudson", "FilePath", False, "readToString", "", "", "ReturnValue", "file", "manual"]
3944
- ["hudson", "Plugin", True, "configure", "", "", "Parameter", "remote", "manual"]
4045
- ["hudson", "Plugin", True, "newInstance", "", "", "Parameter", "remote", "manual"]
4146
- addsTo:

java/ql/lib/semmle/code/java/frameworks/hudson/Hudson.qll

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,6 @@ class HudsonWebMethod extends Method {
1313
}
1414
}
1515

16-
private class FilePathRead extends LocalUserInput {
17-
FilePathRead() {
18-
this.asExpr()
19-
.(MethodAccess)
20-
.getMethod()
21-
.hasQualifiedName("hudson", "FilePath",
22-
[
23-
"newInputStreamDenyingSymlinkAsNeeded", "openInputStream", "read", "readFromOffset",
24-
"readToString"
25-
])
26-
}
27-
28-
override string getThreatModel() { result = "file" }
29-
}
30-
3116
private class HudsonUtilXssSanitizer extends XssSanitizer {
3217
HudsonUtilXssSanitizer() {
3318
this.asExpr()

0 commit comments

Comments
 (0)