-
Notifications
You must be signed in to change notification settings - Fork 250
Commit d23ab96
Taint propagates from methods of tainted objects
Previously
`x = TAINT.lower()` would be tainted (due to special handling for
assignment_call_nodes)
but
`x = str(TAINT.lower())` wouldn't be tainted.
To fix this, `TAINT` is added to the RHS variables of
`TAINT.lower()`.
This will mean that e.g. `request` will be a RHS variable of
`request.get()`, but I think that will be OK.
In the test which changed, the additional line is because resp has
become tainted.
However, this still leaves the following false negatives to fix another
day:
`assert_vulnerable('result = str("%s" % str(TAINT.lower()))') # FAILS`
`assert_vulnerable('result = str("%s" % TAINT.lower().upper())') # FAILS`1 parent c0e6ace commit d23ab96
File tree
2 files changed
+30
-16
lines changed- pyt/cfg
- tests/vulnerabilities
2 files changed
+30
-16
lines changedLines changed: 11 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 | + | ||
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
| |||
472 | 473 |
| |
473 | 474 |
| |
474 | 475 |
| |
475 | - | ||
476 | - | ||
477 | - | ||
478 | - | ||
479 | - | ||
480 | - | ||
481 | - | ||
482 | - | ||
483 | 476 |
| |
484 | 477 |
| |
485 | 478 |
| |
| |||
597 | 590 |
| |
598 | 591 |
| |
599 | 592 |
| |
600 | - | ||
601 | - | ||
593 | + | ||
594 | + | ||
602 | 595 |
| |
603 | - | ||
596 | + | ||
604 | 597 |
| |
605 | 598 |
| |
606 | 599 |
| |
607 | - | ||
600 | + | ||
608 | 601 |
| |
609 | 602 |
| |
610 | 603 |
| |
| |||
613 | 606 |
| |
614 | 607 |
| |
615 | 608 |
| |
616 | - | ||
609 | + | ||
617 | 610 |
| |
618 | 611 |
| |
619 | 612 |
| |
| |||
657 | 650 |
| |
658 | 651 |
| |
659 | 652 |
| |
653 | + | ||
654 | + | ||
655 | + | ||
656 | + | ||
657 | + | ||
660 | 658 |
| |
661 | 659 |
| |
662 | 660 |
| |
| |||
667 | 665 |
| |
668 | 666 |
| |
669 | 667 |
| |
670 | - | ||
671 | 668 |
| |
672 | 669 |
| |
673 | 670 |
| |
|
Lines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
114 | - | ||
115 | - | ||
114 | + | ||
115 | + | ||
116 | + | ||
116 | 117 |
| |
117 | 118 |
| |
118 | 119 |
| |
| |||
340 | 341 |
| |
341 | 342 |
| |
342 | 343 |
| |
344 | + | ||
345 | + | ||
343 | 346 |
| |
344 | 347 |
| |
345 | 348 |
| |
| |||
517 | 520 |
| |
518 | 521 |
| |
519 | 522 |
| |
523 | + | ||
524 | + | ||
525 | + | ||
526 | + | ||
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | ||
531 | + | ||
532 | + | ||
533 | + | ||
534 | + | ||
535 | + | ||
536 | + | ||
520 | 537 |
| |
521 | 538 |
| |
522 | 539 |
| |
|
0 commit comments