|
13 | 13 | SSRF_TEST_TWICE = "http://ssrf-redirects.testssandbox.com/ssrf-test-twice" |
14 | 14 | SSRF_TEST_DOMAIN_TWICE = "http://ssrf-redirects.testssandbox.com/ssrf-test-domain-twice" |
15 | 15 |
|
| 16 | +SSRF_TEST_PUNYCODE = "http://ssrf-rédirects.testssandbox.com/ssrf-test" |
| 17 | +SSRF_TEST_PUNYCODE_ENCODED = "http://xn--ssrf-rdirects-ghb.testssandbox.com/ssrf-test" |
| 18 | +SSRF_TEST_DOMAIN_TWICE_PUNYCODE = ( |
| 19 | + "http://ssrf-rédirects.testssandbox.com/ssrf-test-domain-twice" |
| 20 | +) |
| 21 | + |
| 22 | + |
16 | 23 | CROSS_DOMAIN_TEST = "http://firewallssrfredirects-env-2.eba-7ifve22q.eu-north-1.elasticbeanstalk.com/ssrf-test" |
17 | 24 | CROSS_DOMAIN_TEST_DOMAIN_TWICE = "http://firewallssrfredirects-env-2.eba-7ifve22q.eu-north-1.elasticbeanstalk.com/ssrf-test-domain-twice" |
18 | 25 |
|
@@ -81,6 +88,33 @@ def test_srrf_test_domain_twice(monkeypatch): |
81 | 88 | requests.get(SSRF_TEST_DOMAIN_TWICE) |
82 | 89 |
|
83 | 90 |
|
| 91 | +def test_ssrf_test_punycode(monkeypatch): |
| 92 | + reset_comms() |
| 93 | + set_context_and_lifecycle(SSRF_TEST_PUNYCODE) |
| 94 | + monkeypatch.setenv("AIKIDO_BLOCK", "1") |
| 95 | + |
| 96 | + with pytest.raises(AikidoSSRF): |
| 97 | + requests.get(SSRF_TEST_PUNYCODE) |
| 98 | + |
| 99 | + |
| 100 | +def test_ssrf_test_punycode_encoded(monkeypatch): |
| 101 | + reset_comms() |
| 102 | + set_context_and_lifecycle(SSRF_TEST_PUNYCODE_ENCODED) |
| 103 | + monkeypatch.setenv("AIKIDO_BLOCK", "1") |
| 104 | + |
| 105 | + with pytest.raises(AikidoSSRF): |
| 106 | + requests.get(SSRF_TEST_PUNYCODE_ENCODED) |
| 107 | + |
| 108 | + |
| 109 | +def test_ssrf_test_domain_twice_punycode(monkeypatch): |
| 110 | + reset_comms() |
| 111 | + set_context_and_lifecycle(SSRF_TEST_DOMAIN_TWICE_PUNYCODE) |
| 112 | + monkeypatch.setenv("AIKIDO_BLOCK", "1") |
| 113 | + |
| 114 | + with pytest.raises(AikidoSSRF): |
| 115 | + requests.get(SSRF_TEST_DOMAIN_TWICE_PUNYCODE) |
| 116 | + |
| 117 | + |
84 | 118 | def test_cross_domain(monkeypatch): |
85 | 119 | set_context_and_lifecycle(CROSS_DOMAIN_TEST) |
86 | 120 | monkeypatch.setenv("AIKIDO_BLOCK", "1") |
|
0 commit comments