Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/modules/core/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CoreTestSetup(HttpdTestSetup):
def __init__(self, env: 'HttpdTestEnv'):
super().__init__(env=env)
self.add_source_dir(os.path.dirname(inspect.getfile(CoreTestSetup)))
self.add_modules(["cgid"])
self.add_modules(["cgid","include"])


class CoreTestEnv(HttpdTestEnv):
Expand Down
1 change: 1 addition & 0 deletions test/modules/core/htdocs/ssi/exec.shtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!--#exec cmd="echo SSI_OK" -->
32 changes: 32 additions & 0 deletions test/modules/core/test_004_ssi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest
import textwrap

from pyhttpd.conf import HttpdConf

class TestSSIInjection:

@pytest.fixture(autouse=True, scope="class")
def _class_scope(self, env):
conf = HttpdConf(env, extras={
"base": textwrap.dedent(f"""
<Directory "{env.gen_dir}">
Options +Includes
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</Directory>
""")
})
conf.install()
assert env.apache_restart() == 0

def test_ssi_004_01(self, env):
"""
CVE-2025-58098:
Server Side Includes must not add query string to #exec cmd=...
"""
url = env.mkurl("http", "htdocs", "/ssi/exec.shtml?INJECTED")
r = env.curl_get(url)

body = r.response["body"].decode("utf-8")
assert "SSI_OK" in body
assert "INJECTED" not in body