Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starttls: Clear unencrypted commands from buffer #380

Merged
merged 2 commits into from
May 18, 2024

Conversation

Arusekk
Copy link
Contributor

@Arusekk Arusekk commented Jul 9, 2023

What do these changes do?

When a STARTTLS command is not the last one in a pipeline, extra unencrypted commands may treated as part of the encrypted communication, effectively allowing to bypass the ALLOWED_BEFORE_STARTTLS list used when require_starttls=True. This PR adds a buffer flush to ensure it does not happen.

Are there changes in behavior for the user?

No behaviour change. Documentation reflects the changes already.

Related issue number

None.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • tox testenvs have been executed in the following environments:
    • Linux (Ubuntu 18.04, Ubuntu 20.04, Arch): {py36,py37,py38,py39}-{nocov,cov,diffcov}, qa, docs
    • Windows (7, 10): {py36,py37,py38,py39}-{nocov,cov,diffcov}
    • WSL 1.0 (Ubuntu 18.04): {py36,py37,py38,py39}-{nocov,cov,diffcov}, pypy3-{nocov,cov}, qa, docs
    • FreeBSD (12.2, 12.1, 11.4): {py36,pypy3}-{nocov,cov,diffcov}, qa
    • Cygwin: py36-{nocov,cov,diffcov}, qa, docs
  • Documentation reflects the changes
  • Add a news fragment into the NEWS.rst file

Copy link

codecov bot commented May 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.80%. Comparing base (0301e9c) to head (96b5ca2).
Report is 62 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #380      +/-   ##
==========================================
- Coverage   97.82%   97.80%   -0.02%     
==========================================
  Files          23       23              
  Lines        5706     5707       +1     
  Branches      764      764              
==========================================
  Hits         5582     5582              
- Misses         78       80       +2     
+ Partials       46       45       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

aiosmtpd/smtp.py Outdated Show resolved Hide resolved
@Arusekk Arusekk force-pushed the starttls-buffer-clear branch 3 times, most recently from 05568af to 8c31694 Compare May 18, 2024 10:26
aiosmtpd/smtp.py Outdated Show resolved Hide resolved
@Dreamsorcerer Dreamsorcerer merged commit b3a4a2c into aio-libs:master May 18, 2024
24 of 25 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