Skip to content

[v3-2-test] Validate SMTP server certificate on STARTTLS upgrade (#65346)#65364

Merged
potiuk merged 4 commits into
v3-2-testfrom
backport-06981d4-v3-2-test
Apr 26, 2026
Merged

[v3-2-test] Validate SMTP server certificate on STARTTLS upgrade (#65346)#65364
potiuk merged 4 commits into
v3-2-testfrom
backport-06981d4-v3-2-test

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

  • Validate SMTP server certificate on STARTTLS upgrade

smtplib.SMTP.starttls() does not validate the server certificate
unless an SSL context is passed. airflow.utils.email.send_mime_email
and the SMTP provider's SmtpHook (both sync get_conn and async
aget_conn) were calling starttls() without a context, so the STARTTLS
upgrade accepted any certificate and the subsequent login() call
could send credentials over a connection terminated by a MITM.

Pass the existing SSL-context machinery (the email.ssl_context
config in core and the ssl_context connection extra in the provider)
to starttls() at all three call sites. The default becomes
ssl.create_default_context(), which validates against the system's
trusted CAs. Users who intentionally use self-signed certificates
can still opt out by setting the value to "none".

Generated-by: Claude Opus 4.6 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

  • Add newsfragment and SMTP provider changelog for STARTTLS cert default

Document the default behaviour change introduced by passing an SSL
context to the STARTTLS upgrade: system-default CA validation now
applies to both airflow.utils.email.send_email (via
email.ssl_context) and the SMTP provider's SmtpHook (via the
ssl_context connection extra). Users who intentionally run against
self-signed SMTP servers can preserve the old behaviour by setting
the value to "none".
(cherry picked from commit 06981d4)

Co-authored-by: Jarek Potiuk jarek@potiuk.com
Generated-by: Claude Opus 4.6 (1M context) noreply@anthropic.com

github-actions Bot and others added 4 commits April 26, 2026 18:56
…group (#65150) (#65160)

Bumps the github-actions-updates group with 1 update: [actions/github-script](https://github.com/actions/github-script).

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@ed59741...3a2844b)
(cherry picked from commit e5a047c)



---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…) (#65241)

* Add breeze generate issue content for airflow-ctl

* add new command to doc
(cherry picked from commit b24538b)

Co-authored-by: Justin Pakzad <114518232+justinpakzad@users.noreply.github.com>
…5118) (#65242)

* Move release calendar verification to its own scheduled workflow

Run dev/verify_release_calendar.py from a dedicated daily scheduled
workflow instead of as a canary job in the main CI pipeline, and
notify the #release-management Slack channel when the check fails so
the issue is surfaced to release managers directly.

* Include wiki and calendar links in release calendar Slack alert
(cherry picked from commit 048e9a1)
)

* Validate SMTP server certificate on STARTTLS upgrade

smtplib.SMTP.starttls() does not validate the server certificate
unless an SSL context is passed. airflow.utils.email.send_mime_email
and the SMTP provider's SmtpHook (both sync get_conn and async
aget_conn) were calling starttls() without a context, so the STARTTLS
upgrade accepted any certificate and the subsequent login() call
could send credentials over a connection terminated by a MITM.

Pass the existing SSL-context machinery (the email.ssl_context
config in core and the ssl_context connection extra in the provider)
to starttls() at all three call sites. The default becomes
ssl.create_default_context(), which validates against the system's
trusted CAs. Users who intentionally use self-signed certificates
can still opt out by setting the value to "none".

Generated-by: Claude Opus 4.6 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Add newsfragment and SMTP provider changelog for STARTTLS cert default

