Skip to content

fix: add VerifyCmdLength before SEND_HK_MID cast in EVS and ES dispatch#2755

Open
stark256-spec wants to merge 1 commit into
nasa:devfrom
stark256-spec:fix/hk-mid-verifycmdlength-evs-es
Open

fix: add VerifyCmdLength before SEND_HK_MID cast in EVS and ES dispatch#2755
stark256-spec wants to merge 1 commit into
nasa:devfrom
stark256-spec:fix/hk-mid-verifycmdlength-evs-es

Conversation

@stark256-spec
Copy link
Copy Markdown

Fixes nasa/cFS#987 (EVS) and nasa/cFS#986 (ES).

Both CFE_EVS_ProcessCommandPacket() and CFE_ES_TaskPipe() cast the SB buffer directly to *SendHkCmd_t without calling VerifyCmdLength first. Every other command code in the respective ProcessGroundCommand/ProcessGroundCmd switches is guarded by VerifyCmdLength before the cast. A truncated SEND_HK_MID packet silently bypasses validation and causes an OOB struct-field read.

Adds the missing VerifyCmdLength guard in both dispatch functions, matching the existing pattern for all ground commands.

CFE_EVS_ProcessCommandPacket() and CFE_ES_TaskPipe() both cast the SB
buffer directly to *SendHkCmd_t without calling VerifyCmdLength first.
Every other command code in ProcessGroundCommand/ProcessGroundCmd is
guarded by a VerifyCmdLength check before the cast. A truncated or
malformed SEND_HK_MID packet silently bypasses validation and causes
an OOB read when the handler accesses struct fields beyond the actual
packet boundary.

Add the missing VerifyCmdLength guard in both dispatch functions,
matching the existing pattern used for all ground commands.

Fixes nasa/cFS#987 (EVS)
Fixes nasa/cFS#986 (ES)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY] Missing length validation for CFE_EVS_SEND_HK_MID in EVS ProcessCommandPacket

2 participants