Skip to content

Commit

Permalink
Merge pull request from GHSA-h6m7-j4h3-9rf5
Browse files Browse the repository at this point in the history
Sanitize request input before passing it to expression language evaluator
  • Loading branch information
pamil authored Aug 18, 2020
2 parents 1bea002 + f897346 commit 73d9aba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Bundle/Grid/Parser/OptionsParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private function parseOptionExpression(string $expression, Request $request)
$expression = (string) preg_replace_callback('/\$(\w+)/', function (array $matches) use ($request) {
$variable = $request->get($matches[1]);

return is_string($variable) ? sprintf('"%s"', $variable) : $variable;
return is_string($variable) ? sprintf('"%s"', addslashes($variable)) : $variable;
}, $expression);

return $this->expression->evaluate($expression, ['container' => $this->container]);
Expand Down

0 comments on commit 73d9aba

Please # to comment.