Skip to content

Memory errors in sample programs (not in the library) #10803

Description

@mpg

Summary

  • At programs/ssl/ssl_server2.c:1390 (dummy_ticket parse), a ticket shorter than the expected header underflows the length used for the subsequent session load, reading past the ticket buffer. Reached when ssl_server2 has dummy_ticket enabled and a peer sends a 1–3 byte ticket (mbedtls_ssl_handshake via programs/ssl/ssl_server2.c:3385), controllable by an anonymous TLS client.
  • At programs/ssl/ssl_context_info.c:885 (ALPN tail parsing of the decoded context), the tool calls strlen/compares on data whose length is not bounded against the decoded buffer. Reached from ssl_context_info -f <base64 file> (main, programs/ssl/ssl_context_info.c:903; file input :215), controllable by a local CLI user supplying the input file.

These are not security issues because they are squarely in sample programs, not the library, so not covered by our security guarantees.

But we should still fix those both as a matter of principle, and to avoid this popping up in the middle of investigating unrelated issues in the future.

Note: while at it, may want to edit the readme and/or security.md in order to make the status of sample programs clearer.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    No status
    Status
    Incoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions