Skip to content

Harden multi-threaded http server - #5149

Merged
SirTyson merged 1 commit into
stellar:masterfrom
SirTyson:harden-query-server
Feb 24, 2026
Merged

SirTyson merged 1 commit into
stellar:masterfrom
SirTyson:harden-query-server

Conversation

@SirTyson

Copy link
Copy Markdown
Contributor

Description

Fixes bug where malformed HTTP headers would crash the multithreaded HTTP server.

Checklist

  • Reviewed the contributing document
  • Rebased on top of master (no merge commits)
  • Ran clang-format v8.0.0 (via make format or the Visual Studio extension)
  • Compiles
  • Ran all tests
  • If change impacts performance, include supporting evidence per the performance document

Copilot AI left a comment

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.

Pull request overview

This PR addresses a crash vulnerability in the multi-threaded HTTP server by adding exception handling around the stoi call when parsing the Content-Length header. The fix prevents malformed HTTP headers (e.g., non-numeric Content-Length values) from crashing the server.

Changes:

  • Added try-catch block around stoi conversion of Content-Length header value to handle parsing exceptions

Comment thread lib/httpthreaded/request_parser.cpp Resolved

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread lib/httpthreaded/request_parser.cpp Resolved
Comment thread lib/httpthreaded/request_parser.cpp Resolved
Comment thread lib/httpthreaded/request_parser.cpp Resolved

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread src/main/test/HttpThreadedTests.cpp Resolved
Comment thread src/main/test/HttpThreadedTests.cpp Resolved
Comment thread lib/httpthreaded/request_parser.cpp Resolved
@SirTyson
SirTyson added this pull request to the merge queue Feb 24, 2026
Merged via the queue into stellar:master with commit a0f7010 Feb 24, 2026
55 checks passed
@SirTyson
SirTyson deleted the harden-query-server branch February 24, 2026 22:36
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