Skip to contentSkip to conversation

package/python-flask: security bump to version 3.1.1

PATCH Applied Thomas Perale via buildroot 3 participants 6 messages May 14, 2025 – May 28, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/python-flask: security bump to version 3.1.1

Fixes the following security issues:

- CVE-2025-47278: In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key.

For more information, see:
- https://nvd.nist.gov/vuln/detail/CVE-2025-47278
- https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09

For more details on the version bump, see the release notes:
- https://github.com/pallets/flask/releases/tag/3.1.1

---
 package/python-flask/python-flask.hash | 4 ++--
 package/python-flask/python-flask.mk   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
package/python-flask/python-flask.hash +2 -2
index 97982f99d5..17564e8587 100644
@@ -1,6 +1,6 @@
 # md5, sha256 from https://pypi.org/pypi/flask/json
-md5  c95d81666442bf04f7de7db7edbe2aff  flask-3.1.0.tar.gz
-sha256  5f873c5184c897c8d9d1b05df1e3d01b14910ce69607a117bd3277098a5836ac  flask-3.1.0.tar.gz
+md5  59dc1b0772bab098aff83e8008e97af6  flask-3.1.1.tar.gz
+sha256  284c7b8f2f58cb737f0cf1c30fd7eaf0ccfcde196099d24ecede3fc2005aa59e  flask-3.1.1.tar.gz
 # Locally computed sha256 checksums
 sha256  489a8e1108509ed98a37bb983e11e0f7e1d31f0bd8f99a79c8448e7ff37d07ea  LICENSE.txt
 sha256  1e07e9c25f2618a040560b70e63f42259eab24e558d0f3532e6163d751cb4eea  docs/license.rst
package/python-flask/python-flask.mk +2 -2
index d44c2e68ef..2269b05d29 100644
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-PYTHON_FLASK_VERSION = 3.1.0
+PYTHON_FLASK_VERSION = 3.1.1
 PYTHON_FLASK_SOURCE = flask-$(PYTHON_FLASK_VERSION).tar.gz
-PYTHON_FLASK_SITE = https://files.pythonhosted.org/packages/89/50/dff6380f1c7f84135484e176e0cac8690af72fa90e932ad2a0a60e28c69b
+PYTHON_FLASK_SITE = https://files.pythonhosted.org/packages/c0/de/e47735752347f4128bcf354e0da07ef311a78244eba9e3dc1d4a5ab21a98
 PYTHON_FLASK_SETUP_TYPE = flit
 PYTHON_FLASK_LICENSE = BSD-3-Clause
 PYTHON_FLASK_LICENSE_FILES = LICENSE.txt docs/license.rst
Signature · 6 lines
2.49.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Perale via buildroot <[email protected]> writes:

Fixes the following security issues:
- CVE-2025-47278: In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key.

Quoted 8 lines

For more information, see:
- https://nvd.nist.gov/vuln/detail/CVE-2025-47278
- https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09

For more details on the version bump, see the release notes:
- https://github.com/pallets/flask/releases/tag/3.1.1

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Thomas Perale via buildroot
Quoted 6 lines · Thomas Perale via buildroot

Fixes the following security issues:

- CVE-2025-47278: In Flask 3.1.0, the way fallback key configuration was handled resulted in the last fallback key being used for signing, rather than the current signing key.

Quoted 8 lines

For more information, see:
- https://nvd.nist.gov/vuln/detail/CVE-2025-47278
- https://github.com/pallets/flask/commit/73d6504063bfa00666a92b07a28aaf906c532f09

For more details on the version bump, see the release notes:
- https://github.com/pallets/flask/releases/tag/3.1.1

Applied to 2025.02.x, thanks.

Regards,
Arnout

Quoted 24 lines
---
  package/python-flask/python-flask.hash | 4 ++--
  package/python-flask/python-flask.mk   | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
package/python-flask/python-flask.hash +2 -2
index 97982f99d5..17564e8587 100644
@@ -1,6 +1,6 @@
  # md5, sha256 from https://pypi.org/pypi/flask/json
-md5  c95d81666442bf04f7de7db7edbe2aff  flask-3.1.0.tar.gz
-sha256  5f873c5184c897c8d9d1b05df1e3d01b14910ce69607a117bd3277098a5836ac  flask-3.1.0.tar.gz
+md5  59dc1b0772bab098aff83e8008e97af6  flask-3.1.1.tar.gz
+sha256  284c7b8f2f58cb737f0cf1c30fd7eaf0ccfcde196099d24ecede3fc2005aa59e  flask-3.1.1.tar.gz
  # Locally computed sha256 checksums
  sha256  489a8e1108509ed98a37bb983e11e0f7e1d31f0bd8f99a79c8448e7ff37d07ea  LICENSE.txt
  sha256  1e07e9c25f2618a040560b70e63f42259eab24e558d0f3532e6163d751cb4eea  docs/license.rst
