Bug 291266 - graphics/png update to 1.6.52
Summary: graphics/png update to 1.6.52
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-desktop (Team)
URL: https://github.com/pnggroup/libpng/bl...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-28 11:54 UTC by FiLiS
Modified: 2025-12-07 17:23 UTC (History)
17 users (show)

See Also:
arrowd: maintainer-feedback+
mandree: merge-quarterly+


Attachments
patch to update png to 1.6.51 (1.52 KB, patch)
2025-11-28 11:54 UTC, FiLiS
vishwin: maintainer-approval+
Details | Diff
Patch for png (2.20 KB, patch)
2025-12-04 00:12 UTC, Daniel Engberg
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description FiLiS freebsd_committer freebsd_triage 2025-11-28 11:54:51 UTC
Created attachment 265690 [details]
patch to update png to 1.6.51

upgrade to 1.6.51 fixes 4 vulnerabilities:

- CVE-2025-64505 (moderate severity): Heap buffer overflow in png_do_quantize() via malformed palette index
- CVE-2025-64506 (moderate severity): Heap buffer over-read in png_write_image_8bit() with 8-bit input and convert_to_8bit enabled
- CVE-2025-64720 (high severity): Buffer overflow in png_image_read_composite() via incorrect palette 
- CVE-2025-65018 (high severity): Heap buffer overflow in png_combine_row() triggered via png_image_finish_read()

build works, haven't installed it anywhere yet.
Comment 1 mew14930xvi 2025-11-28 12:54:44 UTC
Changes from version 1.6.50 to version 1.6.51
https://www.libpng.org/pub/png/src/libpng-1.6.51-README.txt
Comment 2 Polarian 2025-11-28 16:51:27 UTC
Compiled and installed on my local system, thanks for the patch :)
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2025-11-29 16:07:52 UTC
LGTM, please push given "poudriere testport" passes.
Comment 4 George Mitchell 2025-11-29 17:32:01 UTC
Patch works for me, too; 14.3-RELEASE-p5.  Thanks!
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2025-11-30 07:51:24 UTC
At least do it the proper way,

Make sure that "make test" passes at least on ONE platform, request an exp-run run.
Comment 6 Charlie Li freebsd_committer freebsd_triage 2025-12-01 02:44:15 UTC
Comment on attachment 265690 [details]
patch to update png to 1.6.51

make test passes on -CURRENT amd64, there are no API/ABI changes so no exp-run is needed. This is good to go as is.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2025-12-01 20:28:04 UTC
There have been multiple issues where "it's all fine" argument has proven to be incorrect so just do it. See also https://cgit.freebsd.org/ports/commit/?id=03ac41951fa0bd09789183204293b5b4ac03dc1f
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2025-12-02 19:33:12 UTC
Exp-run request
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2025-12-04 00:12:07 UTC
Created attachment 265815 [details]
Patch for png

Fixes CVE-2025-66293 (listed as high severity by upstream)

Compile and runtime tested on FreeBSD 14.3-RELEASE (amd64) (make, make check-plist, make test)

Poudriere testport OK 13.5-RELEASE (amd64)
Poudriere testport OK 13.5-RELEASE (i386)
Poudriere testport OK 14.3-RELEASE (amd64)

VuXML entry should also be added
Comment 10 Polarian 2025-12-05 02:40:38 UTC
Thanks for the patch (again), make test passes.

As there is no vuxml for this on phab or bugzilla, I have submitted bug 291410
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-12-05 06:16:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=df1135a895c37fcc13ad9e435f48cfb3f5df5c49

commit df1135a895c37fcc13ad9e435f48cfb3f5df5c49
Author:     Polarian <polarian@polarian.dev>
AuthorDate: 2025-12-05 02:36:48 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2025-12-05 06:14:17 +0000

    security/vuxml: Out of bounds read in graphics/png

    PR: 291266, 291410

 security/vuxml/vuln/2025.xml | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
