Hi, During Security analysis of an application which uses Apache Camel Servlet Component following issues. You are looking forward to its resolution or work around.
1. Issue: Unrestricted File Upload Source Code: /org/apache/camel/component/servlet/AttachmentHttpBinding.java (Line 81) Description:- It was observed that the application does not apply thorough validation checks on the uploaded file, especially with regards to the file type or contents. Impact:- An attacker that exploits this vulnerability would be able to cause the application server to execute arbitrary code, allowing the attacker to alter the application, run any operating system command, and even take over the server altogether, depending on the applications system privileges. Recommendation:- It is recommended to always validate all user input. In particular, enforce a whitelist of allowed file-types, according to the file extension. 2. Issue: Information Exposure Through an Error Message Source Code: /org/apache/camel/component/servlet/CamelServlet.java (Line 277) Description:- The application generates an error message including raw exceptions, either by not being handled, by explicit returning of the object, or by configuration. Exception details may include sensitive information that could leak out of the exception to the users. Impact:- Exposed details about the application's environment, users, or associated data (for example, stack trace) could enable an attacker to find another flaw and help the attacker to mount an attack. Recommendation:- It is recommended that any method that could cause an exception should be wrapped in a try-catch block that: 1. Explicitly handles expected exceptions. 2. Includes a default solution to explicitly handle unexpected exceptions. Further, it is recommended to configure a global handler to prevent unhandled errors from leaving the application. Regards, Sougata This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.