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
/** * @name Code injection * @description Interpreting unsanitized user input as code allows a malicious user arbitrary * code execution. * @kind path-problem * @problem.severity error * @security-severity 9.3 * @precision high * @id js/code-injection * @tags security * external/cwe/cwe-094 * external/cwe/cwe-095 * external/cwe/cwe-079 * external/cwe/cwe-116 */import javascript
import semmle.javascript.security.dataflow.CodeInjectionQuery
import CodeInjectionFlow::PathGraph
from CodeInjectionFlow::PathNodesource, CodeInjectionFlow::PathNodesinkwhere CodeInjectionFlow::flowPath(source,sink)selectsink.getNode(),source,sink,sink.getNode().(Sink).getMessagePrefix()+" depends on a $@.",source.getNode(),"user-provided value"
However this is caught using the old deprecated Configuration method:
/** * @name Code injection * @description Interpreting unsanitized user input as code allows a malicious user arbitrary * code execution. * @kind path-problem * @problem.severity error * @security-severity 9.3 * @precision high * @id js/code-injection * @tags security * external/cwe/cwe-094 * external/cwe/cwe-095 * external/cwe/cwe-079 * external/cwe/cwe-116 */import javascript
import semmle.javascript.security.dataflow.CodeInjectionQuery
import DataFlow::PathGraph
fromConfigurationcfg, DataFlow::PathNodesource, DataFlow::PathNodesinkwherecfg.hasFlowPath(source,sink)selectsink.getNode(),source,sink,sink.getNode().(Sink).getMessagePrefix()+" depends on a $@.",source.getNode(),"user-provided value"
I believe this is due to the source not propagating through URLSearchParams. Removing URLSearchParams and simply setting userInput = window.location.search allows this vulnerability to be caught.
The text was updated successfully, but these errors were encountered:
I noticed that this very simple code injection example is longer caught in the latest release.
This CodeInjection query fails to catch this:
However this is caught using the old deprecated Configuration method:
I believe this is due to the source not propagating through URLSearchParams. Removing URLSearchParams and simply setting
userInput = window.location.search
allows this vulnerability to be caught.The text was updated successfully, but these errors were encountered: