Home / Function/ test_xxe_document_function_blocked() — langchain Function Reference

test_xxe_document_function_blocked() — langchain Function Reference

Architecture documentation for the test_xxe_document_function_blocked() function in test_html_security.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  d343734a_f94c_bc1c_a995_fcb524ba7232["test_xxe_document_function_blocked()"]
  c36248a5_01d0_c9ad_b6b4_e15022cac62c["TestHTMLSectionSplitterSecurity"]
  d343734a_f94c_bc1c_a995_fcb524ba7232 -->|defined in| c36248a5_01d0_c9ad_b6b4_e15022cac62c
  style d343734a_f94c_bc1c_a995_fcb524ba7232 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/text-splitters/tests/unit_tests/test_html_security.py lines 29–45

    def test_xxe_document_function_blocked(self) -> None:
        """Test that XSLT document() function attacks are blocked."""
        # Even if someone modifies the default XSLT internally,
        # the secure parser configuration should block document() attacks

        html_content = (
            """<html><body><h1>Test Header</h1><p>Test content</p></body></html>"""
        )

        splitter = HTMLSectionSplitter(headers_to_split_on=[("h1", "Header 1")])

        # Process the HTML safely
        result = splitter.split_text(html_content)

        # Should process normally without any security issues
        assert len(result) > 0
        assert any("Test content" in doc.page_content for doc in result)

Domain

Subdomains

Frequently Asked Questions

What does test_xxe_document_function_blocked() do?
test_xxe_document_function_blocked() is a function in the langchain codebase, defined in libs/text-splitters/tests/unit_tests/test_html_security.py.
Where is test_xxe_document_function_blocked() defined?
test_xxe_document_function_blocked() is defined in libs/text-splitters/tests/unit_tests/test_html_security.py at line 29.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free