Added one more example to the qhelp

This commit is contained in:
Sim4n6
2023-05-25 09:41:22 +01:00
parent 7d68f6afc9
commit 09c97ce0da
2 changed files with 14 additions and 0 deletions

View File

@@ -23,6 +23,18 @@
<sample src="./examples/unicode_normalization.rb" />
</example>
<example>
<p> The next example shows how an early deletion of a character may be bypassed due to a
potential Unicode character collision.</p>
<p>The character <code>&lt;</code> was expected to be omitted from the string <code>s</code>.
However, a malicious user may consider using its colliding Unicode character U+FE64 <code>
﹤</code> as an alternative. Due to the Late-Unicode normalization with the form NFKC,
the resulting string would contain the unintended character <code>&lt;</code> . </p>
<sample src="./examples/unicode_normalization2.rb" />
</example>
<references>
<li> Research study: <a

View File

@@ -0,0 +1,2 @@
s = "﹤xss>"
puts s.delete("<").unicode_normalize(:nfkc).include?("<")