Skip to content

schannel_verify: avoid out of blob access#21543

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/schannel-blob
Closed

schannel_verify: avoid out of blob access#21543
bagder wants to merge 1 commit into
masterfrom
bagder/schannel-blob

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented May 10, 2026

The code would previously read one byte past the provided CURLOPT_CAINFO_BLOB if the blob ends exactly with -----BEGIN CERTIFICATE-----

Reported-by: Andrew Nesbit

The code would previously read one byte past the provided
CURLOPT_CAINFO_BLOB if the blob ends exactly with -----BEGIN
CERTIFICATE-----

Reported-by: Andrew Nesbit
@bagder bagder added TLS Windows Windows-specific labels May 10, 2026
@bagder bagder requested a review from Copilot May 10, 2026 13:17
@bagder bagder marked this pull request as ready for review May 10, 2026 13:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a bounds-read in Schannel certificate blob parsing when a CURLOPT_CAINFO_BLOB ends exactly with the -----BEGIN CERTIFICATE----- marker, preventing a 1-byte out-of-bounds access during newline validation.

Changes:

  • Adjusts the c_memmem() search length to guarantee there is at least one byte available after a BEGIN_CERT match before inspecting it.
  • Replaces a local newline helper with the shared ISNEWLINE() macro.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in ea75ccc May 10, 2026
@bagder bagder deleted the bagder/schannel-blob branch May 10, 2026 21:21
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
The code would previously read one byte past the provided
CURLOPT_CAINFO_BLOB if the blob ends exactly with -----BEGIN
CERTIFICATE-----

Reported-by: Andrew Nesbit
Closes curl#21543
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TLS Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

2 participants