SFT-8489: move host tooling and the simulator to Pillow 13.0.0
What changed, and why it matters
This commit updates the Pillow image-processing library used by developer tools and the firmware simulator from version 12.3.x to 13.0.0. The change fixes seven known security advisories reported by Dependabot. Pillow is not part of the actual Passport hardware wallet firmware that protects private keys; it is only used on developers' computers and in the simulator. The commit also raises the minimum Python version from 3.10 to 3.11 and adjusts the project's Nix package setup to provide Pillow 13.0.0.
Verify that CI and the simulator dev shell build correctly with Pillow 13.0.0 and Python 3.11. Confirm the seven Dependabot alerts are resolved by the new constraint. No device firmware update is required because Pillow is not used on the hardware wallet itself.
Security signals we found
Dependency version bump to fix known Pillow security advisories
Commit message references seven open Dependabot alerts
Pillow is an image-processing library with a history of memory-safety and parsing vulnerabilities
Change is host tooling/simulator only, not device firmware
Python minimum version raised to 3.11 to match Pillow 13 requirements
Evidence from the diff
The patch bumps Pillow constraints to ^13.0.0 / >=13.0.0,<14 and ties them to python>=3.11 in pyproject.toml, requirements-optional.txt, setup.py, DEVELOPMENT.md, and simulator/requirements.txt. It also overrides nixpkgs’ Pillow 12.3.0 with a 13.0.0 PyPI sdist build in flake.nix so the simulator dev shell uses the same fixed version. The commit message explicitly states this resolves seven open Dependabot Pillow advisories. The affected code paths are host-side tooling, the simulator, and optional Trezor firmware extension modules, not the embedded firmware runtime on the secure microcontroller.
Changed components
extmod/trezor-firmware/pyproject.tomlextmod/trezor-firmware/python/requirements-optional.txtextmod/trezor-firmware/python/setup.pysimulator/requirements.txtflake.nixDEVELOPMENT.mdInspect captured patch +29 / −8
### DEVELOPMENT.md
@@ -102,9 +102,9 @@ Passport comes with a set of `Justfile` command scripts. Using these commands r
cargo install just
-The image tooling requires Python 3.10 or newer and `Pillow` 12.3.x:
+The image tooling requires Python 3.11 or newer and `Pillow` 13.x:
- pip install 'Pillow>=12.3.0,<13'
+ pip install 'Pillow>=13.0.0,<14'
`ports/stm32/Justfile` contains all the `just` commands you can run to build firmware for Passport. You'll typically want to be in the `ports/stm32` folder to run these commands.
### extmod/trezor-firmware/pyproject.toml
@@ -55,7 +55,7 @@ click = "^7"
ed25519 = "^1.4"
requests = "^2.19"
termcolor = "*"
-Pillow = { version = "^12.3.0", python = ">=3.10" }
+Pillow = { version = "^13.0.0", python = ">=3.11" }
# crypto
ecdsa = "^0.16"
### extmod/trezor-firmware/python/requirements-optional.txt
@@ -1,6 +1,6 @@
hidapi >= 0.7.99.post20
rlp >= 1.1.0
web3 >= 4.8
-Pillow>=12.3.0,<13; python_version>='3.10'
+Pillow>=13.0.0,<14; python_version>='3.11'
stellar-sdk>=4.0.0,<6.0.0
types-click
### extmod/trezor-firmware/python/setup.py
@@ -37,7 +37,7 @@
"hidapi": ["hidapi>=0.7.99.post20"],
"ethereum": ["rlp>=1.1.0", "web3>=4.8"],
"qt-widgets": ["PyQt5"],
- "extra": ["Pillow>=12.3.0,<13; python_version>='3.10'"],
+ "extra": ["Pillow>=13.0.0,<14; python_version>='3.11'"],
"stellar": ["stellar-sdk>=4.0.0,<6.0.0"],
}
### flake.nix
@@ -66,15 +66,36 @@
config.allowUnfree = true;
};
customPackages = self.packages.${system};
- embit = pkgs.python3Packages.buildPythonPackage rec {
+ # nixpkgs still ships Pillow 12.3.0, which is affected by open Pillow
+ # advisories fixed in 13.0.0. Override it for the whole Python package
+ # set, so packages that depend on Pillow (imageio) use the same copy as
+ # the shell. Remove once nixpkgs carries Pillow >= 13.0.0.
+ python3 = pkgs.python3.override {
+ self = python3;
+ packageOverrides = pyFinal: pyPrev: {
+ pillow = pyPrev.pillow.overridePythonAttrs (old: rec {
+ version = "13.0.0";
+ src = pkgs.fetchPypi {
+ pname = "pillow";
+ inherit version;
+ hash = "sha256-zc0bolgXj3NW10FwyagbpOq2pdVXSLxAKloqb+a+NRA=";
+ };
+ # The shell needs the library, not its test suite, and nixpkgs'
+ # list of disabled tests is tuned for 12.3.0.
+ doCheck = false;
+ });
+ };
+ };
+ python3Packages = python3.pkgs;
+ embit = python3Packages.buildPythonPackage rec {
pname = "embit";
version = "0.8.0";
pyproject = true;
src = pkgs.fetchPypi {
inherit pname version;
hash = "sha256-i/SxAHPGdAA3DOUj+xbwNf51n2/dmHxXm9zCaNde13A=";
};
- build-system = with pkgs.python3Packages; [ setuptools wheel ];
+ build-system = with python3Packages; [ setuptools wheel ];
pythonImportsCheck = [ "embit.descriptor.arguments" ];
};
runtimeLibPath = with pkgs; pkgs.lib.makeLibraryPath [
### simulator/requirements.txt
@@ -11,6 +11,6 @@
# brew install sdl2
#
PySDL2
-Pillow
+Pillow>=13.0.0
opencv-python
imageioWhy this scored 38/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.