Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SafeRequest.getParameter(String) does not return null if String is null #100

Closed
meg23 opened this issue Nov 13, 2014 · 3 comments
Closed

Comments

@meg23
Copy link

meg23 commented Nov 13, 2014

From manico.james@gmail.com on January 15, 2010 18:49:40

While doing an assessment for a client we came across an issue where the
null check was not work for their code. They had a null check based on
SafeRequest.getParameter(String). If the value was not null they did one
thing if it was they did another thing, which based on SafeRequest this
means it always will do the first thing. In their specific case they had
centralized menu code and sometimes different parameters are submitted, but
those parameters not submitted will never be null. SafeRequest and
SecurityRequestWrapper both default to setting any getParameter (including
a parameter that is not submitted) that returns null to the empty string.
This will break any applications that rely on null checks. This should be
a high priority fix as the getParameter should default to allowing null.

Original issue: http://code.google.com/p/owasp-esapi-java/issues/detail?id=90

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From jeff.wil...@gtempaccount.com on January 15, 2010 17:31:30

I agree that the SafeRequest (1.4) and SecurityRequestWrapper (2.0) seem to get this
wrong. Should we change this to make "allowNull" true? Then the underlying
getValidInput call will not throw an exception and the call will return null as it
should.

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From manico.james@gmail.com on January 15, 2010 17:33:46

Yes, I agree. I think the change is that simple Jeff. Go for it?

@meg23
Copy link
Author

meg23 commented Nov 13, 2014

From chrisisbeef on January 15, 2010 20:23:47

This issue was closed by revision r937 .

Status: Fixed
Mergedinto: -

@meg23 meg23 closed this as completed Nov 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant