You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/libxml/constants.xml
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,12 @@
46
46
<simpara>
47
47
Default DTD attributes
48
48
</simpara>
49
+
<caution>
50
+
<simpara>
51
+
Enabling loading of DTD attributes will enable fetching of external entities.
52
+
The <linklinkend="constant.libxml-no-xxe"><constant>LIBXML_NO_XXE</constant></link> constant can be used to prevent this (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
53
+
</simpara>
54
+
</caution>
49
55
</listitem>
50
56
</varlistentry>
51
57
<varlistentryxml:id="constant.libxml-dtdload">
@@ -57,6 +63,12 @@
57
63
<simpara>
58
64
Load the external subset
59
65
</simpara>
66
+
<caution>
67
+
<simpara>
68
+
Enabling loading of external subsets will enable fetching of external entities.
69
+
The <linklinkend="constant.libxml-no-xxe"><constant>LIBXML_NO_XXE</constant></link> constant can be used to prevent this (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
70
+
</simpara>
71
+
</caution>
60
72
</listitem>
61
73
</varlistentry>
62
74
<varlistentryxml:id="constant.libxml-dtdvalid">
@@ -71,6 +83,7 @@
71
83
<caution>
72
84
<simpara>
73
85
Enabling validating the DTD may facilitate XML External Entity (XXE) attacks.
86
+
The <linklinkend="constant.libxml-no-xxe"><constant>LIBXML_NO_XXE</constant></link> constant can be used to prevent this (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
Copy file name to clipboardExpand all lines: reference/libxml/functions/libxml-disable-entity-loader.xml
+9-2Lines changed: 9 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,17 @@
20
20
<para>
21
21
Disable/enable the ability to load external entities.
22
22
Note that disabling the loading of external entities may cause general issues
23
-
with loading XML documents. However, as of libxml 2.9.0 entity substitution
23
+
with loading XML documents.
24
+
</para>
25
+
<para>
26
+
As of libxml 2.9.0 entity substitution
24
27
is disabled by default, so there is no need to disable the loading of external
25
28
entities,
26
-
unless there is the need to resolve internal entity references with <constant>LIBXML_NOENT</constant>.
29
+
unless there is the need to resolve internal entity references with <constant>LIBXML_NOENT</constant> or
30
+
<constant>LIBXML_DTDVALID</constant>.
27
31
Generally, it is preferable to use <function>libxml_set_external_entity_loader</function>
28
32
to suppress loading of external entities.
33
+
The <linklinkend="constant.libxml-no-xxe"><constant>LIBXML_NO_XXE</constant></link> constant can be used to prevent this as well (only available in Libxml >= 2.13.0, as of PHP 8.4.0).
0 commit comments