Skip to content

fix(crypto): locate PEM_CERT_END after PEM_CERT_BEGIN in get_fmspc_from_quote#855

Merged
jyao1 merged 1 commit into
intel:mainfrom
haitaohuang:upstream/pr1c-pem-cert
May 29, 2026
Merged

fix(crypto): locate PEM_CERT_END after PEM_CERT_BEGIN in get_fmspc_from_quote#855
jyao1 merged 1 commit into
intel:mainfrom
haitaohuang:upstream/pr1c-pem-cert

Conversation

@haitaohuang
Copy link
Copy Markdown
Contributor

find(PEM_CERT_END) searched from offset 0 of the lossy-decoded quote string, so if any byte sequence matching the END marker appeared before the BEGIN marker (or BEGIN was absent), end_index < start_index and the subsequent slice operation panicked.

Search for END strictly after the end of BEGIN, and return InvalidQuote on malformed input. Real hardware quotes never trigger the bug, but the parser should not panic on hostile input.

…om_quote

find(PEM_CERT_END) searched from offset 0 of the lossy-decoded quote
string, so if any byte sequence matching the END marker appeared before
the BEGIN marker (or BEGIN was absent), end_index < start_index and
the subsequent slice operation panicked.

Search for END strictly after the end of BEGIN, and return InvalidQuote
on malformed input. Real hardware quotes never trigger the bug, but the
parser should not panic on hostile input.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Haitao Huang <haitaohuang@microsoft.com>
@haitaohuang haitaohuang requested review from jyao1 and sgrams as code owners May 27, 2026 01:33
@jyao1 jyao1 merged commit 70686c6 into intel:main May 29, 2026
55 checks passed
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