Visitar URL original
Azure python sdk url summary upstream by bdrodes · Pull Request #20563 · github/codeql · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update python/ql/lib/semmle/python/frameworks/SSRFSink.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
  • Loading branch information
bdrodes and Copilot authored Sep 30, 2025
commit 5ca9ff2082e122763c2afdec34023636af6dfd0f
2 changes: 1 addition & 1 deletion python/ql/lib/semmle/python/frameworks/SSRFSink.qll

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file doesn't really match the way the rest of the repo is structured. Normally this kind of code would go in python/ql/lib/semmle/python/security/dataflow/ServerSideRequestForgeryCustomizations.qll, but then it would only affect just the two SSRF queries. Since these models are principally adding to Http::Client::Request::Range, and only indirectly becoming SSRF sinks, it might make more sense to put them somewhere like python/ql/lib/semmle/python/Concepts.qll, maybe just below line 1658 import ConceptsShared::Http::Client as Client.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(And I would name the class HttpClientRequestFromModel.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this is my only remaining issue. There is also the philosophical question of whether all SSRF sinks really are client requests. If we had MaD for concepts, we could do this the other way round: Make all these models be client requests (with appropriate frameworks and certificate validation) and then they would be imported into the query automatically (and the query would decide that all client requests are SSRF sinks).

But for now, following the suggestion with HttpClientRequestFromModel would be ok.

@bdrodes bdrodes Feb 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just pushed a change for this. The class was moved and renamed as suggested. I did remove it from a module though. Let me know how this looks.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
private import python

Check warning on line 1 in python/ql/lib/semmle/python/frameworks/SSRFSink.qll

View workflow job for this annotation

GitHub Actions / qldoc

Missing QLdoc for file SSRFSink
private import semmle.python.Concepts
private import semmle.python.ApiGraphs
private import semmle.python.frameworks.data.ModelsAsData
Expand All @@ -6,10 +6,10 @@
/**
* INTERNAL: Do not use.
*
* Sets up SSRF sinks as Http::CLient::Request
* Sets up SSRF sinks as Http::Client::Request
*/
module SSRFMaDModel {
Comment thread Fixed
class SSRFSink extends Http::Client::Request::Range instanceof API::CallNode {

Check warning on line 12 in python/ql/lib/semmle/python/frameworks/SSRFSink.qll

View workflow job for this annotation

GitHub Actions / qldoc

Missing QLdoc for class SSRFSink::SSRFMaDModel::SSRFSink
Comment thread Fixed
DataFlow::Node urlArg;

SSRFSink() {
Expand Down
Loading