bito-code-review[bot] commented on code in PR #40454:
URL: https://github.com/apache/superset/pull/40454#discussion_r3309597142


##########
superset/db_engine_specs/impala.py:
##########
@@ -209,6 +211,10 @@ def cancel_query(cls, cursor: Any, query: Query, 
cancel_query_id: str) -> bool:
         """
         try:
             impala_host = query.database.url_object.host
+            resolved = ipaddress.ip_address(socket.gethostbyname(impala_host))

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>CWE-918: SSRF Check Incomplete</b></div>
   <div id="fix">
   
   SSRF check only validates the first DNS result; an attacker controlling DNS 
could bypass by placing a public IP first. Use `socket.getaddrinfo()` to 
enumerate all resolved IPs. (See also: 
[CWE-918](https://cwe.mitre.org/data/definitions/918.html))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #b5e020</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to