Repository navigation
Fix critical and high Aikido findings (DCON-5617, DCON-5618, DCON-5619) - #57
Conversation
deepdiff 8.5.0 -> 8.6.2 (DCON-5617, critical) CVE-2025-58367 (critical) is class pollution in deepdiff's Delta class, which this repo does import and call in MockServerFriendlyClient.compare_dicts. It builds Delta from a locally computed DeepDiff rather than from an untrusted delta payload, so it is not practically exploitable here, but the vulnerable version was still shipping in the runtime dependency set. CVE-2026-33155 (high, memory-exhaustion DoS) is fixed in the same bump. Constrained to >=8.6.2,<9 rather than left at ">8". deepdiff 9.x now exists and the Pipfile already warned that 8.0.0 introduced breaking changes, so an unconstrained lock would have silently taken a major upgrade. urllib3 2.5.0 -> 2.8.0 (DCON-5618, high) Aikido's suggested target was 2.6.0, which only closes the two CVEs it counted (CVE-2025-66418, CVE-2025-66471). Two further highs are fixed later: CVE-2026-21441 (decompression-bomb safeguards bypassed via redirects, 2.6.3) and CVE-2026-44431 (sensitive headers forwarded cross-origin on proxied redirects, 2.7.0). Floored at >=2.7.0 so the finding does not reopen; the lock resolved to 2.8.0. urllib3 is not imported directly -- it arrives transitively via requests. It is declared here purely as a security floor, including in setup.py so downstream consumers of helix_mockserver_client inherit it. Remove unpinned third-party GitHub Actions (DCON-5619, high) python-publish.yml used WyriHaximus/github-action-get-previous-tag@master and DamianReeves/write-file-action@master -- third-party code tracking a mutable branch, in the one workflow that holds secrets.PYPI. A compromise of either upstream would have leaked the publish token and allowed a malicious helix_mockserver_client release. Both did something trivial, so they are inlined as shell rather than pinned to a SHA: this removes the third-party dependency instead of mitigating it, and leaves no SHAs to renovate. Requires fetch-depth: 0 so git describe can resolve tags. The tag is passed via env rather than interpolated into the run body to avoid introducing a script-injection sink. Rebuilding the lock also cleared dev-only highs that Aikido scopes out of reporting (cryptography 45.0.5 -> 50.0.1, aiohttp, wheel, jaraco.context). This re-resolves all 73 packages because the Makefile lock target cannot be scoped to individual dependencies; that includes major bumps to pytest (9.1.1) and mypy (2.3.1). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Gecko PR Review
No vulnerabilities found, LGTM.
Summary
This PR hardens the PyPI publishing workflow and tightens dependency constraints. The .github/workflows/python-publish.yml removes two third-party GitHub Actions with mutable master branch references that could compromise the PYPI token, replacing them with inline git and printf commands. Simultaneously, Pipfile pins deepdiff to >=8.6.2,<9 (CVE-2025-58367, CVE-2026-33155) and adds an explicit urllib3>=2.7.0 floor for transitive security fixes (CVE-2025-66418, CVE-2025-66471, CVE-2026-21441, CVE-2026-44431), with Pipfile.lock reflecting the resolved versions.
Important Files Changed
4 important files
| File Path | Why it matters |
|---|---|
.github/workflows/python-publish.yml |
Eliminates third-party action dependencies from the publish job holding PYPI secrets; inlining git describe and printf prevents upstream compromise from leaking the publish token. |
Pipfile |
Pins deepdiff to a narrow range >=8.6.2,<9 to block Delta class pollution CVEs and adds explicit urllib3>=2.7.0 to prevent transitive decompression bomb and header-leak vulnerabilities. |
Pipfile.lock |
Locks resolved dependency versions matching the security constraints; hash change indicates updated certifi, charset-normalizer, and other transitive deps. |
setup.py |
May inherit dependencies from Pipfile; verify it doesn't override or conflict with the new pinned constraints. |
Sequence Diagram
sequenceDiagram
participant Reviewer
participant PR as Changed Files
Reviewer->>PR: Inspect changed files and control flow
Reviewer->>Reviewer: Validate security assumptions
Edit Gecko PR Settings | Reviewed commit: 6057cb4
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. Because it touches the release workflow that holds the PyPI publish secret and changes runtime dependency floors (deepdiff, urllib3) shipped to downstream consumers, a human look would still be worthwhile before merging.
What was reviewed: the inlined git describe --tags --abbrev=0 / printf replacement for the two removed third-party Actions in .github/workflows/python-publish.yml (including the fetch-depth: 0 addition and the use of an env: var instead of direct ${{ }} interpolation to avoid shell injection); the version-constraint changes in Pipfile and setup.py (deepdiff>=8.6.2,<9, new urllib3>=2.7.0 floor) for consistency between the two files; and the regenerated Pipfile.lock for basic consistency with Pipfile. Candidate issues considered and not treated as blocking: silent/empty VERSION file if git describe finds no tag, and the urllib3>=2.7.0 floor's interaction with older OpenSSL-linked Python builds on downstream consumer systems.
Extended reasoning...
Overview
This PR touches four files: a GitHub Actions release workflow, Pipfile/Pipfile.lock, and setup.py. The workflow change removes two third-party Actions (WyriHaximus/github-action-get-previous-tag@ master, DamianReeves/write-file-action@ master) that tracked mutable master branches, replacing them with inline shell (git describe --tags --abbrev=0 and printf ... > VERSION), and adds fetch-depth: 0 to checkout so tags are resolvable. The dependency changes tighten deepdiff to >=8.6.2,<9 and add a new urllib3>=2.7.0 floor in both Pipfile and setup.py, with Pipfile.lock regenerated to match.
Security risks
The workflow file is the one job in this repo holding secrets.PYPI (via TWINE_PASSWORD). Removing third-party actions pinned to @ master reduces supply-chain exposure, which is a net security improvement, and the choice to pass the tag through an env: block rather than interpolating ${{ }} directly into the run: body avoids introducing a script-injection sink — a reasonable and correct precaution. The dependency floor changes are aimed at closing known CVEs in deepdiff and urllib3. No new injection, auth-bypass, or data-exposure issues were introduced by the diff itself as far as this review could determine.
Level of scrutiny
Despite being small and mechanical in form, this change modifies the one workflow that publishes releases using a secret token, and it changes dependency floors that ship in a published package (helix_mockserver_client) consumed downstream. Per the review guidelines, changes touching secret-bearing CI paths and public dependency contracts warrant a human look even when no automated findings surfaced — the blast radius of a mistake here (a broken or compromised publish pipeline, or a floor bump that breaks a downstream consumer's environment) is higher than typical config tweaks.
Other factors
The bug-hunting system completed with a dry streak (no confirmed bugs) and only surfaced minor, non-blocking candidates (e.g., silent empty VERSION on missing tags, urllib3 floor on old OpenSSL). The PR description itself flags that Pipfile.lock regeneration is unscoped and moved several dev/test tooling packages across major versions (pytest, mypy, setuptools, twine), and explicitly asks for CI confirmation before merge — reinforcing that a green CI run and a human glance, rather than an automated approval, is the appropriate gate here.
The unconstrained lock rebuild took ruff 0.12.7 -> 0.16.8, which failed CI on this branch with 503 new lint errors (UP006, I001, F401, FURB105, UP024) and 4 files reformatted -- without a single source line changing. Root cause: this repo has no pyproject.toml or ruff.toml, so ruff's built-in defaults are the de facto lint config. Ruff is pre-1.0 and expands its default rule selection and changes formatter stable style across minor releases, so Pipfile.lock was the only thing holding lint behaviour stable. Capped at <0.13 rather than absorbing ~500 lint fixes and 4 reformatted files into a security PR, which would have buried the actual fix. Ruff carries no CVE in scope, so this costs nothing security-wise. Re-locking changed exactly one package (ruff 0.16.8 -> 0.12.12); deepdiff 8.6.2, urllib3 2.8.0, mypy 2.3.1 and pytest 9.1.1 are all retained. Lifting this cap belongs in a dedicated PR that adds an explicit ruff config, otherwise the same breakage recurs on the next bump. Verified with the capped lock: ruff check --fix All checks passed! ruff format --check 43 files already formatted mypy --strict Success: no issues found in 42 source files bandit clean pytest 19 passed Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closes the three critical/high Aikido findings on repository 340834.
deepdiff8.5.0 — 2 vulns8.6.2, capped<9urllib32.5.0 — 4 highs2.8.0, floored>=2.7.0DCON-5617 — deepdiff (critical)
Deltaclass → DoS/RCE. Fixed in 8.6.1.SAFE_TO_IMPORT. Fixed in 8.6.2.On reachability:
Deltais imported and called here, inMockServerFriendlyClient.compare_dicts(mockserver_client/mockserver_client.py:861):It builds the
Deltafrom a locally computedDeepDiff, not from an untrusted delta dict or flat-row list — which is what the class-pollution PoC requires. So this was not practically exploitable in this codebase, but the vulnerable version was shipping in the runtime dependency set regardless.Reviewer note: constrained to
>=8.6.2,<9rather than the previous>8. deepdiff 9.x now exists, and the Pipfile already carried a warning that 8.0.0 introduced breaking changes — so an unconstrained re-lock would have silently taken a major upgrade. 8.6.2 is the last 8.x release.DCON-5618 — urllib3 (high) — target raised above the ticket
The ticket says update to 2.6.0. That only closes the two CVEs Aikido counted. Two further highs are fixed later:
Floored at
>=2.7.0so the finding doesn't reopen on the next scan; the lock resolved to 2.8.0. Worth noting on the ticket that the target was raised deliberately.urllib3 is not imported anywhere in this repo — it arrives transitively via
requests. It's declared purely as a security floor, including insetup.pyso downstream consumers ofhelix_mockserver_clientinherit the protection.DCON-5619 — unpinned third-party Actions (high) — the real risk
python-publish.ymlused two third-party actions tracking a mutable branch:This is the one workflow that holds
TWINE_PASSWORD: ${{ secrets.PYPI }}. A compromise of either upstreammasterwould have leaked the publish token and allowed a backdooredhelix_mockserver_clientrelease to every downstream b.well consumer. Despite the CVSS numbers, this had the largest blast radius of the three.Both actions did something trivial, so they're inlined as shell rather than pinned to a SHA — this removes the third-party dependency outright instead of mitigating it, and leaves no pinned SHAs to renovate later.
Two details worth a look:
fetch-depth: 0is now required on checkout sogit describecan resolve tags.env:block rather than interpolated straight into therun:body. Direct${{ }}interpolation into a shell body is a script-injection sink, and it seemed wrong to introduce one in the commit fixing a supply-chain finding.Verified the replacement is behaviour-preserving:
git describe --tags --abbrev=0returns2.0.7on the current tree, matching the newest tag, andprintf '%s\n'writes byte-identical output to the oldwrite-file-actionstep (2.0.7\n).setup.pystrips it anyway.bulild_and_test.ymluses only first-partyactions/*and needed no change.actions/checkout/actions/setup-pythonare first-party, which is why Aikido didn't flag them; left as-is to keep scope to the finding.Scan results
Independent OSV.dev scan of every locked package, before vs. after:
default) critical/highdevelop) critical/highThe dev-only findings were never ticketed — Aikido scopes the
developsection out since it doesn't ship in the published wheel — but rebuilding the lock cleared them as a side effect (cryptography45.0.5 → 50.0.1, plusaiohttp,wheel,jaraco.context).Reviewer warning: the lock rebuild is not scoped
make Pipfile.lockre-resolves all packages; the Makefile target can't be narrowed to individual dependencies. 55 packages changed version, including:ruff is capped at
<0.13(second commit)The first push took ruff to 0.16.8 and CI failed: 503 lint errors (
UP006,I001,F401,FURB105,UP024) and 4 files reformatted — with no source line changed.Root cause: this repo has no
pyproject.tomlorruff.toml, so ruff's built-in defaults are the de facto lint config. Ruff is pre-1.0 and expands its default rule selection and changes formatter stable style across minor releases, soPipfile.lockwas the only thing holding lint behaviour stable.Capped rather than absorbing ~500 lint fixes into a security PR, which would have buried the actual fix. Ruff carries no CVE in scope, so this costs nothing security-wise. The re-lock changed exactly one package (ruff 0.16.8 → 0.12.12) — runtime deps and every other security bump are untouched.
Follow-up worth filing: add an explicit
ruff.tomlpinning the rule selection and lift the cap in its own PR. Without that, the same breakage recurs on the next ruff bump.Supersedes six open Dependabot PRs
Worth closing these as superseded once this merges.
Verification
Run against the capped lock:
pytest(9.1.1)mypy --strict(2.3.1)ruff check --fix(0.12.12)ruff format --checkbandituses:remainPipfile.lockverified deterministic — repeated--no-cacherebuilds produce byte-identical output, so there is no resolution drift between local and CI.🤖 Generated with Claude Code