[Aikido] AI Fix for HTTP request might enable SSRF attack - #21
[Aikido] AI Fix for HTTP request might enable SSRF attack#21aikido-autofix[bot] wants to merge 1 commit into
Conversation
|
|
||
| const axiosGet = (url, params, config) => | ||
| axios.get(url, { ...config, params, validateStatus: () => true }) | ||
| axios.get(validateUrl(url), { ...config, params, validateStatus: () => true }) |
There was a problem hiding this comment.
HTTP request might enable SSRF attack - medium severity
If an attacker can control the URL input leading into this http request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous is the application returns the result of the URL fetch to the user. It can serve as an initial access point for an attacker for stealing credentials in the cloud.
Remediation: If possible, only allow requests to verified domains. If not, consult the article linked above to learn about other mitigating techniques such as disabling redirects, blocking private IPs and making sure private services have internal authentication. If you return data coming from the request to the user, validate the data before returning it to make sure you don't return random data.
View details in Aikido Security
|
|
||
| const axiosPost = (url, body, config) => | ||
| axios.post(url, body, { ...config, validateStatus: () => true }) | ||
| axios.post(validateUrl(url), body, { ...config, validateStatus: () => true }) |
There was a problem hiding this comment.
HTTP request might enable SSRF attack - medium severity
If an attacker can control the URL input leading into this http request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous is the application returns the result of the URL fetch to the user. It can serve as an initial access point for an attacker for stealing credentials in the cloud.
Remediation: If possible, only allow requests to verified domains. If not, consult the article linked above to learn about other mitigating techniques such as disabling redirects, blocking private IPs and making sure private services have internal authentication. If you return data coming from the request to the user, validate the data before returning it to make sure you don't return random data.
View details in Aikido Security
|
|
||
| const axiosPut = (url, body, config) => | ||
| axios.put(url, body, { ...config, validateStatus: () => true }) | ||
| axios.put(validateUrl(url), body, { ...config, validateStatus: () => true }) |
There was a problem hiding this comment.
HTTP request might enable SSRF attack - medium severity
If an attacker can control the URL input leading into this http request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous is the application returns the result of the URL fetch to the user. It can serve as an initial access point for an attacker for stealing credentials in the cloud.
Remediation: If possible, only allow requests to verified domains. If not, consult the article linked above to learn about other mitigating techniques such as disabling redirects, blocking private IPs and making sure private services have internal authentication. If you return data coming from the request to the user, validate the data before returning it to make sure you don't return random data.
View details in Aikido Security
|
|
||
| const axiosPatch = (url, body, config) => | ||
| axios.patch(url, body, { ...config, validateStatus: () => true }) | ||
| axios.patch(validateUrl(url), body, { ...config, validateStatus: () => true }) |
There was a problem hiding this comment.
HTTP request might enable SSRF attack - medium severity
If an attacker can control the URL input leading into this http request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous is the application returns the result of the URL fetch to the user. It can serve as an initial access point for an attacker for stealing credentials in the cloud.
Remediation: If possible, only allow requests to verified domains. If not, consult the article linked above to learn about other mitigating techniques such as disabling redirects, blocking private IPs and making sure private services have internal authentication. If you return data coming from the request to the user, validate the data before returning it to make sure you don't return random data.
View details in Aikido Security
|
|
||
| const axiosDelete = (url, body, config) => | ||
| axios.delete(url, | ||
| axios.delete(validateUrl(url), |
There was a problem hiding this comment.
HTTP request might enable SSRF attack - medium severity
If an attacker can control the URL input leading into this http request, the attack might be able to perform an SSRF attack. This kind of attack is even more dangerous is the application returns the result of the URL fetch to the user. It can serve as an initial access point for an attacker for stealing credentials in the cloud.
Remediation: If possible, only allow requests to verified domains. If not, consult the article linked above to learn about other mitigating techniques such as disabling redirects, blocking private IPs and making sure private services have internal authentication. If you return data coming from the request to the user, validate the data before returning it to make sure you don't return random data.
View details in Aikido Security
This patch mitigates SSRF vulnerabilities by implementing URL validation that restricts requests to allowed domains and validates URL protocols before making HTTP requests.
Aikido used AI to generate this PR.
Medium confidence: Aikido has validated similar fixes and observed positive outcomes. Validation is required.