@@ -74,14 +74,6 @@ module DecompressionBombs {
74
74
|
75
75
this = m .getACall ( ) .getReceiver ( )
76
76
)
77
- or
78
- exists ( Method m , DataFlow:: CallNode cn |
79
- m .hasQualifiedName ( "github.com/klauspost/compress/zstd" , "Decoder" , [ "WriteTo" , "Read" ] ) and
80
- cn = m .getACall ( )
81
- |
82
- this = cn .getReceiver ( ) and
83
- not hasFlowToComparison ( cn .getResult ( 0 ) )
84
- )
85
77
}
86
78
}
87
79
@@ -178,18 +170,6 @@ module DecompressionBombs {
178
170
* Provides decompression bomb sinks and additional flow steps for `github.com/ulikunitz/xz` package
179
171
*/
180
172
module UlikunitzXz {
181
- class TheSink extends Sink {
182
- TheSink ( ) {
183
- exists ( Method m , DataFlow:: CallNode cn |
184
- m .hasQualifiedName ( "github.com/ulikunitz/xz" , "Reader" , "Read" ) and
185
- cn = m .getACall ( )
186
- |
187
- this = cn .getReceiver ( ) and
188
- not hasFlowToComparison ( cn .getResult ( 0 ) )
189
- )
190
- }
191
- }
192
-
193
173
class TheAdditionalTaintStep extends AdditionalTaintStep {
194
174
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
195
175
@@ -216,18 +196,6 @@ module DecompressionBombs {
216
196
* Provides decompression bomb sinks and additional flow steps for `compress/gzip` package
217
197
*/
218
198
module CompressGzipBombs {
219
- class TheSink extends Sink {
220
- TheSink ( ) {
221
- exists ( Method m , DataFlow:: CallNode cn |
222
- m .hasQualifiedName ( "compress/gzip" , "Reader" , "Read" ) and
223
- cn = m .getACall ( )
224
- |
225
- this = cn .getReceiver ( ) and
226
- not hasFlowToComparison ( cn .getResult ( 0 ) )
227
- )
228
- }
229
- }
230
-
231
199
class TheAdditionalTaintStep extends AdditionalTaintStep {
232
200
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
233
201
@@ -255,19 +223,6 @@ module DecompressionBombs {
255
223
* Provides decompression bomb sinks and additional flow steps for `github.com/klauspost/compress/gzip` package
256
224
*/
257
225
module KlauspostGzipAndPgzip {
258
- class TheSink extends Sink {
259
- TheSink ( ) {
260
- exists ( Method m , DataFlow:: CallNode cn |
261
- m .hasQualifiedName ( [ "github.com/klauspost/compress/gzip" , "github.com/klauspost/pgzip" ] ,
262
- "Reader" , [ "Read" , "WriteTo" ] ) and
263
- cn = m .getACall ( )
264
- |
265
- this = cn .getReceiver ( ) and
266
- not hasFlowToComparison ( cn .getResult ( 0 ) )
267
- )
268
- }
269
- }
270
-
271
226
class TheAdditionalTaintStep extends AdditionalTaintStep {
272
227
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
273
228
@@ -301,18 +256,6 @@ module DecompressionBombs {
301
256
* Provides decompression bomb sinks and additional flow steps for `compress/bzip2` package
302
257
*/
303
258
module CompressBzip2 {
304
- class TheSink extends Sink {
305
- TheSink ( ) {
306
- exists ( Method m , DataFlow:: CallNode cn |
307
- m .hasQualifiedName ( "compress/bzip2" , "reader" , "Read" ) and
308
- cn = m .getACall ( )
309
- |
310
- this = cn .getReceiver ( ) and
311
- not hasFlowToComparison ( cn .getResult ( 0 ) )
312
- )
313
- }
314
- }
315
-
316
259
class TheAdditionalTaintStep extends AdditionalTaintStep {
317
260
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
318
261
@@ -340,18 +283,6 @@ module DecompressionBombs {
340
283
* Provides decompression bomb sinks and additional flow steps for `github.com/dsnet/compress/bzip2` package
341
284
*/
342
285
module DsnetBzip2 {
343
- class TheSink extends Sink {
344
- TheSink ( ) {
345
- exists ( Method m , DataFlow:: CallNode cn |
346
- m .hasQualifiedName ( "github.com/dsnet/compress/bzip2" , "Reader" , "Read" ) and
347
- cn = m .getACall ( )
348
- |
349
- this = cn .getReceiver ( ) and
350
- not hasFlowToComparison ( cn .getResult ( 0 ) )
351
- )
352
- }
353
- }
354
-
355
286
class TheAdditionalTaintStep extends AdditionalTaintStep {
356
287
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
357
288
@@ -379,18 +310,6 @@ module DecompressionBombs {
379
310
* Provides decompression bomb sinks and additional flow steps for `github.com/dsnet/compress/flate` package
380
311
*/
381
312
module DsnetFlate {
382
- class TheSink extends Sink {
383
- TheSink ( ) {
384
- exists ( Method m , DataFlow:: CallNode cn |
385
- m .hasQualifiedName ( "github.com/dsnet/compress/flate" , "Reader" , "Read" ) and
386
- cn = m .getACall ( )
387
- |
388
- this = cn .getReceiver ( ) and
389
- not hasFlowToComparison ( cn .getResult ( 0 ) )
390
- )
391
- }
392
- }
393
-
394
313
class TheAdditionalTaintStep extends AdditionalTaintStep {
395
314
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
396
315
@@ -496,18 +415,6 @@ module DecompressionBombs {
496
415
* Provides decompression bomb sinks and additional flow steps for `github.com/klauspost/compress/zlib` package
497
416
*/
498
417
module KlauspostZlib {
499
- class TheSink extends Sink {
500
- TheSink ( ) {
501
- exists ( Method m , DataFlow:: CallNode cn |
502
- m .hasQualifiedName ( "github.com/klauspost/compress/zlib" , "reader" , "Read" ) and
503
- cn = m .getACall ( )
504
- |
505
- this = cn .getReceiver ( ) and
506
- not hasFlowToComparison ( cn .getResult ( 0 ) )
507
- )
508
- }
509
- }
510
-
511
418
class TheAdditionalTaintStep extends AdditionalTaintStep {
512
419
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
513
420
@@ -535,18 +442,6 @@ module DecompressionBombs {
535
442
* Provides decompression bomb sinks and additional flow steps for `compress/zlib` package
536
443
*/
537
444
module CompressZlibBombs {
538
- class TheSink extends Sink {
539
- TheSink ( ) {
540
- exists ( Method m , DataFlow:: CallNode cn |
541
- m .hasQualifiedName ( "compress/zlib" , "reader" , "Read" ) and
542
- cn = m .getACall ( )
543
- |
544
- this = cn .getReceiver ( ) and
545
- not hasFlowToComparison ( cn .getResult ( 0 ) )
546
- )
547
- }
548
- }
549
-
550
445
class TheAdditionalTaintStep extends AdditionalTaintStep {
551
446
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
552
447
@@ -574,18 +469,6 @@ module DecompressionBombs {
574
469
* Provides decompression bomb sinks and additional flow steps for `github.com/golang/snappy` package
575
470
*/
576
471
module GolangSnappy {
577
- class TheSink extends Sink {
578
- TheSink ( ) {
579
- exists ( Method m , DataFlow:: CallNode cn |
580
- m .hasQualifiedName ( "github.com/golang/snappy" , "Reader" , [ "Read" , "ReadByte" ] ) and
581
- cn = m .getACall ( )
582
- |
583
- this = cn .getReceiver ( ) and
584
- not hasFlowToComparison ( cn .getResult ( 0 ) )
585
- )
586
- }
587
- }
588
-
589
472
class TheAdditionalTaintStep extends AdditionalTaintStep {
590
473
TheAdditionalTaintStep ( ) { this = "AdditionalTaintStep" }
591
474
@@ -643,8 +526,7 @@ module DecompressionBombs {
643
526
class TheSink extends Sink {
644
527
TheSink ( ) {
645
528
exists ( Method m , DataFlow:: CallNode cn |
646
- m .hasQualifiedName ( "github.com/klauspost/compress/s2" , "Reader" ,
647
- [ "DecodeConcurrent" , "ReadByte" , "Read" ] ) and
529
+ m .hasQualifiedName ( "github.com/klauspost/compress/s2" , "Reader" , "DecodeConcurrent" ) and
648
530
cn = m .getACall ( )
649
531
|
650
532
this = cn .getReceiver ( ) and
@@ -690,14 +572,12 @@ module DecompressionBombs {
690
572
)
691
573
or
692
574
exists ( Method m , DataFlow:: CallNode cn |
693
- m .hasQualifiedName ( "io" , "Reader" , "Read" ) and cn = m .getACall ( )
694
- |
695
- this = cn .getReceiver ( ) and
696
- not hasFlowToComparison ( cn .getResult ( 0 ) )
697
- )
698
- or
699
- exists ( Method m , DataFlow:: CallNode cn |
700
- m .hasQualifiedName ( "archive/tar" , "Reader" , "Read" ) and cn = m .getACall ( )
575
+ (
576
+ m .implements ( "io" , "Reader" , "Read" ) or
577
+ m .implements ( "io" , "ByteReader" , "ReadByte" ) or
578
+ m .implements ( "io" , "WriterTo" , "WriteTo" )
579
+ ) and
580
+ cn = m .getACall ( )
701
581
|
702
582
this = cn .getReceiver ( ) and
703
583
not hasFlowToComparison ( cn .getResult ( 0 ) )
0 commit comments