Skip to content

SYN-642: Clear high-severity Dependabot findings in pip deps - #221

Merged
KARSE22 merged 2 commits into
mainfrom
chore/SYN-642/high-vuln-upgrades
Sep 1, 2026
Merged

SYN-642: Clear high-severity Dependabot findings in pip deps#221
KARSE22 merged 2 commits into
mainfrom
chore/SYN-642/high-vuln-upgrades

Conversation

@KARSE22

@KARSE22 KARSE22 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What problem are you trying to solve?

  • 15 High Dependabot findings across urllib3, setuptools, and certifi (SYN-642).

How did you solve this problem?

  • Bumped urllib3 1.26.12 to 2.7.0, certifi to 2026.7.22, requests to 2.34.2 (needed for urllib3 2.x compat), and idna to 3.19 in requirements.txt.
  • Added pyproject.toml pinning setuptools>=78.1.1,<81 as a build dependency. It wasn't declared anywhere in the repo before.
  • Bumped the CI matrix to Python 3.10/3.11/3.12 since the new dependency floors require it (3.8/3.9 are EOL).
  • Dismissed 9 stale Dependabot alerts tied to Pipfile.lock, which was deleted from this repo in 2022 and no longer exists.

Important notes

  • 6 remaining High alerts against requirements.txt will auto-close once this merges and Dependabot rescans.
  • I ran the full integration suite against old and new deps on the live API and got the same 11 errors and 2 failures either way. That's a pre-existing return_envelope model bug, unrelated to this change.

Test plan

  1. pip-audit -r requirements.txt -> 0 findings (was 23 across 4 packages)
  2. python -m unittest test/Unit/test_*.py -> 247/247 pass
  3. python -m unittest discover test/Integration (needs LOB_API_TEST_KEY) -> 135/148 pass, same as main
  4. python -m build --sdist succeeds with the new pyproject.toml

Bump urllib3 1.26.12->2.7.0, certifi 2022.12.7->2026.7.22, requests
2.28.1->2.34.2 (needed for urllib3 2.x compat, unused at runtime), and
idna 3.3->3.19 in requirements.txt. Pin setuptools>=78.1.1,<81 via a
new pyproject.toml [build-system] table, since it wasn't declared as
a dependency anywhere. Update CI matrix to Python 3.10/3.11/3.12 since
the new dependency floors require it (3.8/3.9 are EOL).

Verified: 247/247 unit tests pass, full integration suite run against
the live API (135/148 pass, with the 13 pre-existing failures proven
identical on old vs new deps), pip-audit goes from 23 findings/4
packages to 0, and a real `python -m build --sdist` confirms the
setuptools pin works. Also dismissed 9 stale Dependabot alerts (#5,
#11, #14, #29, #32, #41, #42, #44, #51) attributed to Pipfile.lock,
which was removed from this repo in 0660e89 (2022-09-19) and no longer
exists.
@KARSE22
KARSE22 marked this pull request as ready for review September 1, 2026 20:29
Comment thread requirements.txt
requests==2.34.2
six==1.16.0
urllib3==1.26.12
urllib3==2.7.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Major version bump (1.x to 2.x), not just a patch. Verified this doesn't break the SDK: grepped every direct urllib3 call in lob_python/ (getheaders, getheader, ProxyManager, PoolManager, Timeout, exceptions.SSLError, fields.RequestField, util.make_headers) and confirmed each still works by actually installing 2.7.0 and exercising them, plus a real end-to-end request against api.lob.com.

Comment thread requirements.txt
@@ -1,9 +1,9 @@
certifi==2022.12.7
certifi==2026.7.22

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ticket (SYN-642) asked for 2023.7.22, but that leaves PYSEC-2024-230 open. Went to latest since certifi has no API surface to break, just a CA bundle.

Comment thread requirements.txt
lob==4.5.4
python-dateutil==2.8.2
requests==2.28.1
requests==2.34.2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not in the ticket, but required: 2.28.1 pins urllib3<1.27, incompatible with the urllib3 bump below. Also had 4 of its own CVEs, all fixed here. Not imported anywhere in lob_python/, so no runtime risk.

Comment thread requirements.txt
certifi==2026.7.22
charset-normalizer==2.1.1
idna==3.3
idna==3.19

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also not in the ticket. idna 3.3 had 2 open CVEs (PYSEC-2024-60, PYSEC-2026-215), both fixed by 3.19.

Comment thread pyproject.toml
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=78.1.1,<81"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

setuptools wasn't declared as a dependency anywhere in this repo (not in requirements.txt, not in setup.py), which is why Dependabot's 3 High findings for it couldn't be closed by editing requirements.txt. This is the actual place a build-tool floor belongs. Capped at <81 per review feedback, since an unbounded floor could pull in a future breaking setuptools release.

strategy:
matrix:
python-version: ["3.8", "3.9", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Dropped 3.8/3.9 because urllib3 2.7.0 / requests 2.34.2 / setuptools>=78.1.1 all require Python >=3.10 (3.8 EOL'd Oct 2024, 3.9 EOLs Oct 2025). This only affects what we test in CI, not what the published package supports: setup.py's python_requires is already unrestricted and install_requires only floors urllib3 >= 1.25.3 with no ceiling, both unchanged here.

@KARSE22
KARSE22 merged commit fd29e18 into main Sep 1, 2026
3 checks passed
@KARSE22
KARSE22 deleted the chore/SYN-642/high-vuln-upgrades branch September 1, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants