With the recently published Lucee vulnerabilities ...
# lucee
d
With the recently published Lucee vulnerabilities (https://www.hoyahaxa.com/2024/02/thinking-defensively-about-three-recent.html), I see that the RCE issue with isDefined(), structGet() and empty() can be prevented using the new
lucee.security.limitEvaluation
environment property, but it requires Lucee 5.4.5.8 or higher, which are currently only available as Snapshots. Any idea when a production release of 5.4.5.x will be made?
s
I second that - will it be available as a version 5.x fix?
b
Even if you're not patched - you can avoid being vulnerable/exploitable by not passing user-controlled input to those functions, and by configuring the client management/client storage settings as described. That was the gist of what I was trying to get across in the post.
πŸ‘πŸΌ 1
d
@Brian Reilly Good point. Our servers are actually not vulnerable to these issues today, but you never know what tomorrow might bring. πŸ™‚ I'd rather get them locked down so that if some code that would be vulnerable gets added in the future, we're still protected.
πŸ‘πŸΌ 1
b
@dswitzer yup - agree completely πŸ™‚
a
Question, does the new setting fix the issue, or does it just block any possible isdefined()-vulnerabel cfml code, such as isdefined(url.something)? @dswitzer
d
@Andreas No clue. I haven't tested it, since it's still just in a SNAPSHOT release.
It would be great if we could get an official stance on when this patch might be released. @gert anything you can share?
a
I'm going go check myself.
g
All I know from the dev team is that they prepare a release, but no clue as of when it will be released. You’re right, it was patched in 5.4.5.8. I will see I get some more info on when the release for 5.4.5.x will be out
b
@Andreas There are a couple of vulnerabilities at play here, but I assume you're asking about the variable evaluation one. As I understand it - enabling this setting will prevent the arguments to the affected functions/tags from being evaluated as CFML code, and will instead be treated as a literal string. So with the setting enabled,
isDefined(x[imageRead('something')])
for example, would test to see if
x[imageRead('something')]
existed, versus evaluating (executing)
imageRead('something')
and testing if
x[_*OUTPUT_FROM_THAT_EVALUATED_RESULT]*_
existed
Although my understanding is based more on looking at the code/patch than exhaustively testing it
a
It just breaks the code.
That means work for such developers who have plenty of old stuff in their code, because the patch will break their app. But, it's something that must be done anyway to get rid of isdefined()
πŸ‘πŸΌ 1
d
@Andreas What do you mean by "it just breaks the code"? Does that mean something like
isDefined("url.someVar")
throws an error? Or does it mean something like
isDefined('url.#someDynamicVar#')
does not evaluate
#someDynamicVar#
? I was under the assumption that it meant that when evaluating
#someDynamicVar#
it just wouldn't allow
#someDynamicVar#
to point to some other path so that it could not evaluate to something like ``isDefined('url.form.someVar')`` if
#someDynamicVar#
was equal to
form.someVar
.
b
Yeah - it looks like it throws an
invalid syntax, variables are not supported.
exception -
I can't say when you might legitimately want variable evaluation in this type of situation, but evaluation of user-controlled data is always going to be dangerous / a bad idea
d
Does it work with variables that are not in public scopes (i.e.
#variables.someVar#
) or does it throw the same error.
b
Quick testing -
variables.someVar = 'test';
- no exception
variables.someVar = 'test[x]';
- exception
I see that the Masa patch added a check like
isValid('variableName',the.var)
-- so that may be a way to go here, in terms of fixing any custom code -- in addition to enabling the Lucee setting to limit evaluation
πŸ™ 1
πŸ™ŒπŸΌ 1
though replacing
isDefined()
with
structKeyExists()
may be better. I'm out of my depth in terms of code quality issues πŸ˜‚