package/python-flask/python-flask.mk +0 -0
index d44c2e68ef..2269b05d29 100644
@@ -4,9 +4,9 @@
  #

package/python-flask/python-flask.mk line 12

Quoted 10 lines
package/python-flask/python-flask.mk +2 -2
  ################################################################################
 
-PYTHON_FLASK_VERSION = 3.1.0
+PYTHON_FLASK_VERSION = 3.1.1
  PYTHON_FLASK_SOURCE = flask-$(PYTHON_FLASK_VERSION).tar.gz
-PYTHON_FLASK_SITE = https://files.pythonhosted.org/packages/89/50/dff6380f1c7f84135484e176e0cac8690af72fa90e932ad2a0a60e28c69b
+PYTHON_FLASK_SITE = https://files.pythonhosted.org/packages/c0/de/e47735752347f4128bcf354e0da07ef311a78244eba9e3dc1d4a5ab21a98
  PYTHON_FLASK_SETUP_TYPE = flit
  PYTHON_FLASK_LICENSE = BSD-3-Clause
  PYTHON_FLASK_LICENSE_FILES = LICENSE.txt docs/license.rst

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Thomas Perale via buildroot

Hi Thomas,

alas, this release changed more than just fixing that security issue. In particular, the changes in [1] are breaking the build of 2025.02.x for me:

