Skip to content

Fenrir Fixes - 1290,2110,1717#580

Open
aidankeefe2022 wants to merge 1 commit into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun25-ak
Open

Fenrir Fixes - 1290,2110,1717#580
aidankeefe2022 wants to merge 1 commit into
wolfSSL:masterfrom
aidankeefe2022:fenrir-fixes-jun25-ak

Conversation

@aidankeefe2022

Copy link
Copy Markdown
Member

@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 #580

Scan targets checked: wolfssl-examples-bugs, wolfssl-examples-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 embedded/tls-info.h
for (i = 0; i < sz; i++)
sprintf(serialMsg + strLen + (i*3), ":%02x ", serial[i]);
snprintf(serialMsg + strLen + (i*3),
((int)sizeof(serialMsg)) - strLen - (i*3), ":%02x ", serial[i]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 [High] snprintf size goes negative — stack overflow on long cert serial still possible · Buffer overflows

Once strLen + i*3 exceeds 80 (peer serial ≥ ~24 bytes), the size ((int)sizeof(serialMsg)) - strLen - (i*3) is negative and converts to a huge size_t, while the destination serialMsg + strLen + i*3 is already past the 80-byte buffer, so a peer cert with a long serial overflows the stack.

Fix: Size serialMsg for the worst case (strLen + sz*3 + 1) and break out when the remaining size would be <= 0.

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.

2 participants