From ${URL} : This is in cairo-1.14.6 This has already been reported on oss-security, although there is no analysis there and as yet there is no CVE: http://www.openwall.com/lists/oss-security/2016/10/06/1 The repro uses: rsvg-convert -o crash.png crash.svg The crash happens because write_png passes invalid (off by 4GByte) pointers to libpng. The bug is in the declaration of _cairo_image_surface which obviously won't work on a machine with a 64-bit address space and 32-bit (int) values. The crash is 'just' a read from the invalid pointer inside libpng, however there is at least one other case of the loop in read_png where the crash would be a memory overwrite with data from the PNG; that version has been semi-fixed. I'm not posting a detailed analysis because I'm not sure how many places the bug is exposed and it is pretty clear given the fact that the loop in read_png is different that you already know about one instance of this bug. The libpng maintainer has a copy of my complete analysis and the original SVG, I suggest not posting it at the moment because it took me about 4 minutes to find the problem given the SVG. I also suspect it isn't specific to SVG; I assume the read_png change came from test jockeys hitting Cairo with various obvious PNG files, they tend to not test SVG anywhere near as much. The fix is to change 'stride' in the surface to (size_t), and preferably width/height to (uint32_t) and depth to (unsigned). Doing that will reveal all cases of the bug given a sufficiently high warning level. @maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
I think this is now CVE-2016-9082.
Update: Even when the bug points to version 1.14.6, the error persists till actual version. There has been no update from upstream since last proposed patch, it is not a perfect solution, but it helps to avoid some of the problems. RedHat has already marked it as NONFIX and 703 packages from the tree depend on cairo. @Maintainers: could you let us know if the proposed patch could be applied here? thanks
Upstream patch: https://cgit.freedesktop.org/cairo/commit/?id=38fbe621cf80d560cfc27b54b5417b62cda64c8a Upstream v1.15.10 or newer has this patch.
This is fixed in 1.16.0 which is stable on all arches. No older versions remain in tree.
This issue was resolved and addressed in GLSA 201904-01 at https://security.gentoo.org/glsa/201904-01 by GLSA coordinator Aaron Bauman (b-man).