Commit 15ebcec
committed
Fix garbled screen when HTTP Age is not a non-negative int
As suggested in #2885 parsing
of the server determined HTTP age var wasn't strict enough.
https://www.rfc-editor.org/rfc/rfc7234#section-1.2.1 requires the
variable to be a non-negative integer but testssl.sh assumed it was
like that but did't check whether that really was the case. This was
labled as a (potential) security problem. Potential as it didn't
look exploitable after review -- the header as a whole was already
sanitized.
This PR fixes the typs confusion and the garbled screen by checking
the variable early in run_http_header() and reset it to NaN. That
will be used later in run_http_date() to raise a low severity finding.
Kudos to @Tristanhx for catching this and for the suggested PR.
Also, only when running in debug mode, this PR fixes that during
service_detection() parts of the not-yet-sanitized header ended
up on the screen. The fix just calls sanitze_http_header() for the
temporary variable $TMPFILE.1 parent e75ef95 commit 15ebcec
1 file changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2503 | 2503 | | |
2504 | 2504 | | |
2505 | 2505 | | |
| 2506 | + | |
| 2507 | + | |
2506 | 2508 | | |
2507 | 2509 | | |
2508 | 2510 | | |
| |||
2577 | 2579 | | |
2578 | 2580 | | |
2579 | 2581 | | |
2580 | | - | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
2581 | 2585 | | |
2582 | 2586 | | |
2583 | 2587 | | |
| |||
2636 | 2640 | | |
2637 | 2641 | | |
2638 | 2642 | | |
| 2643 | + | |
2639 | 2644 | | |
2640 | 2645 | | |
2641 | 2646 | | |
| |||
2663 | 2668 | | |
2664 | 2669 | | |
2665 | 2670 | | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
2666 | 2675 | | |
2667 | 2676 | | |
2668 | 2677 | | |
| |||
2793 | 2802 | | |
2794 | 2803 | | |
2795 | 2804 | | |
2796 | | - | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
| 2808 | + | |
| 2809 | + | |
| 2810 | + | |
| 2811 | + | |
| 2812 | + | |
2797 | 2813 | | |
2798 | 2814 | | |
2799 | 2815 | | |
2800 | 2816 | | |
2801 | 2817 | | |
2802 | | - | |
| 2818 | + | |
2803 | 2819 | | |
2804 | 2820 | | |
2805 | 2821 | | |
| |||
0 commit comments