File tree Expand file tree Collapse file tree
javascript/ql/src/Security/CWE-116 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,13 +52,13 @@ The following example shows a pair of hand-written HTML encoding and decoding fu
5252<p >
5353The encoding function correctly handles ampersand before the other characters. For example,
5454the string <code >me & "you"</code > is encoded as <code >me & amp; & quot;you& quot;</code >,
55- and the string <code >" </code > is encoded as <code >& quot;</code >.
55+ and the string <code >& quot;</code > is encoded as <code >& amp;quot;</code >.
5656</p >
5757
5858<p >
5959The decoding function, however, incorrectly decodes <code >& amp;</code > into <code >& </code >
6060before handling the other characters. So while it correctly decodes the first example above,
61- it decodes the second example (<code >& quot;</code >) to <code >" </code > (a single double quote),
61+ it decodes the second example (<code >& amp; quot;</code >) to <code >" </code > (a single double quote),
6262which is not correct.
6363</p >
6464
You can’t perform that action at this time.
0 commit comments