Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Metadata Potentially Exposed (From ZAP Scan) #268

Open
DmByK opened this issue Sep 6, 2024 · 0 comments
Open

Cloud Metadata Potentially Exposed (From ZAP Scan) #268

DmByK opened this issue Sep 6, 2024 · 0 comments
Labels
code-quality Improves the code quality but no functionality

Comments

@DmByK
Copy link
Contributor

DmByK commented Sep 6, 2024

After Zap Scan one high-risk vulnerability was found

Description

The Cloud Metadata Attack attempts to abuse a misconfigured NGINX server in order to access the instance metadata maintained by cloud service providers such as AWS, GCP and Azure.

All of these providers provide metadata via an internal unroutable IP address '169.254.169.254' - this can be exposed by incorrectly configured NGINX servers and accessed by using this IP address in the Host header field.

URL http://localhost:4200/latest/meta-data/
Based on the successful response status code cloud metadata may have been returned in the response. Check the response data to see if any cloud metadata has been returned. The meta data returned can include information that would allow an attacker to completely compromise the system.

Solution
Do not trust any user data in NGINX configs. In this case it is probably the use of the $host variable which is set from the 'Host' header and can be controlled by an attacker.
Suggestion from StackHawk https://docs.stackhawk.com/vulnerabilities/90034/

Reference https://blog.nginx.org/blog/trust-no-one-perils-of-trusting-user-input

@DmByK DmByK added the code-quality Improves the code quality but no functionality label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Improves the code quality but no functionality
Projects
None yet
Development

No branches or pull requests

1 participant