
CIraheta403878 (Community Member) asked a question.

CIraheta403878 (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 @CIraheta403878 (Community Member),
Thanks for your question.
If you made a change to the code so the application no longer outputs generic error messages and find the Veracode Platform is still reporting this flaw after re-packaging, re-uploading and re-scanning the application, then it is most likely there will be another instance of the flaw occurring. This could be within a different parameter on the same line, or on a different line entirely for example. I recommend reviewing the flaw description which should help you to identify the source.
If you would like assistance with remediating the flaw I recommend scheduling a consultation with a Veracode Application Security Consultant. You can find details on how to schedule a consultation here: https://help.veracode.com/reader/DGHxSJy3Gn3gtuSIN2jkRQ/7YQTCDJKFEQzL3gL_N90hQ.
If you think the Veracode Platform is incorrectly reporting this flaw I recommend you contact our technical support team. Here's how you can log a case:
Thanks,
Anthony Fielding
I modified my code like this:
httpPost = new HttpPost(endpointUrl);
httpPost.setEntity(stringEntity);
httpPost.setConfig(requestConfig);
httpPost.setHeaders(headers.toArray(new Header[headers.size()]));
try {
response2 = httpClient.execute(httpPost);
if (response2.getStatusLine().getStatusCode()!=200) {
response = factory.newHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, null), null);
response.setEntity(new StringEntity("Error en el llamado"));
} else {
response = factory.newHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, response2.getStatusLine().getStatusCode(), null), null);
response.setEntity(response2.getEntity());
}
} catch (Exception e) {
logger.excepcion(e);
response = factory.newHttpResponse(new BasicStatusLine(HttpVersion.HTTP_1_1, HttpStatus.SC_INTERNAL_SERVER_ERROR, null), null);
response.setEntity(new StringEntity("Error en el llamado"));
}
But still the same error, any ideas?
Hi @CIraheta403878 (Community Member),
Thank you for your code snippet. I can see in the catch statement it appears you are returning a generic error message to the user, however I suspect the flaw may lie in the use of logger.excepcion(e). Whilst this exception may not be presented to the user, is it possible that sensitive data such as HTTP POST form parameters could be stored within the exception which might then be logged?
If this logging event could be made more generic (i.e. don't include the exception if possible), the Veracode Platform should close the flaw as remediated.
Thanks,
Anthony