Skip to content

Commit

Permalink
Express Argument has to be Cors
Browse files Browse the repository at this point in the history
  • Loading branch information
maikypedia committed Dec 7, 2023
1 parent 83cbbd7 commit 87cac2a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion javascript/ql/lib/semmle/javascript/frameworks/Express.qll
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,13 @@ module Express {
* An express route setup configured with the `cors` package.
*/
class CorsConfiguration extends DataFlow::MethodCallNode {
CorsConfiguration() { exists(Express::RouteSetup setup | this = setup | setup.isUseCall()) }
CorsConfiguration() {
exists(Express::RouteSetup setup | this = setup |
setup.isUseCall() and setup.getArgument(0) instanceof Cors::Cors
or
not setup.isUseCall() and setup.getAnArgument() instanceof Cors::Cors
)
}

/** Gets the cors argument */
Cors::Cors getArgument() { result = this.getArgument(0) }
Expand Down

0 comments on commit 87cac2a

Please sign in to comment.