
BDulla814157 (Community Member) asked a question.
var response = await httpClient.GetStringAsync(httpClient.BaseAddress);
i have an issue with the above line of code, Can anyone fix this issue

BDulla814157 (Community Member) asked a question.
var response = await httpClient.GetStringAsync(httpClient.BaseAddress);
i have an issue with the above line of code, Can anyone fix this issue
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.
Hello @BDulla814157 (Community Member) ,
Veracode Static Analysis reports flaws of CWE-918 Server-Side Request Forgery (SSRF) when it detects a HTTP Request that is sent out from the application, containing input from outside of the application (for example from a HTTP Request, a value from a file, a database result, webservice response, etc.).
The concern is that an attacker might be able to abuse this input, to change the request being done to access (internal) resources that they should not have access to. In the above scenario, the BaseAddress was probably retrieved from a property file/database or contains user derived data that could have been potentially modified or tampered. For more information on the risk for this flaw please see: https://www.owasp.org/index.php/Server_Side_Request_Forgery and https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html
The only thing that Veracode Static Analysis will automatically detect as a remediation for this flaw category is to change the tainted variable to be a hardcoded URL value. If this is not possible, we recommend that you apply dynamic validation on the URL(as a combination of an allowed list of valid hostnames and regex pattern checks on input parameters that are appended to the URL) . But this will not be automatically detected by Veracode Static Analysis and must then be documented in a Mitigation by Design mitigation proposal and reviewed by your security team.
You can find more information on how to do mitigation proposals on our helpcentre: https://docs.veracode.com/r/improve_mitigation
Regards,
Sounderya
What I am doing here still got not solution.