Comment 12 George Mitchell 2025-12-05 15:24:54 UTC
Whatever got committed to the ports tree DOES NOT upgrade to 1.6.52, but rather 1.6.50.  Can we perhaps try again?  Also, of course, version 1.6.52 doesn't seem to exist yet.
Comment 13 FiLiS freebsd_committer freebsd_triage 2025-12-05 15:35:45 UTC
(In reply to George Mitchell from comment #12)
1.6.52 does exist: https://sourceforge.net/projects/libpng/files/libpng16/1.6.52/
and I think, only the vuxml entry got committed, not diizzy's actual patch to upgrade the port
Comment 14 Charlie Li freebsd_committer freebsd_triage 2025-12-05 16:07:18 UTC
(In reply to George Mitchell from comment #12)
Please read the commit message again, it was for the vuxml (security disclosure file), not the port itself. This is relatively common procedure to separately commit the vuxml entry on the subject whilst referencing the bug that would update or fix the subject.

What does not exist yet is the matching libpng-apng patchset, but I suppose one is not strictly necessary apart from consistency.
Comment 15 George Mitchell 2025-12-05 17:51:56 UTC
My bad ... sorry for the noise.
Comment 16 Matthias Andree freebsd_committer freebsd_triage 2025-12-05 20:15:08 UTC
(In reply to Daniel Engberg from comment #8)
Let's stop that nonsense. We'll get pkg-fallout mail, and if things are fine, we MFH. We need to get the fix out. This is high profile.
Comment 17 commit-hook freebsd_committer freebsd_triage 2025-12-05 20:19:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f1bbe43c186c567cd96c0a5c6fd0c1a159accaf9

commit f1bbe43c186c567cd96c0a5c6fd0c1a159accaf9
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-12-05 20:15:37 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-12-05 20:18:14 +0000

    graphics/png: security update to 1.6.52

    Note this isn't the offered patch from the PR, but one that
    instead puts the APNG patch version into a variable.

    Reported by:    FiLiS
    Approved by:    desktop@ (vishwin)
    PR:             291266
    MFH:            2025Q4 (after a few days)

    png -- Multiple vulnerabilities
    Security:       CVE-2025-64505
    Security:       CVE-2025-64506
    Security:       CVE-2025-64720
    Security:       CVE-2025-65018
    Security:       4b297f5a-cbad-11f0-ac9f-b42e991fc52e

    png -- Out-of-bounds read
    Security:       CVE-2025-66293
    Security:       f323f148-d181-11f0-841f-843a4b343614

 graphics/png/Makefile  |  7 ++++---
 graphics/png/distinfo  | 10 +++++-----
 graphics/png/pkg-plist |  2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)
Comment 18 Daniel Engberg freebsd_committer freebsd_triage 2025-12-05 20:20:45 UTC
(In reply to Matthias Andree from comment #16)
Can we to have some kind of (QA) Quality Assurance instead of just pushing stuff randomly without any testing at all? If you're in a rush just import the patch in your local tree. Bypassing any kind of testing because you find it unnecessary is not the way to go.
Comment 19 Matthias Andree freebsd_committer freebsd_triage 2025-12-05 20:22:13 UTC
Over to desktop@ - please test thoroughly (ask diizzy@ for help) and when we're good, MFH to 2025Q4.

I'll send my poudriere 14.3-amd64 to build shy of 700 ports in parallel,
let's see how far that comes.
Comment 20 Matthias Andree freebsd_committer freebsd_triage 2025-12-05 20:22:54 UTC
Self-tests pass and if downstream ports break due to upstream bugfixes, we need to sort it out without leaving the ports that are good out in the rain.
Comment 21 Matthias Andree freebsd_committer freebsd_triage 2025-12-05 20:27:18 UTC
The issue has been cooking since more than four weeks, see https://cveawg.mitre.org/api/cve/CVE-2025-64505 - we can't delay such things. We've seen enough attacks and other scaretales through b0tched images before.
Comment 22 Gleb Popov freebsd_committer freebsd_triage 2025-12-06 08:54:58 UTC
(In reply to Matthias Andree from comment #20)
I'd argue that the "to exp-run or not" is up to portmgr@, not desktop@. My reply is "yes, just MFH it", FWIW.
Comment 23 commit-hook freebsd_committer freebsd_triage 2025-12-07 12:37:33 UTC
A commit in branch 2025Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b6cf7cefbe981400d989aa5f0d000e3b49f8ce50

commit b6cf7cefbe981400d989aa5f0d000e3b49f8ce50
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-12-05 20:15:37 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-12-07 12:15:28 +0000

    graphics/png: security update to 1.6.52

    Note this isn't the offered patch from the PR, but one that
    instead puts the APNG patch version into a variable.

    Reported by:    FiLiS
    Approved by:    desktop@ (vishwin)
    PR:             291266
    MFH:            2025Q4 (after a few days)

    png -- Multiple vulnerabilities
    Security:       CVE-2025-64505
    Security:       CVE-2025-64506
    Security:       CVE-2025-64720
    Security:       CVE-2025-65018
    Security:       4b297f5a-cbad-11f0-ac9f-b42e991fc52e

    png -- Out-of-bounds read
    Security:       CVE-2025-66293
    Security:       f323f148-d181-11f0-841f-843a4b343614

    (cherry picked from commit f1bbe43c186c567cd96c0a5c6fd0c1a159accaf9)

 graphics/png/Makefile  |  7 ++++---
 graphics/png/distinfo  | 10 +++++-----
 graphics/png/pkg-plist |  2 +-
 3 files changed, 10 insertions(+), 9 deletions(-)
Comment 24 Matthias Andree freebsd_committer freebsd_triage 2025-12-07 12:40:00 UTC
Shitloads of ports have failed my test build due to underdeclared requisites ports, X11 and otherwise, but I haven't found errors related to PNG, so, MFH also done.
Comment 25 George Mitchell 2025-12-07 17:23:24 UTC
Thanks for the fix!