* Getting build dependencies for wheel...
Unexpected names under [project]: license-files
Traceback (most recent call last):
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
main()
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
^^^^^^^^^^^^^^^^^^^^^
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/flit_core/buildapi.py", line 23, in get_requires_for_build_wheel
info = read_flit_config(pyproj_toml)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/flit_core/config.py", line 81, in read_flit_config
return prep_toml_config(d, path)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/flit_core/config.py", line 108, in prep_toml_config
loaded_cfg = read_pep621_metadata(d['project'], path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/flit_core/config.py", line 529, in read_pep621_metadata
_check_type(proj, 'license', dict)
File "/home/flarysch/br-test-pkg/bootlin-armv5-uclibc/host/lib/python3.12/site-packages/flit_core/config.py", line 444, in _check_type
raise ConfigError(
flit_core.config.ConfigError: license field should be <class 'dict'>, not <class 'str'>

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
make: *** [package/pkg-generic.mk:273: /home/flarysch/br-test-pkg/bootlin-armv5-uclibc/build/python-flask-3.1.1/.stamp_built] Error 1

This can be reproduced with test-pkg using

BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_FLASK=y

As I understand it, this is happening because flask moved its pyproject.toml to PEP 639 license expressions but flit only introduced support for those in [2], which is part of 3.11.0, which wasn't included in 2025.02.2/.3, while the flask bump was.

The flit 3.10.1..3.11.0 diff doesn't look to bad, so maybe 2025.02.x could pick up the flip bump too? Alternatively, we could revert the flask bump and just import the security patch (just [3], if I'm not mistaken).

Florian

[1] https://github.com/pallets/flask/commit/0109e496f6ca68de29480fe6413e81b1d3f86aa9
[2] https://github.com/pypa/flit/commit/640b6ad973e406b352649d36eb35dc208ecbb0ca
[3] https://github.com/pallets/flask/commit/fb54159861708558b5f5658ebdc14709d984361c
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Hello Florian, Thomas and all,

Quoted 7 lines · Florian Larysch

Hi Thomas,

alas, this release changed more than just fixing that security issue. In particular, the changes in [1] are breaking the build of 2025.02.x for me:

* Getting build dependencies for wheel...

--- SNIP ---

Quoted 8 lines

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
make: *** [package/pkg-generic.mk:273: /home/flarysch/br-test-pkg/bootlin-armv5-uclibc/build/python-flask-3.1.1/.stamp_built] Error 1

This can be reproduced with test-pkg using

BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_FLASK=y

Quoted 7 lines

As I understand it, this is happening because flask moved its pyproject.toml to PEP 639 license expressions but flit only introduced support for those in [2], which is part of 3.11.0, which wasn't included in 2025.02.2/.3, while the flask bump was.

The flit 3.10.1..3.11.0 diff doesn't look to bad, so maybe 2025.02.x could pick up the flip bump too?

I agree with you, bumping flit doesn't look that bad. Also, other packages than Flask could have the "good idea" of changing their build requirement in patchlevel version bumps that also include some security fixes. Thus, I think that having flit>=3.11 in 2025.02.x LTS is better in the long run, as it reduces the patch maintenance burden on the Buildroot "staff"

I therefore suggest to apply https://gitlab.com/buildroot.org/buildroot/-/commit/c5659cebb7b54e2522601824a10c47c0ef73a09f on 2025.02.x. To make sure this wouldn't hurt elsewhere, I applied the commit locally, and then I successfully built all target packages that rely on flit, ie:

BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_APISPEC=y
BR2_PACKAGE_PYTHON_WEASYPRINT=y
BR2_PACKAGE_PYTHON_CLICK=y
BR2_PACKAGE_PYTHON_MARSHMALLOW_SQLALCHEMY=y
BR2_PACKAGE_PYTHON_PACKAGING=y
BR2_PACKAGE_PYTHON_MORE_ITERTOOLS=y
BR2_PACKAGE_PYTHON_FLASK=y
BR2_PACKAGE_PYTHON_IDNA=y
BR2_PACKAGE_PYTHON_FLASK_SMOREST=y
BR2_PACKAGE_PYTHON_DOCUTILS=y
BR2_PACKAGE_PYTHON_TYPING_EXTENSIONS=y
BR2_PACKAGE_PYTHON_TOMLI=y
BR2_PACKAGE_PYTHON_CSSSELECT2=y
BR2_PACKAGE_PYTHON_TINYHTML5=y
BR2_PACKAGE_PYTHON_ITSDANGEROUS=y
BR2_PACKAGE_PYTHON_BLINKER=y
BR2_PACKAGE_PYTHON_ENTRYPOINTS=y
BR2_PACKAGE_PYTHON_AIOHTTP_REMOTES=y
BR2_PACKAGE_PYTHON_WERKZEUG=y
BR2_PACKAGE_PYTHON_MARSHMALLOW=y
BR2_PACKAGE_PYTHON_WEBARGS=y
BR2_PACKAGE_PYTHON_TOMLI_W=y
BR2_PACKAGE_PYTHON_PYPHEN=y
BR2_PACKAGE_PYTHON_PYDYF=y
BR2_PACKAGE_PYTHON_TINYCSS2=y
BR2_PACKAGE_PYTHON_PYPARSING=y
BR2_PACKAGE_PYTHON_JEEPNEY=y
BR2_PACKAGE_PYTHON_AIOPROCESSING=y
BR2_PACKAGE_PYTHON_PATHSPEC=y
BR2_PACKAGE_PYTHON_AIOLOGSTASH=y
BR2_PACKAGE_PYTHON_ASYNCCLICK=y
BR2_PACKAGE_PYTHON_JINJA2=y
BR2_PACKAGE_PYTHON_ARGH=y
BR2_PACKAGE_PYTHON_AIOSQLITE=y
BR2_PACKAGE_PYTHON_SEGNO=y

Kind regards,
Titouan

Quoted 6 lines

Alternatively, we could revert the
flask bump and just import the security patch (just [3], if I'm not mistaken).

Florian

Quoted 7 lines

[1] https://github.com/pallets/flask/commit/0109e496f6ca68de29480fe6413e81b1d3f86aa9
[2] https://github.com/pypa/flit/commit/640b6ad973e406b352649d36eb35dc208ecbb0ca
[3] https://github.com/pallets/flask/commit/fb54159861708558b5f5658ebdc14709d984361c
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Titouan" == Titouan Christophe via buildroot <[email protected]> writes:

I agree with you, bumping flit doesn't look that bad. Also, other packages than Flask could have the "good idea" of changing their build requirement in patchlevel version bumps that also include some security fixes. Thus, I think that having flit>=3.11 in 2025.02.x LTS is better in the long run, as it reduces the patch maintenance burden on the Buildroot "staff"

Quoted 5 lines

I therefore suggest to apply
https://gitlab.com/buildroot.org/buildroot/-/commit/c5659cebb7b54e2522601824a10c47c0ef73a09f
on 2025.02.x. To make sure this wouldn't hurt elsewhere, I applied the commit locally, and then I successfully built all target packages that rely on flit, ie:

Sounds sensible to me, thanks for testing!

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot