diff options
| author | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-03-27 11:43:18 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2026-03-27 11:43:18 +0000 |
| commit | 1e551e618a63c869fde6a4b327566b38696a5f45 (patch) | |
| tree | 37df1211379db51e55e93c4519ea93d2e3b19d54 /test | |
| parent | 426a6a3d9309e3f7cf5fc89d6a687c7895785cc3 (diff) | |
| download | webstat-0.3.1.tar.bz2 webstat-0.3.1.tar.xz webstat-0.3.1.zip | |
Parse escaping in query stringswebstat-0.3.1
Diffstat (limited to 'test')
| -rw-r--r-- | test/test-ingest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index 8c82764..5fc8195 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -202,6 +202,17 @@ BOOST_AUTO_TEST_CASE(ExtractFieldsEdgeCasesUnparsable3603068405) BOOST_CHECK_EQUAL(std::get<4>(result->values()), R"LOG(/packages/dev-php/pecl-uploadprogress'yqFSRA<'">yuezhx)LOG"); } +BOOST_AUTO_TEST_CASE(ExtractFieldsEdgeCasesUnparsable3482917779) +{ + const auto result = WebStat::Ingestor::scanLogLine( + R"LOG(195.166.151.214 62.171.174.195 1774536220216585 GET "/index.php" "?lang=../../../../../../../../usr/local/lib/php/pearcmd&+config-create+/&/<?echo(md5(\"hi\"));?>+/tmp/index1.php" HTTP/1.1 404 376 5811 "-" "libredtail-http" "text/html")LOG"); + BOOST_REQUIRE(result); + const auto queryString = std::get<5>(result->values()); + BOOST_REQUIRE(queryString); + BOOST_CHECK_EQUAL(*queryString, + R"LOG(lang=../../../../../../../../usr/local/lib/php/pearcmd&+config-create+/&/<?echo(md5("hi"));?>+/tmp/index1.php)LOG"); +} + class TestIngestor : public WebStat::Ingestor { public: TestIngestor() : |
