Skip to content

fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922 - #4197

Merged
Jan-Kazlouski-elastic merged 5 commits into
mainfrom
jan-kazlouski/12505-cve-2026-30922-fix
Jul 17, 2026
Merged

fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922#4197
Jan-Kazlouski-elastic merged 5 commits into
mainfrom
jan-kazlouski/12505-cve-2026-30922-fix

Conversation

@Jan-Kazlouski-elastic

Copy link
Copy Markdown
Contributor

Closes https://github.com/elastic/security/issues/12505

Bumps pyasn1 to the latest patch release 0.6.4 to remediate CVE-2026-30922 (High) — a Denial of Service in pyasn1 < 0.6.3: the BER decoder recurses without bound on deeply nested indefinite-length SEQUENCE/SET structures, so a crafted ASN.1 payload can crash the worker via RecursionError/OOM.

pyasn1 is a transitive dependency (via ldap3 / pyasn1_modules) that we pin directly in app/connectors_service/pyproject.toml. It was previously capped at <0.6.1 by #2817 to avoid a pyasn1 0.6.1 deprecation; this raises that cap straight to the current patch 0.6.4.

Why the added filterwarnings

pyasn1 0.6.1+ renamed the BER encoder/decoder tagMap/typeMap attributes to TAG_MAP/TYPE_MAP, leaving deprecating aliases. ldap3 2.9.1 (its last, now unmaintained release) still imports the old names, which emits a benign DeprecationWarning. Our warnings-as-errors test config turned that into a collection error, so two scoped ignore filters were added. The aliases still function at runtime, so there is no behavior change.

Scanner A/B (CVE-2026-30922)

Isolated before (pyasn1==0.6.0) vs after (pyasn1==0.6.4):

Tool Before After
pip-audit reported (PYSEC-2026-2263 = CVE-2026-30922, fix 0.6.3) clear
Trivy reported (CVE-2026-30922, HIGH) clear
Snyk reported (SNYK-PYTHON-PYASN1-15674561 = CVE-2026-30922) clear

Checklists

Pre-Review Checklist

  • this PR does NOT contain credentials of any kind, such as API keys or username/passwords (double check config.yml.example)
  • this PR has a meaningful title
  • this PR links to all relevant github issues that it fixes or partially addresses
  • this PR has a thorough description
  • Tested the changes locally

Changes Requiring Extra Attention

  • Security-related changes (encryption, TLS, SSRF, etc)

Release Note

Bump pyasn1 to 0.6.4 to remediate CVE-2026-30922 (DoS via unbounded recursion in the ASN.1 BER decoder).

Made with Cursor

CVE-2026-30922 (High) is a DoS in pyasn1 < 0.6.3: the BER decoder has
unbounded recursion when handling deeply nested indefinite-length
SEQUENCE/SET structures, so a crafted ASN.1 payload can crash the worker
via RecursionError/OOM. Raise the previous <0.6.1 cap (from PR #2817, which
avoided a pyasn1 0.6.1 deprecation) to the latest patch release 0.6.4.

pyasn1 0.6.1+ renamed the ber encoder/decoder tagMap/typeMap attributes to
TAG_MAP/TYPE_MAP and left deprecating aliases. ldap3 2.9.1 (its last, now
unmaintained release) still imports the old names, emitting a benign
DeprecationWarning that our warnings-as-errors test config turns into a
collection error. Ignore those two specific warnings so the bump passes.

Closes elastic/security#12505

Co-authored-by: Cursor <cursoragent@cursor.com>
@Jan-Kazlouski-elastic Jan-Kazlouski-elastic self-assigned this Jul 17, 2026
Resolve pyproject.toml dependency conflict: keep pyOpenSSL==26.0.0 (from
main #4203, CVE-2026-27459) and pyasn1==0.6.4 (this PR, CVE-2026-30922).
The two pins are independent; msal==1.32.3 and cryptography 46.x come in
cleanly from main. NOTICE.txt auto-merged.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic enabled auto-merge (squash) July 17, 2026 13:31
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic merged commit 565144c into main Jul 17, 2026
4 checks passed
@Jan-Kazlouski-elastic
Jan-Kazlouski-elastic deleted the jan-kazlouski/12505-cve-2026-30922-fix branch July 17, 2026 16:00
@github-actions

Copy link
Copy Markdown

💔 Failed to create backport PR(s)

Status Branch Result
9.5 #4214
9.3 #4215
9.4 #4216
8.19 Commit could not be cherrypicked due to conflicts

Successful backport PRs will be merged automatically after passing CI.

To backport manually run:
backport --pr 4197 --autoMerge --autoMergeMethod squash

Jan-Kazlouski-elastic added a commit that referenced this pull request Jul 17, 2026
Backports the following commits to 9.3:
 - fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922 (#4197)

Co-authored-by: Jan-Kazlouski-elastic <jan.kazlouski@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Jan-Kazlouski-elastic added a commit that referenced this pull request Jul 20, 2026
Backports the following commits to 9.5:
 - fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922 (#4197)

Co-authored-by: Jan-Kazlouski-elastic <jan.kazlouski@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Jan-Kazlouski-elastic added a commit that referenced this pull request Jul 20, 2026
Backports the following commits to 9.4:
 - fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922 (#4197)

Co-authored-by: Jan-Kazlouski-elastic <jan.kazlouski@elastic.co>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Jan-Kazlouski-elastic added a commit that referenced this pull request Jul 20, 2026
)

Backports the following commits to 8.19:
 - fix(deps): bump pyasn1 to 0.6.4 for CVE-2026-30922 (#4197)

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants