Commit 8811343
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 d2a8189 commit 8811343
File tree
2 files changed
+29
-17
lines changed- pyt/cfg
- tests/vulnerabilities
2 files changed
+29
-17
lines changed| 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 | | |
| |||
572 | 565 | | |
573 | 566 | | |
574 | 567 | | |
575 | | - | |
| 568 | + | |
576 | 569 | | |
577 | 570 | | |
578 | 571 | | |
| |||
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 | | |
| |||
| 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 | | |
| |||
468 | 469 | | |
469 | 470 | | |
470 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
471 | 486 | | |
472 | 487 | | |
473 | 488 | | |
| |||
0 commit comments