Skip to content

Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%'#1134

Merged
gittiver merged 2 commits into
CrowCpp:masterfrom
shan-tanu-joshi-3010:fix-query-string-oob
Feb 25, 2026
Merged

Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%'#1134
gittiver merged 2 commits into
CrowCpp:masterfrom
shan-tanu-joshi-3010:fix-query-string-oob

Conversation

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor

This PR fixes the issue reported in #1126.

Problem:
Malformed percent-encoding (e.g. trailing '%') caused an out-of-bounds
read in the query_string parser.

Fix:
Added bounds checking before decoding percent-encoded sequences to
avoid reading past the buffer.

Testing:

  • Reproduced crash with AddressSanitizer before fix
  • Verified no ASan issues after fix
  • Valid URLs unaffected

Fixes #1126

Comment thread test_fix.cpp Outdated
Comment thread test_fix.cpp Outdated
@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

test_fix has been deleted

@gittiver gittiver merged commit 6571a06 into CrowCpp:master Feb 25, 2026
19 checks passed
gittiver added a commit that referenced this pull request Mar 29, 2026
…gfix release

* master: (22 commits)
  fix#1165: sanitize header values to prevent injection and add helloworld_inject example (#1167)
  Handle headers for HTTPMethod::Options
  Fix build on OpenBSD (#1162)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Feature#1129-CMake Error: ALIAS target "Boost::system" name collision when using vcpkg and FetchContent (#1133)
  Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%' (#1134)
  Minor features to crow::json::wvalue (#1143)
  ...

# Conflicts:
#	.github/workflows/build_and_test.yml
gittiver added a commit that referenced this pull request Mar 29, 2026
…gfix release

* master: (22 commits)
  fix#1165: sanitize header values to prevent injection and add helloworld_inject example (#1167)
  Handle headers for HTTPMethod::Options
  Fix build on OpenBSD (#1162)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Enable compiler sanitizers for test builds (Fixes #1137)
  Feature#1129-CMake Error: ALIAS target "Boost::system" name collision when using vcpkg and FetchContent (#1133)
  Fix heap-buffer-overflow in query_string when parsing malformed '%'Fix heap-buffer-overflow in query_string for malformed '%' (#1134)
  Minor features to crow::json::wvalue (#1143)
  ...

# Conflicts:
#	.github/workflows/build_and_test.yml
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.

heap-overflow (read) via invalid url

2 participants