Skip to content

Commit

Permalink
change-notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwstubbs committed Aug 27, 2024
1 parent 0420d25 commit 812abea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/ql/lib/semmle/python/frameworks/FastApi.qll
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ module FastApi {
private class AddMiddlewareCall extends DataFlow::CallCfgNode {
AddMiddlewareCall() { this = App::instance().getMember("add_middleware").getACall() }

/**
* Gets the string corresponding to the middleware
*/
string middleware_name() { result = this.getArg(0).asExpr().(Name).toString() }
}

Expand Down
3 changes: 3 additions & 0 deletions python/ql/lib/semmle/python/frameworks/Starlette.qll
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ module Starlette {
this = [App::instance().getMember("add_middleware").getACall(), Middleware::instance()]
}

/**
* Gets the string corresponding to the middleware
*/
string middleware_name() { result = this.getArg(0).asExpr().(Name).toString() }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: newQuery
---
* The `py/insecure-cors-setting` query, which finds insecure CORS middleware configurations.

0 comments on commit 812abea

Please sign in to comment.