
ABattu219578 (Community Member) asked a question.

ABattu219578 (Community Member) asked a question.
Ask the Community
Get answers, share a use case, discuss your favorite features, or get input from the community.
By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts.
.png)
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.
Hi @ABattu219578 (Community Member)
Untrusted input is used in the creation of a web-request which possibly allows an attacker to perform unauthorized requests to internal or external systems. An attacker can use this to interact with internal services or disclose information or even local server files
-Many app will take URL from user and do processing with it (for e.g. imagine a reporting dashboard, with ability to take URI and pull CSV data, it makes web request and updates your dashboard.)
-it can go wrong many for e.g. if entered URI is "file:///etc/passwd" , you may be able to directly read files from the server,if it is not handled properly.
-this may also lead to requesting some internal services that the attacker would never be able to ordinarily access due to firewall rules
-attacker can also port scan the entire network. (if the req is returned immediately, it means port is closed, if it hangs for few seconds it means port is open but cannot handle http requests.) -->> this can leads to extensive map of the network infrastructure and provide attackers with the information required to jump to other hosts.
-They are pretty common but difficult to find them.
Well the issue is that the request's URL is provided by a configuration setting which is considered untrusted since the file would need to have appropriate access controls and follow a principle of least privilege. On top of that, since this is a configurable URL, it may be worth adding additional input validation on the base URL provided, such as ensuring the expected protocol is used (HTTPS), however, at the end of the day the issue boils down to is the host correct, so ensuring the constructed URL has the expected domain and port.
Mitigations can be combined to severely limit these attacks:
a) Validate the untrusted data used to create the web-request and, additionally, validate the end-result URL before performing the request.
b) Whitelist a small number of domains & hosts and allow requests only to those.
c) Limit connections to only port 80 (For Http URL) and port 443 (for https) to prevent port scanning.
d) DNS Resolution: Resolve the IP of the target host, to ensure that IP is for that external host. (and not the internal IP)
e) Disable access to any protocol other than HTTP and HTTPS
If you still have questions I would recommend you schedule a consultation call to discuss.
You can check out this knowledge article (https://community.veracode.com/s/article/How-to-schedule-a-consultation-call) on how to schedule a consultation call with us.
Regards,
Kashif