Skip to content

Fix critical and high Aikido findings (DCON-5617, DCON-5618, DCON-5619) - #57

Merged
gagan-chawla merged 2 commits into
mainfrom
claude/critical-high-vulnerabilities-9cfd63
Sep 17, 2026
Merged

gagan-chawla merged 2 commits into
mainfrom
claude/critical-high-vulnerabilities-9cfd63

Conversation

@gagan-chawla

@gagan-chawla gagan-chawla commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes the three critical/high Aikido findings on repository 340834.

Ticket Severity Finding Fix
DCON-5617 Critical deepdiff 8.5.0 — 2 vulns → 8.6.2, capped <9
DCON-5618 High urllib3 2.5.0 — 4 highs → 2.8.0, floored >=2.7.0
DCON-5619 High Unpinned 3rd-party Actions Actions removed

DCON-5617 — deepdiff (critical)

  • CVE-2025-58367 (critical) — class pollution in deepdiff's Delta class → DoS/RCE. Fixed in 8.6.1.
  • CVE-2026-33155 (high) — memory-exhaustion DoS via SAFE_TO_IMPORT. Fixed in 8.6.2.

On reachability: Delta is imported and called here, in MockServerFriendlyClient.compare_dicts (mockserver_client/mockserver_client.py:861):

diff_result = Delta(DeepDiff(dict_1, dict_2))

It builds the Delta from a locally computed DeepDiff, 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,<9 rather 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:

CVE Issue Fixed in
CVE-2025-66418 Unbounded links in decompression chain 2.6.0
CVE-2025-66471 Streaming API mishandles highly compressed data 2.6.0
CVE-2026-21441 Decompression-bomb safeguards bypassed via redirects 2.6.3
CVE-2026-44431 Sensitive headers forwarded cross-origin on proxied redirects 2.7.0

Floored at >=2.7.0 so 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 in setup.py so downstream consumers of helix_mockserver_client inherit the protection.

DCON-5619 — unpinned third-party Actions (high) — the real risk

python-publish.yml used two third-party actions tracking a mutable branch:

uses: WyriHaximus/github-action-get-previous-tag@master
uses: DamianReeves/write-file-action@master

This is the one workflow that holds TWINE_PASSWORD: ${{ secrets.PYPI }}. A compromise of either upstream master would have leaked the publish token and allowed a backdoored helix_mockserver_client release 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: 0 is now required on checkout so git describe can resolve tags.
  • The tag is passed via an env: block rather than interpolated straight into the run: 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=0 returns 2.0.7 on the current tree, matching the newest tag, and printf '%s\n' writes byte-identical output to the old write-file-action step (2.0.7\n). setup.py strips it anyway.

bulild_and_test.yml uses only first-party actions/* and needed no change. actions/checkout / actions/setup-python are 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:

Before After
Runtime (default) critical/high 3 (1 critical) 0
Dev-only (develop) critical/high 11 0

The dev-only findings were never ticketed — Aikido scopes the develop section out since it doesn't ship in the published wheel — but rebuilding the lock cleared them as a side effect (cryptography 45.0.5 → 50.0.1, plus aiohttp, wheel, jaraco.context).

Reviewer warning: the lock rebuild is not scoped

make Pipfile.lock re-resolves all packages; the Makefile target can't be narrowed to individual dependencies. 55 packages changed version, including:

pytest       8.4.1   -> 9.1.1    passes
mypy         1.17.1  -> 2.3.1    passes under --strict
setuptools   80.9.0  -> 84.0.0
twine        6.1.0   -> 7.0.0
cryptography 45.0.5  -> 50.0.1
virtualenv   20.33.0 -> 21.7.10
black        25.1.0  -> 26.5.1   inert; pre-commit formats with ruff, not black
ruff         0.12.7  -> 0.12.12  capped, see below

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.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 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.toml pinning 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

PR Proposes This PR
#46 deepdiff → 8.6.1 8.6.2 — #46 leaves CVE-2026-33155 (high) open
#50 urllib3 → 2.6.3 2.8.0 — #50 leaves CVE-2026-44431 (high) open
#54 cryptography → 46.0.5 50.0.1
#53 wheel → 0.46.2 included
#52 filelock → 3.20.3 included
#51 virtualenv → 20.36.1 included
#49 aiohttp → 3.13.3 included

Worth closing these as superseded once this merges.

Verification

Run against the capped lock:

Check Result
pytest (9.1.1) 19 passed
mypy --strict (2.3.1) Success: no issues found in 42 source files
ruff check --fix (0.12.12) All checks passed!
ruff format --check 43 files already formatted
bandit clean
OSV re-scan, runtime + dev 0 critical/high
Workflow YAML valid; no third-party uses: remain

Pipfile.lock verified deterministic — repeated --no-cache rebuilds produce byte-identical output, so there is no resolution drift between local and CI.

🤖 Generated with Claude Code

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>

@gecko-security gecko-security Bot 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.

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
Loading

Edit Gecko PR Settings | Reviewed commit: 6057cb4

@claude claude Bot 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.

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>
@gagan-chawla
gagan-chawla merged commit c7264fb into main Sep 17, 2026
3 checks passed
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.

2 participants