You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently did stumble today over some issue in my code base which I think would be interesting for every project. I have a controller which used the UriSigner to check for a correclty signed Uri.
Actually the UriSigner itself does not throw any exception. So calling it without do anything basically is a Security issue in some projects.
Valid cases would be:
// write the result atleast in a variable$isValid = $this->uriSigner->checkRequest($request);
// usage in a if statementif (!$this->uriSigner->checkRequest($request)) {
thrownewAccessDeniedHttpException('The given uri is not valid.');
}
// usage in complex if statementsif (!$this->uriSigner->checkRequest($request) && !$request->attributes->getBoolean('simulate')) {
thrownewAccessDeniedHttpException('The given uri is not valid.');
}
// usage in method calls$this->validate($this->uriSigner->checkRequest($request));
Invalid would be calling it like a void method:
$this->uriSigner->checkRequest($request);
I'm not sure maybe if there already exist some kind of annotations we could add to the Symfony UriSigner that the result need to be handled and the method not be used like a void method.
The text was updated successfully, but these errors were encountered:
I currently did stumble today over some issue in my code base which I think would be interesting for every project. I have a controller which used the UriSigner to check for a correclty signed Uri.
Actually the UriSigner itself does not throw any exception. So calling it without do anything basically is a Security issue in some projects.
Valid cases would be:
Invalid would be calling it like a void method:
I'm not sure maybe if there already exist some kind of annotations we could add to the Symfony UriSigner that the result need to be handled and the method not be used like a void method.
The text was updated successfully, but these errors were encountered: