Skip to content

Commit f2563b7

Browse files
authored
doc: update ParseOptions::HUGE warning (#3142)
**What problem is this PR intended to solve?** We've long documented use of `HUGE` as a performance concern, when in reality it's a security concern. Large untrusted documents can cause OOM condition when the HUGE option is set. Also: small developer change to lower verbosity of tests.
2 parents 74455fe + 0b41d83 commit f2563b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/nokogiri/xml/parse_options.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class ParseOptions
140140

141141
# Relax any hardcoded limit from the parser. Off by default.
142142
#
143-
# ⚠ There may be a performance penalty when this option is set.
143+
# ⚠ <b>It is UNSAFE to set this option</b> when parsing untrusted documents.
144144
HUGE = 1 << 19
145145

146146
# Support line numbers up to <code>long int</code> (default is a <code>short int</code>). On

rakelib/test.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ end
109109

110110
def nokogiri_test_task_configuration(t)
111111
t.libs << "test"
112-
t.verbose = true
112+
# t.verbose = true # This is noisier than we need. Commenting out 2024-03-07.
113113
# t.options = "-v" if ENV["CI"] # I haven't needed this in a long time. Commenting out 2023-12-10.
114114
end
115115

0 commit comments

Comments
 (0)