Skip to content

fix(cpp-boost-beast): validate request components#24351

Draft
bold84 wants to merge 1 commit into
OpenAPITools:masterfrom
bold84:fix/cpp-boost-beast-request-validation
Draft

fix(cpp-boost-beast): validate request components#24351
bold84 wants to merge 1 commit into
OpenAPITools:masterfrom
bold84:fix/cpp-boost-beast-request-validation

Conversation

@bold84

@bold84 bold84 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • validate method tokens, origin-form request targets, percent escapes, and caller-provided headers before serializing requests
  • reject transport-owned framing headers and unsafe host/port input while preserving service-name ports and extension methods
  • regenerate the Petstore client and add template plus runtime regression coverage

Verification

  • ./mvnw -pl modules/openapi-generator -am -Dtest=CppBoostBeastClientCodegenTest -Dsurefire.failIfNoSpecifiedTests=false -Djacoco.skip=true test
  • ./mvnw -pl modules/openapi-generator-cli -am package -DskipTests -Dmaven.javadoc.skip=true
  • bin/generate-samples.sh bin/configs/cpp-boost-beast-client-petstore.yaml
  • CMake build of api_tests
  • HttpClientBehaviorTest/* (9 tests)

Summary by cubic

Hardens the cpp-boost-beast HTTP client by validating method, target, headers, host, and port to prevent unsafe input and reserved header misuse. Preserves custom/extension methods and regenerates the Petstore client with tests.

  • Bug Fixes
    • Validate method tokens, origin-form targets (with percent escapes), and header names/values; reject control characters.
    • Block caller-supplied transport/framing headers (Host, Content-Length, Transfer-Encoding, Connection, Proxy-Connection, Keep-Alive, TE, Trailer, Expect, Proxy-Authorization).
    • Validate host and port; allow service-name ports and custom methods.
    • Use request.method_string(verb) and explicit target/body; keep correct IPv4/IPv6 Host formatting.
    • Add regression tests and regenerate the Petstore client.

Written for commit 906500c. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 4 files

Re-trigger cubic

@bold84
bold84 force-pushed the fix/cpp-boost-beast-request-validation branch from cac47b6 to 906500c Compare July 19, 2026 18:51
@bold84
bold84 marked this pull request as draft July 20, 2026 05:40
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.

1 participant