Skip to content
Advertisement

Tag: security

Checkmarx – How to validate and sanitize HttpServletRequest .getInputStream to pass checkmarx scan

Following are checkmarx issue details Unrestricted File Upload Source Object : req (Line No – 39) target Object : getInputStream (Line No -41) request objects get highlighted in checkmarx tool – How do I properly validate, filter, escape, and/or encode user-controllable input to pass a Checkmarx scan? Answer This worked for me – checkmarx pass this high vulnerability I used

How to prevent reflection access only to certain classes

I am developing some licensing code, so I would like to avoid access to one or two classes through reflection. I have tried implement a SecurityManager but with no success. I found that another option would be to define my own policy file but that requires me to set it on JVM launch, and that defeats my purpose, I would

Handle Security exceptions in Spring Boot Resource Server

How can I get my custom ResponseEntityExceptionHandler or OAuth2ExceptionRenderer to handle Exceptions raised by Spring security on a pure resource server? We implemented a so whenever there is an error on the resource server we want it to answer with The resource server uses the application.properties setting: to authenticate and authorize a request against our auth server. However any spring

How to apply Spring Security filter only on secured endpoints?

I have the following Spring Security configuration: The authenticationTokenFilterBean() is applied even on endpoints that do not match /api/** expression. I also tried adding the following configuration code: but this still did not solve my problem. How can I tell Spring Security to apply filters only on endpoints that match the secured URI expression? Answer I have an application with

SSL Java java.io.IOException: Invalid keystore format

I am testing SSL in java with SSLServerSocket and other classes in the java.ssl package. When I run the following code, I get the exception java.io.IOException: Invalid keystore format. My code: File key.txt: 1268312345812304612348712634283427346 I am guessing I should put something else in the key.txt file, but I do not know what to put in it. Probably a searilized object.

Advertisement