Skip to content

Commit 7e5891b

Browse files
committed
Remove unnecessary additional flow step
TaintTracking already adds taint steps for field reads
1 parent cf997fd commit 7e5891b

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

go/ql/src/experimental/frameworks/DecompressionBombsCustomizations.qll

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ module DecompressionBombs {
140140
}
141141

142142
override predicate isAdditionalFlowStep(DataFlow::Node fromNode, DataFlow::Node toNode) {
143-
exists(DataFlow::FieldReadNode fi |
144-
fi.getType().hasQualifiedName("github.com/klauspost/compress/zip", "Reader")
145-
|
146-
fromNode = fi.getBase() and
147-
toNode = fi
148-
)
149-
or
150143
exists(Method m, DataFlow::CallNode call |
151144
m.hasQualifiedName("github.com/klauspost/compress/zip", "File", ["Open", "OpenRaw"]) and
152145
call = m.getACall()

go/ql/test/experimental/CWE-522-DecompressionBombs/DecompressionBombs.expected

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ edges
2525
| test.go:130:33:130:40 | filename | test.go:130:2:130:41 | ... := ...[0] | provenance | Config |
2626
| test.go:132:3:132:19 | ... := ...[0] | test.go:134:37:134:38 | rc | provenance | |
2727
| test.go:132:12:132:12 | f | test.go:132:3:132:19 | ... := ...[0] | provenance | MaD:8 |
28-
| test.go:143:2:143:59 | ... := ...[0] | test.go:144:20:144:37 | implicit dereference | provenance | |
28+
| test.go:143:2:143:59 | ... := ...[0] | test.go:145:12:145:12 | f | provenance | |
2929
| test.go:143:51:143:58 | filename | test.go:143:2:143:59 | ... := ...[0] | provenance | Config |
30-
| test.go:144:20:144:37 | implicit dereference | test.go:144:20:144:37 | implicit dereference | provenance | |
31-
| test.go:144:20:144:37 | implicit dereference | test.go:144:20:144:37 | implicit read of field Reader | provenance | |
32-
| test.go:144:20:144:37 | implicit dereference | test.go:144:20:144:37 | implicit read of field Reader | provenance | Config |
33-
| test.go:144:20:144:37 | implicit read of field Reader | test.go:145:12:145:12 | f | provenance | |
3430
| test.go:145:12:145:12 | f | test.go:145:12:145:19 | call to Open | provenance | Config |
3531
| test.go:145:12:145:19 | call to Open | test.go:147:37:147:38 | rc | provenance | |
3632
| test.go:158:19:158:22 | definition of file | test.go:159:25:159:28 | file | provenance | |
@@ -215,8 +211,6 @@ nodes
215211
| test.go:134:37:134:38 | rc | semmle.label | rc |
216212
| test.go:143:2:143:59 | ... := ...[0] | semmle.label | ... := ...[0] |
217213
| test.go:143:51:143:58 | filename | semmle.label | filename |
218-
| test.go:144:20:144:37 | implicit dereference | semmle.label | implicit dereference |
219-
| test.go:144:20:144:37 | implicit read of field Reader | semmle.label | implicit read of field Reader |
220214
| test.go:145:12:145:12 | f | semmle.label | f |
221215
| test.go:145:12:145:19 | call to Open | semmle.label | call to Open |
222216
| test.go:147:37:147:38 | rc | semmle.label | rc |

0 commit comments

Comments
 (0)