mirror of
https://github.com/github/codeql.git
synced 2026-01-05 10:40:21 +01:00
23 lines
843 B
Plaintext
23 lines
843 B
Plaintext
/**
|
|
* @name Polynomial regular expression used on uncontrolled data
|
|
* @description A regular expression that can require polynomial time
|
|
* to match user-provided values may be
|
|
* vulnerable to denial-of-service attacks.
|
|
* @kind path-problem
|
|
* @problem.severity warning
|
|
* @precision high
|
|
* @id js/polynomial-redos
|
|
* @tags security
|
|
* external/cwe/cwe-730
|
|
* external/cwe/cwe-400
|
|
*/
|
|
|
|
import javascript
|
|
import semmle.javascript.security.performance.PolynomialReDoS::PolynomialReDoS
|
|
import DataFlow::PathGraph
|
|
|
|
from Configuration cfg, DataFlow::PathNode source, DataFlow::PathNode sink
|
|
where cfg.hasFlowPath(source, sink)
|
|
select sink.getNode(), source, sink, "This expensive $@ use depends on $@.",
|
|
sink.getNode().(Sink).getRegExp(), "regular expression", source.getNode(), "a user-provided value"
|