SABITHSAHEB opened a new pull request, #14132:
URL: https://github.com/apache/trafficserver/pull/14132

   stek_share replicates the session ticket key through Raft, and 
STEKShareSM::commit() and save_logical_snp_obj() read it with 
buffer_serializer::get_bytes(len). That len is the 32-bit length prefix the 
leader wrote into the log entry or snapshot object; NuRaft only checks it 
against the size of the received buffer. The only check that it equals 
SSL_TICKET_KEY_SIZE was an assert(), which is gone in RelWithDebInfo and 
Release builds (-DNDEBUG), and both functions then memcpy len bytes into a 
48-byte ssl_ticket_key_t: the state machine's stek_ member in commit() and a 
stack local in save_logical_snp_obj(). Any cluster member that becomes leader 
can therefore overwrite heap or stack memory on every follower with a longer 
payload, and a shorter one leaves a key built partly from stale bytes. I 
confirmed it by compiling the unmodified state_machine.h against NuRaft's own 
buffer and serializer code with -DNDEBUG and ASan: a 4096-byte payload reports 
heap-buffer-overflow WRITE of size 4096
  at state_machine.h:60 (commit) and stack-buffer-overflow at 
state_machine.h:140 (save_logical_snp_obj), and with this change both are 
rejected with a TSError while 48-byte keys apply as before. A rejected snapshot 
object leaves snapshot_ untouched rather than clearing it, because NuRaft 
terminates the process when apply_snapshot() fails.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to