Skip to content

Unbounded vector growth in stanza collection #578

@sneurlax

Description

@sneurlax

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions