linux/include/net/sctp
Jérémy Jean 3dbb44d88b sctp: validate cookie AUTH state before use
When cookie authentication is disabled, COOKIE_ECHO restores fixed-size
AUTH fields directly from peer-controlled cookie bytes.  A forged RANDOM
length, HMAC list, or CHUNKS list can then reach association consumers
with lengths or identifiers that were never validated against the local
backing arrays.

A forged RANDOM length can cause out-of-bounds reads during key-vector
construction.  A forged HMAC identifier also caused a 32-byte write past
a zero-length AUTH chunk, providing a primitive for a local privilege
escalation chain.

Validate the cookie's RANDOM, HMACS, and CHUNKS parameters at the cookie
trust boundary before copying them into the association.  Reject invalid
types, malformed lengths, unsupported HMAC identifiers, HMAC lists
without SHA1, and forbidden chunk ids.

Fixes: bbd0d59809 ("[SCTP]: Implement the receive and verification of AUTH chunk")
Fixes: 1f485649f5 ("[SCTP]: Implement SCTP-AUTH internals")
Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>
Acked-by: Xin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20260804200042.2412009-1-Jeremy.Jean@oss.cyber.gouv.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-07 15:02:32 -07:00
..
auth.h sctp: validate cookie AUTH state before use 2026-08-07 15:02:32 -07:00
checksum.h sctp: use skb_crc32c() instead of __skb_checksum() 2025-05-21 15:40:16 -07:00
command.h
constants.h sctp: Convert cookie authentication to use HMAC-SHA256 2025-08-19 19:36:26 -07:00
sctp.h sctp: hold socket lock when dumping endpoints in sctp_diag 2026-06-17 16:41:34 -07:00
sm.h sctp: Remove unused sctp_assoc_del_peer and sctp_chunk_iif 2025-05-05 16:51:12 -07:00
stream_interleave.h
stream_sched.h sctp: Constify struct sctp_sched_ops 2025-10-28 17:50:55 -07:00
structs.h sctp: fix auth_hmacs array size in struct sctp_cookie 2026-07-17 12:27:53 +02:00
tsnmap.h
ulpevent.h
ulpqueue.h sctp: remove unnecessary NULL check in sctp_association_init() 2022-10-20 21:43:10 -07:00