The vulnerability lies in the lack of input validation for the size parameter used in image resizing operations, leading to a denial of service. The analysis of the security advisory and the associated patch confirms this. The patch was identified by comparing the git tags for the last vulnerable version (v0.59.0) and the first patched version (v0.60.0). The key commit, 77367548f6a255cd5f182b09633e5208b49a5a72, modifies the core/artwork/reader_resized.go file.
The root cause is in the artwork.resizeImage function, which, before the patch, would attempt to resize an image to any given size. The fix involves adding a check to clamp the requested size to the original image's dimensions, thus preventing excessive memory allocation from upscaling attempts.
Two main HTTP handlers act as entry points for this vulnerability:
SubsonicAPI.getCoverArt, which handles the /rest/getCoverArt endpoint for authenticated users.
PublicAPI.getSharedImage, which handles the /share/img/<token> endpoint for shared images.
Both functions extract the size parameter from the HTTP request and pass it down to the artwork processing service without validation. An attacker can exploit this by sending a request to either endpoint with an extremely large value for the size parameter, triggering the vulnerability in artwork.resizeImage, causing the server to run out of memory and crash, or fill up the disk with oversized cached images.