The Connection::unidir_receive function in the plugin-support crate (age-core/src/plugin.rs:229-279) appends every stanza to in-memory vectors with no upper bound. A misbehaving or malicious peer can stream arbitrary data and exhaust memory, leading to denial-of-service attacks.
Recommendation:
Impose hard per-phase caps (e.g., 1,024 stanzas or 8 MiB total) and abort on excess. The implementation should validate vector sizes before appending and return appropriate errors when limits are exceeded, preventing memory exhaustion while maintaining protocol compatibility.
The
Connection::unidir_receivefunction in theplugin-supportcrate (age-core/src/plugin.rs:229-279) appends every stanza to in-memory vectors with no upper bound. A misbehaving or malicious peer can stream arbitrary data and exhaust memory, leading to denial-of-service attacks.Recommendation:
Impose hard per-phase caps (e.g., 1,024 stanzas or 8 MiB total) and abort on excess. The implementation should validate vector sizes before appending and return appropriate errors when limits are exceeded, preventing memory exhaustion while maintaining protocol compatibility.