Prevent Arbitrary code execution via crafted environment variables#11984
Prevent Arbitrary code execution via crafted environment variables#11984abstractj wants to merge 1 commit intokeycloak:mainfrom abstractj:issue-11983
Conversation
abstractj
commented
May 13, 2022
- Avoid the usage of eval
- Suppress error messages without suppressing the error code
- Avoid the usage of eval - Suppress error messages without suppressing the error code Resolves #11983
SecKatie
left a comment
There was a problem hiding this comment.
LGTM. Eval is generally an anti-pattern
There was a problem hiding this comment.
@abstractj Seems this leads to the command not being invoked correctly anymore from looking at the tests. Can you please check?
|
IIRC, Wildfly also uses Looks like the changes break the script and fails to start the server. I'm kinda lacking an alternative here :) |
|
@pedroigor jump to pure java instead of scripts? (fun for now, but only half. we should really go down that path) But yeh, i tried it out locally and the server starts but nothing gets logged anymore. the newest changes are also not doing the trick, at least not locally here and also not in the CI -> https://github.com/keycloak/keycloak/runs/6453217301?check_suite_focus=true#step:8:4177 Option 1: Really go down the pure java path. (+1 from my side) |
|
TBH, I would just leave it as-is for now. We should probably reach out Wildfly team to understand why they are using it as I wouldn't be surprised at all if they had this discussion before. Not sure if we can do #1 now but yes we should consider it in the future after a lot of discussions :) |
|
@DGuhr @pedroigor thanks for reviewing it. Converted to a draft for now. All the 3 options are valid, and I would say that this is issue has The reason why we see so many failures is that the changes proposed swallow most of the error messages, that can be changed. If you would like, I can look at the test failures this week, and propose a fix. Otherwise, I can close this PR, and leave the GH issue opened until we reach a conclusion. |
|
@abstractj when we can improve this, we should imo improve it, so sure, go for it :) Just to clarify: When I tried your PR branch locally, not only the errors were not showing (e.g. running ./kc.sh start-dev) but I got no console output at all, but the server started normally "in the background". That's also reflected in the test results, see e.g. https://github.com/keycloak/keycloak/runs/6425900016?check_suite_focus=true#step:8:5753 this run. But +1 to low impact. |