Status: reasoned from code
lib/Dancer2/Core/Route.pm:63:
croak "Not a valid option for route matching: `$opt'"
if not( grep {/^$opt$/} @supported_options );
$opt is a hash key interpolated straight into a pattern.
Impact
- An option named
. matches every supported option and defeats the validation entirely.
- An option containing regex metacharacters dies with a regex compile error instead of the intended message.
- It recompiles a pattern per option per route.
Developer-supplied rather than request-supplied, so this is correctness rather than security.
Suggested fix
if ( not grep { $_ eq $opt } @supported_options ) {
Strictly better and faster.
Status: reasoned from code
lib/Dancer2/Core/Route.pm:63:$optis a hash key interpolated straight into a pattern.Impact
.matches every supported option and defeats the validation entirely.Developer-supplied rather than request-supplied, so this is correctness rather than security.
Suggested fix
Strictly better and faster.