Skip to content

build: pin setuptools build backend version#138

Draft
MarkAtwood wants to merge 1 commit into
wolfSSL:masterfrom
MarkAtwood:fix/pin-setuptools-build-backend
Draft

build: pin setuptools build backend version#138
MarkAtwood wants to merge 1 commit into
wolfSSL:masterfrom
MarkAtwood:fix/pin-setuptools-build-backend

Conversation

@MarkAtwood

@MarkAtwood MarkAtwood commented Jul 10, 2026

Copy link
Copy Markdown

Problem

pyproject.toml declares setuptools as a PEP 517 build requirement with no version bound:

requires = ["setuptools", "cffi>=1.17"]

cffi is pinned, but setuptools is not. In an isolated build (the PEP 517 default), the packaging frontend resolves the latest setuptools from the configured index before running the backend, so a compromised index, a malicious upstream release, or an unexpected future backend change can affect build execution and the produced artifacts.

Fix

Bound the build backend:

requires = ["setuptools>=64,<81", "cffi>=1.17"]
  • Floor >=64 keeps compatibility with the declared requires-python = ">=3.10" (64 is where pyproject.toml-driven config stabilized and is broadly available).
  • Ceiling <81 caps exposure to an unvetted future major of the build backend.

For stricter release reproducibility you could additionally install build requirements from a hash-pinned constraints file (pip install --require-hashes); this PR does the minimal, in-tree version bound. Adjust the ceiling when a newer setuptools major is validated.

Reported by static analysis (Fenrir finding 5426).

[fenrir-sweep:held]

pyproject.toml declared setuptools as an unbounded PEP 517 build
requirement, so an isolated build resolves whatever setuptools is latest
on the index — a compromised index or an unexpected future backend release
could then affect build execution and the produced artifacts. cffi was
already pinned; setuptools was not.

Bound it to setuptools>=64,<81: the floor keeps compatibility with the
declared requires-python>=3.10, and the ceiling caps the exposure to an
unvetted future major of the build backend.
Copilot AI review requested due to automatic review settings July 10, 2026 00:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Pins the setuptools PEP 517 build requirement in pyproject.toml to reduce exposure to unvetted upstream changes during isolated builds.

Changes:

  • Add an explicit version range for setuptools in [build-system].requires

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml

[build-system]
requires = ["setuptools", "cffi>=1.17"]
requires = ["setuptools>=64,<81", "cffi>=1.17"]
@MarkAtwood MarkAtwood assigned MarkAtwood and unassigned wolfSSL-Bot Jul 10, 2026
@MarkAtwood MarkAtwood marked this pull request as draft July 10, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants