Bump net-imap from 0.3.4 to 0.3.9
Bumps net-imap from 0.3.4 to 0.3.9.
Release notes
Sourced from net-imap's releases.
v0.3.9
What's Changed
This release backports two features to prevent unbounded memory use: the
response_handlerskeyword argument toNet::IMAP.newso response handlers can be added before the server can send any responses (ruby/net-imap#438), and themax_response_sizeconfig attribute (ruby/net-imap#446).[!NOTE] The default
max_response_sizeisnil(unlimited), to avoid backward compatibility issues with secure connections to trusted servers that are well-behaved. It can be configured more conservatively to guard against untrusted servers (for example, connecting to user-provided hostnames). It is the responsibility ofnet-imapusers to configure their client appropriately for the server they are connecting to.Added
- ✨ Backport
response_handlersoption tonewby@nevansin ruby/net-imap#438- ✨ Limit max_response_size by
@nevansin ruby/net-imap#446
- Backports #444
Fixed
- 🐛 Use
Range#sizevsRange#countforuid-setlimit by@nevansin ruby/net-imap#411Documentation
- 📚 Docs: receiver thread, server responses, connection state by
@nevansin ruby/net-imap#437Other Changes
Full Changelog: https://github.com/ruby/net-imap/compare/v0.3.8...v0.3.9
v0.3.8
What's Changed
🔒 Security Fix
Mitigates CVE-2025-25186 (GHSA-7fc5-f82f-cx69): A malicious server can exhaust client memory by sending
APPENDUIDorCOPYUIDresponses with very largeuid-setranges.Net::IMAP::UIDPlusDataexpands these ranges into arrays of integers.Fix with minor API changes
For v0.3.8, this option is not available. Upgrade to v0.4.19, v0.5.6, or higher to replace
UIDPlusDatawithAppendUIDDataandCopyUIDData. These classes store their UIDs asNet::IMAP::SequenceSetobjects (not expanded into arrays of integers).Mitigate with backward compatible API
This release mitigates the attack by crashing if a server tries to send a
uid-setthat represents more than 10,000 numbers. This should be larger than almost all legitimateCOPYUIDorAPPENDUIDresponses and would limit the array to only 80KB (on a 64 bit system).For v0.3.8, this option is not configurable. Upgrade to v0.4.19, v0.5.6, or higher to configure this limit.
Please Note: unhandled responses
If the client does not add response handlers to prune unhandled responses, a malicious server can still eventually exhaust all client memory, by repeatedly sending malicious responses. However,
net-imaphas always retained unhandled responses, and it has always been necessary for long-lived connections to prune these responses. This is not significantly different from connecting to a trusted server with a long-lived connection. To limit the maximum number of retained responses, a simple handler might look something like the following:limit = 1000 imap.add_response_handler do |resp| name = resp.name code = resp.data.code&.name if resp.data.in?(Net::IMAP::ResponseText) # before 0.4.0: </tr></table>
... (truncated)
Commits
d86186d🔖 Bump version to v0.3.92aadab9🔀 Merge pull request #446 from ruby/backport/v0.3-max_response_sizee005925✅ Fix backport to not-imap 0.3 and ruby 2.6ae0fa01✅ Fix backport compatibility with ruby 2.7158cfdf✨ Make max_response_size configurable [🚧 partial]53ceba1✨ Limit max response size to 512MiB (hard-coded)4d1206e🔀 Merge pull request #439 from ruby/backport/v0.3-response_reader19495b8🔀 Merge pull request #438 from ruby/backport/v0.3-response_handlers945df80🔀 Merge pull request #437 from ruby/backport/v0.3-document-response-limitsb0a6039✅ Fix backport compatibility with ruby 2.7- Additional commits viewable in compare view
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
-
@dependabot rebasewill rebase this PR -
@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it -
@dependabot mergewill merge this PR after your CI passes on it -
@dependabot squash and mergewill squash and merge this PR after your CI passes on it -
@dependabot cancel mergewill cancel a previously requested merge and block automerging -
@dependabot reopenwill reopen this PR if it is closed -
@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually -
@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency -
@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) -
@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the Security Alerts page.