fix(security): enforce registered endpoint authority

Require caller-supplied model endpoints to resolve through enabled owner-visible registrations, harden session path encoding, and remove the SVG title HTML parsing sink.
This commit is contained in:
Alexandre Teixeira
2026-10-05 22:24:15 +01:00
parent 481726acf2
commit 9ee614e2ac
9 changed files with 349 additions and 14 deletions
+11
View File
@@ -7,6 +7,17 @@ from tests.helpers.document_source import document_source
_REPO = Path(__file__).resolve().parent.parent
def test_svg_title_extraction_uses_xml_text_without_html_assignment():
src = (_REPO / "static" / "js" / "markdown.js").read_text(encoding="utf-8")
render = src.split("function renderSvgSandbox(source)", 1)[1].split(
"function replaceRawSvgBlocks", 1
)[0]
assert "innerHTML" not in render
assert "parseFromString(cleaned, 'image/svg+xml')" in render
assert "textContent" in render
assert "parsererror" in render
def test_markdown_raw_html_sanitizer_checks_url_attr_edge_cases():
src = (_REPO / "static" / "js" / "markdown.js").read_text(encoding="utf-8")