Repository navigation
v0.9.0
Security
-
A request for a size no longer gets past the name checks with a trailing newline or another control character (the
$of the patterns matched before a final newline): it is a 404 before anything reaches the storage, where it used to end in a 500. The route and the name parser now anchor withD. The guarantee that only declared, signed sizes are ever made is now locked byDeclaredSizesContractTest(SEC-06) -
The remaining name checks anchor with
Dtoo: a size declared ascardfollowed by a newline is refused (it was accepted), the size segment of an imgproxy URL, the sizes already made that stand in for one that cannot be made, and the parent lookup of an extra width ignore a name ending with a newline. The pruner compares a file signature withhash_equals()instead of!==(SEC-06) -
The id of a Bunny pull zone (it goes into the URL of the Bunny API) no longer accepts a trailing newline:
"1234\n"was accepted by/^\d+$/and is now refused before any request. The loopback host check of the thumbnail export and the multisite folder match of the uploads base anchor withDtoo, as defence in depth (a host parsed byparse_url()and a WordPressbasedircannot carry a newline today) (SEC-06)
Changed
- A media disk that cannot be built (
InvalidMediaConfigurationException), a thumbnail that cannot be made (ImageProcessingFailedException) and a Bunny request that fails (BunnyRequestFailedException) throw named exceptions instead of a bare\RuntimeException. They extend\RuntimeException, so acatch (\RuntimeException)keeps working, and the messages keep their wording, with a hint added where one was missing