Document the default behaviour change introduced by passing an SSL
context to the STARTTLS upgrade: system-default CA validation now
applies to both airflow.utils.email.send_email (via
email.ssl_context) and the SMTP provider's SmtpHook (via the
ssl_context connection extra). Users who intentionally run against
self-signed SMTP servers can preserve the old behaviour by setting
the value to "none".
(cherry picked from commit 06981d4)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@potiuk potiuk force-pushed the backport-06981d4-v3-2-test branch from 6e80de5 to 3a121b9 Compare April 26, 2026 16:56
@potiuk potiuk merged commit 9497dac into v3-2-test Apr 26, 2026
77 checks passed
@potiuk potiuk deleted the backport-06981d4-v3-2-test branch April 26, 2026 19:45
vatsrahul1001 pushed a commit that referenced this pull request Apr 27, 2026
) (#65364)

* [v3-2-test] Bump actions/github-script in the github-actions-updates group (#65150) (#65160)

Bumps the github-actions-updates group with 1 update: [actions/github-script](https://github.com/actions/github-script).

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@ed59741...3a2844b)
(cherry picked from commit e5a047c)



---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [v3-2-test] Added breeze generate issue content for airflow-ctl (#65042) (#65241)

* Add breeze generate issue content for airflow-ctl

* add new command to doc
(cherry picked from commit b24538b)

Co-authored-by: Justin Pakzad <114518232+justinpakzad@users.noreply.github.com>

* [v3-2-test] Run release calendar verification on its own schedule (#65118) (#65242)

* Move release calendar verification to its own scheduled workflow

Run dev/verify_release_calendar.py from a dedicated daily scheduled
workflow instead of as a canary job in the main CI pipeline, and
notify the #release-management Slack channel when the check fails so
the issue is surfaced to release managers directly.

* Include wiki and calendar links in release calendar Slack alert
(cherry picked from commit 048e9a1)

* [v3-2-test] Validate SMTP server certificate on STARTTLS upgrade (#65346)

* Validate SMTP server certificate on STARTTLS upgrade

smtplib.SMTP.starttls() does not validate the server certificate
unless an SSL context is passed. airflow.utils.email.send_mime_email
and the SMTP provider's SmtpHook (both sync get_conn and async
aget_conn) were calling starttls() without a context, so the STARTTLS
upgrade accepted any certificate and the subsequent login() call
could send credentials over a connection terminated by a MITM.

Pass the existing SSL-context machinery (the email.ssl_context
config in core and the ssl_context connection extra in the provider)
to starttls() at all three call sites. The default becomes
ssl.create_default_context(), which validates against the system's
trusted CAs. Users who intentionally use self-signed certificates
can still opt out by setting the value to "none".

Generated-by: Claude Opus 4.6 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Add newsfragment and SMTP provider changelog for STARTTLS cert default

Document the default behaviour change introduced by passing an SSL
context to the STARTTLS upgrade: system-default CA validation now
applies to both airflow.utils.email.send_email (via
email.ssl_context) and the SMTP provider's SmtpHook (via the
ssl_context connection extra). Users who intentionally run against
self-signed SMTP servers can preserve the old behaviour by setting
the value to "none".
(cherry picked from commit 06981d4)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Justin Pakzad <114518232+justinpakzad@users.noreply.github.com>
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.2.2 milestone May 15, 2026
@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label May 19, 2026
vatsrahul1001 pushed a commit that referenced this pull request May 20, 2026
) (#65364)

* [v3-2-test] Bump actions/github-script in the github-actions-updates group (#65150) (#65160)

Bumps the github-actions-updates group with 1 update: [actions/github-script](https://github.com/actions/github-script).

Updates `actions/github-script` from 8.0.0 to 9.0.0
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@ed59741...3a2844b)
(cherry picked from commit e5a047c)



---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: 9.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [v3-2-test] Added breeze generate issue content for airflow-ctl (#65042) (#65241)

* Add breeze generate issue content for airflow-ctl

* add new command to doc
(cherry picked from commit b24538b)

Co-authored-by: Justin Pakzad <114518232+justinpakzad@users.noreply.github.com>

* [v3-2-test] Run release calendar verification on its own schedule (#65118) (#65242)

* Move release calendar verification to its own scheduled workflow

Run dev/verify_release_calendar.py from a dedicated daily scheduled
workflow instead of as a canary job in the main CI pipeline, and
notify the #release-management Slack channel when the check fails so
the issue is surfaced to release managers directly.

* Include wiki and calendar links in release calendar Slack alert
(cherry picked from commit 048e9a1)

* [v3-2-test] Validate SMTP server certificate on STARTTLS upgrade (#65346)

* Validate SMTP server certificate on STARTTLS upgrade

smtplib.SMTP.starttls() does not validate the server certificate
unless an SSL context is passed. airflow.utils.email.send_mime_email
and the SMTP provider's SmtpHook (both sync get_conn and async
aget_conn) were calling starttls() without a context, so the STARTTLS
upgrade accepted any certificate and the subsequent login() call
could send credentials over a connection terminated by a MITM.

Pass the existing SSL-context machinery (the email.ssl_context
config in core and the ssl_context connection extra in the provider)
to starttls() at all three call sites. The default becomes
ssl.create_default_context(), which validates against the system's
trusted CAs. Users who intentionally use self-signed certificates
can still opt out by setting the value to "none".

Generated-by: Claude Opus 4.6 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions

* Add newsfragment and SMTP provider changelog for STARTTLS cert default

Document the default behaviour change introduced by passing an SSL
context to the STARTTLS upgrade: system-default CA validation now
applies to both airflow.utils.email.send_email (via
email.ssl_context) and the SMTP provider's SmtpHook (via the
ssl_context connection extra). Users who intentionally run against
self-signed SMTP servers can preserve the old behaviour by setting
the value to "none".
(cherry picked from commit 06981d4)

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Co-authored-by: Justin Pakzad <114518232+justinpakzad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment