Repository navigation
Conversation
|
Thanks for this. The three changes are unrelated, touch different modules and will need separate review rounds and separate release notes, so please split this PR into three, each with its own Jira ticket:
Review comments will follow on each PR separately. Thanks! |
AbstractMatcher/ActionConfigMatcher: a wildcard "{n}" substituted into an
action/result/exception-mapping class= attribute was unconfined, unlike the
sibling method-name slot (ActionConfig#isAllowedMethod). A substituted segment
containing '.' or '/' is now rejected rather than used verbatim.
Reachable only if a developer writes a wildcard mapping with a substituted
class name -- application-responsibility, not a default-config issue.
Tests: WildcardClassNameHardeningTest (new, 2 tests). Full core suite:
3742/0 failures.
ec24682 to
6619965
Compare
|
Done -- this PR is now narrowed to just the wildcard class-name item (6619965), title/description updated to match. #2116 is open against WW-5840 for the upload file name item. Still working on a new ticket for the Boot session tracking item before opening its PR. Will update WW-5839's Jira description to match too. |
|
I took a closer look at this change. The approach makes sense, but I noticed a few things worth considering before merging. The main concern is how rejected wildcard values are handled. Right now, an invalid segment gets replaced with an empty string, but the match still succeeds. For example, A couple of smaller things:
Overall, I think this is useful hardening. I'd mainly like to see the rejected-wildcard behavior addressed so we don't accidentally resolve to another valid class. |
A rejected value used to become an empty string and the match still
succeeded, so 'actions.{1}Action' with 'util.Harmless' resolved to
'actions.Action'. The whole match now fails, as it does for a
disallowed method name. Result and exception-mapping class names get
the same check, Unicode letters and digits are accepted, and tests pin
the result/exception slots and the literal handling of '$' and '\'.
|
Thanks for the review. Addressed in f6d5aef:
Full |
Fixes WW-5839
AbstractMatcher/ActionConfigMatcher: a wildcard{n}substituted into an action/result/exception-mappingclass=attribute was unconfined, unlike the sibling method-name slot (ActionConfig#isAllowedMethod). A substituted value containing anything other than a letter, digit,_or$(in particular.or/) now makes the whole match fail, as a disallowed method name does.Reachable only if a developer writes a wildcard mapping with a substituted class name -- application-responsibility, not a default-config issue.
Verified:
WildcardClassNameHardeningTest(new, 6 tests: action, result and exception-mapping class names, non-ASCII and$identifiers, literal$/\substitution, method-name control). Fullcore: 3746/0 failures.