Skip to content

Backport IMAP and POP3 command validation to Python 3.12 - #972

Closed
saakshaat-singh wants to merge 2 commits into
conda-forge:3.12from
saakshaat-singh:ssingh/312-security-backports
Closed

saakshaat-singh wants to merge 2 commits into
conda-forge:3.12from
saakshaat-singh:ssingh/312-security-backports

Conversation

@saakshaat-singh

@saakshaat-singh saakshaat-singh commented Nov 16, 2026 •

Copy link
Copy Markdown

Before this PR

The Python 3.12.16 package accepts command-injection characters in imaplib and poplib, leaving CVE-2025-15366 and CVE-2025-15367 unresolved on this branch.

After this PR

==COMMIT_MSG==
==COMMIT_MSG==

This adds the upstream mail-command validation patches to the Python 3.12.16 recipe and increments the build number for a rebuilt package. Installed-package regression checks verify rejection before transmission, preservation of valid commands, and cleanup of a rejected IMAP message literal.

  • IMAP uses the narrowed validation from python/cpython#153287: reject NUL, CR, and LF while preserving other quoted controls and message literals. It also incorporates the pending literal-state safeguard from python/cpython#162017.
  • POP3 uses python/cpython#143924: reject C0 controls and DEL before sending a command.

Upstream context

The corresponding 3.12 source proposals are python/cpython#162135 and python/cpython#162136. Upstream previously withheld mail backports over compatibility concerns, and the APPEND cleanup is still under review. This package proposal therefore requires an explicit decision about carrying these downstream patches; upstream acceptance is not assumed.

Related PR #969 carries mail backports for Python 3.9 and does not supply a 3.12 package. The separate Base64 proposal #973 is not required for these mail changes.

Validation

The complete 25-patch series applies to a clean v3.12.16 checkout and reproduces the tested source tree. The original 23 packaging patches are preserved. The IMAP and POP3 source suites completed 184 tests with 6 skipped using the released conda-forge Python 3.12.16 interpreter; all three installed-package regression checks passed against the patched sources. The recipe passes conda-smithy recipe-lint. Full package builds remain for feedstock CI.

Review and next steps

  1. Request packaging and backport-policy review in this PR from the Python feedstock maintainers. The official conda-forge Zulip is the documented place to ask for help routing the review.
  2. Resolve the upstream compatibility and APPEND-cleanup questions, then require the platform build matrix and installed-package checks to pass. If Backport alternative Base64 alphabet warnings to Python 3.12 #973 lands first, update the build number and patch ordering on the refreshed 3.12 base.
  3. After maintainer acceptance and package publication, downstream environments must select the rebuilt package and verify the resulting artifacts.

Testing

Possible downsides?

POP3 credentials containing control characters will now be rejected. The package would carry changes that CPython has not accepted for 3.12, including a pending IMAP follow-up, and therefore assumes responsibility for that downstream compatibility choice.

Are Docs needed?

@conda-forge-admin

conda-forge-admin commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • ℹ️ The use of pkg-config is deprecated. Please use pkgconf instead.
  • ℹ️ The recipe is not parsable by parser conda-souschef (grayskull). This parser is not currently used by conda-forge, but may be in the future. We are collecting information to see which recipes are compatible with grayskull.
  • ℹ️ The recipe is not parsable by parser conda-recipe-manager. The recipe can only be automatically migrated to the new v1 format if it is parseable by conda-recipe-manager.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/43941459712. Examine the logs at this URL for more detail.

@saakshaat-singh
saakshaat-singh force-pushed the ssingh/312-security-backports branch from c1351cf to 2bb8836 Compare November 16, 2026 19:13
@saakshaat-singh
saakshaat-singh force-pushed the ssingh/312-security-backports branch from 2bb8836 to d9cf7bf Compare November 16, 2026 19:28
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