diff --git a/tests/exploits/cve_2024_9487_test.py b/tests/exploits/cve_2024_9487_test.py index fa1967e..79fce5c 100644 --- a/tests/exploits/cve_2024_9487_test.py +++ b/tests/exploits/cve_2024_9487_test.py @@ -83,3 +83,27 @@ def testCVE20249487_whenVersionVeryOld_reportFinding( "http://localhost:80 is vulnerable to CVE-2024-9487, " "GITHUB ENTERPRISE SERVER AUTHENTICATION BYPASS" ) + + +def testCVE20249487_whenMultiVersions_doNotCrash( + requests_mock: req_mock.mocker.Mocker, +) -> None: + """CVE_2024_9487 unit test: case when target is vulnerable.""" + requests_mock.get( + "http://localhost:80/", + text=""" +
+ GitHub Enterprise Server 3.14.2 + GitHub Enterprise Server 3.14.3 +
+ """, + status_code=200, + ) + exploit_instance = cve_2024_9487.CVE20249487Exploit() + target = definitions.Target("http", "localhost", 80) + + accept = exploit_instance.accept(target) + vulnerabilities = exploit_instance.check(target) + + assert accept is True + assert len(vulnerabilities) == 0 \ No newline at end of file