Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

[Aikido] AI Fix for HTTP request might enable SSRF attack - #21

Draft
aikido-autofix[bot] wants to merge 1 commit into
masterfrom
fix/aikido-security-sast-8899088-1Vct
Draft

[Aikido] AI Fix for HTTP request might enable SSRF attack#21
aikido-autofix[bot] wants to merge 1 commit into
masterfrom
fix/aikido-security-sast-8899088-1Vct

Conversation

@aikido-autofix

Copy link
Copy Markdown

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.

Comment thread src/axiosOptions.js

const axiosGet = (url, params, config) =>
axios.get(url, { ...config, params, validateStatus: () => true })
axios.get(validateUrl(url), { ...config, params, validateStatus: () => true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/axiosOptions.js

const axiosPost = (url, body, config) =>
axios.post(url, body, { ...config, validateStatus: () => true })
axios.post(validateUrl(url), body, { ...config, validateStatus: () => true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/axiosOptions.js

const axiosPut = (url, body, config) =>
axios.put(url, body, { ...config, validateStatus: () => true })
axios.put(validateUrl(url), body, { ...config, validateStatus: () => true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/axiosOptions.js

const axiosPatch = (url, body, config) =>
axios.patch(url, body, { ...config, validateStatus: () => true })
axios.patch(validateUrl(url), body, { ...config, validateStatus: () => true })

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/axiosOptions.js

const axiosDelete = (url, body, config) =>
axios.delete(url,
axios.delete(validateUrl(url),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants