[PATCH] Documented xml_external_entities directive

Maxim Dounin mdounin at mdounin.ru
Sat Nov 8 12:57:50 UTC 2025


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1762606468 -10800
#      Sat Nov 08 15:54:28 2025 +0300
# Node ID 177acdc2dd4f5fe27f33ba71401e98b42b01df3b
# Parent  00967d8711526c1526b2c32d1e8e9bc847442963
Documented xml_external_entities directive.

diff --git a/xml/en/docs/http/ngx_http_xslt_module.xml b/xml/en/docs/http/ngx_http_xslt_module.xml
--- a/xml/en/docs/http/ngx_http_xslt_module.xml
+++ b/xml/en/docs/http/ngx_http_xslt_module.xml
@@ -10,7 +10,7 @@
 <module name="Module ngx_http_xslt_module"
         link="/en/docs/http/ngx_http_xslt_module.html"
         lang="en"
-        rev="3">
+        rev="4">
 
 <section id="summary">
 
@@ -73,6 +73,36 @@ It is enough to declare just the require
 </directive>
 
 
+<directive name="xml_external_entities">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<appeared-in>1.29.3</appeared-in>
+
+<para>
+Enables loading of external character entities
+declared in the internal DTD subset,
+that is, in the processed XML document itself.
+</para>
+
+<para>
+By default, loading of external entities
+declared in the internal DTD subset
+is disabled since version 1.29.3.
+Loading can be enabled with this directive,
+but it should be kept in mind that this makes it possible to
+access all local files readable by the worker process.
+</para>
+
+<para>
+Only loading of file-based external entities is supported.
+</para>
+
+</directive>
+
+
 <directive name="xslt_last_modified">
 <syntax><literal>on</literal> | <literal>off</literal></syntax>
 <default>off</default>
diff --git a/xml/ru/docs/http/ngx_http_xslt_module.xml b/xml/ru/docs/http/ngx_http_xslt_module.xml
--- a/xml/ru/docs/http/ngx_http_xslt_module.xml
+++ b/xml/ru/docs/http/ngx_http_xslt_module.xml
@@ -10,7 +10,7 @@
 <module name="Модуль ngx_http_xslt_module"
         link="/ru/docs/http/ngx_http_xslt_module.html"
         lang="ru"
-        rev="3">
+        rev="4">
 
 <section id="summary">
 
@@ -73,6 +73,36 @@ location / {
 </directive>
 
 
+<directive name="xml_external_entities">
+<syntax><literal>on</literal> | <literal>off</literal></syntax>
+<default>off</default>
+<context>http</context>
+<context>server</context>
+<context>location</context>
+<appeared-in>1.29.3</appeared-in>
+
+<para>
+Разрешает загрузку внешних символьных сущностей,
+объявленных во внутреннем подмножестве DTD,
+то есть непосредственно в обрабатываемом XML-документе.
+</para>
+
+<para>
+По умолчанию загрузка внешних сущностей,
+объявленных во внутреннем подмножестве DTD,
+запрещена начиная с версии 1.29.3.
+Загрузка может быть разрешена с помощью данной директивы,
+но следует учитывать, что это делает возможным
+чтение любых локальных файлов, доступных рабочему процессу.
+</para>
+
+<para>
+Поддерживается только загрузка внешних сущностей из файлов.
+</para>
+
+</directive>
+
+
 <directive name="xslt_last_modified">
 <syntax><literal>on</literal> | <literal>off</literal></syntax>
 <default>off</default>


More information about the nginx-devel mailing list