File tree Expand file tree Collapse file tree
javascript/ql/src/Security/CWE-094 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 <overview >
77 <p >
88 Using string concatenation to construct JavaScript code can be error-prone, or in the worst
9- case enable code- injection if an input is constructed by an attacker.
9+ case, enable code injection if an input is constructed by an attacker.
1010 </p >
1111 </overview >
1212
2020
2121 <example >
2222 <p >
23- The below example constructs a function that assigns the number 42 to the property <code >key</code >
23+ The example below constructs a function that assigns the number 42 to the property <code >key</code >
2424 on an object <code >obj</code >. However, if <code >key</code > contains <code >< /script> </code >, then
2525 the generated code will break out of a <code >< script> </code > if the generated code is inserted
2626 into a <code >< script> </code > tag.
2727 </p >
2828 <sample src =" examples/ImproperCodeSanitization.js" />
2929 <p >
30- The issue has been fixed in the below by escaping potentially dangerous characters.
30+ The issue has been fixed by escaping potentially dangerous characters, as shown below .
3131 </p >
3232 <sample src =" examples/ImproperCodeSanitizationFixed.js" />
3333 </example >
You can’t perform that action at this time.
0 commit comments