Skip to content

Add checking in SHE response handlers#391

Open
padelsbach wants to merge 2 commits into
wolfSSL:mainfrom
padelsbach:she-response-checking
Open

Add checking in SHE response handlers#391
padelsbach wants to merge 2 commits into
wolfSSL:mainfrom
padelsbach:she-response-checking

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

Check for group, action and len in SHE response handlers. Found with experimental fuzzing.

Comment thread src/wh_client_she.c

resp = (whMessageShe_SetUidResponse*)wh_CommClient_GetDataPtr(c->comm);
ret = wh_Client_RecvResponse(c, &group, &action, &dataSz, (uint8_t*)resp);
if (ret == WH_ERROR_OK) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could macro'ize this, but not sure if that's more readable

@padelsbach padelsbach marked this pull request as ready for review May 29, 2026 23:07

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #391

Scan targets checked: wolfhsm-core-bugs, wolfhsm-src

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread src/wh_client_she.c Outdated
@padelsbach padelsbach force-pushed the she-response-checking branch from d367077 to 8616f78 Compare June 1, 2026 20:56
@padelsbach padelsbach removed their assignment Jun 1, 2026
Comment thread src/wh_client_she.c
Comment on lines +100 to +101
if (group != WH_MESSAGE_GROUP_SHE ||
action != WH_SHE_SET_UID ||

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all these group and action checks are redundant, as they are handled in the comm layer. Otherwise every single client response check would need these.

Also, do you think the size check could be pushed down to the comm layer somehow in a uniform way, perhaps via same mechanism as #389 and #388? Currently these would need to be done inline everywhere.

Note we dont care THAT much about this fuzzing style stuff - currently the threat model is such that transports are trusted. If someone can modify data in your transport, all bets are off. So temped to just not do the infinite bikeshedding around input sanitation that fenrir keeps pointing out....

@bigbrett bigbrett assigned padelsbach and unassigned bigbrett Jun 9, 2026
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.

3 participants