Skip to content

Fix hanging Tomcat block response for rejected encoded-slash paths - #13543

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 10 commits into
masterfrom
APPSEC-71828
Nov 19, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 10 commits into
masterfrom
APPSEC-71828

Conversation

@jandro996

@jandro996 jandro996 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What Does This Do

When AppSec blocks a request whose path Tomcat itself rejects (for example an encoded slash, ..%2f..%2fetc%2fpasswd), the client now gets the complete 403 block page. Before, it got the 403 status line and a Content-Length, but no body, and the connection stayed open until the client gave up.

Unblocked requests with an encoded slash still get Tomcat's own 400. Blocks on the query string, headers and body are unchanged.

Stacked on #13525 (APPSEC-71827): this PR targets the APPSEC-71827 branch, so the diff shows only this change. It will be rebased onto master and retargeted once #13525 merges.

Motivation

Found by the end-to-end validation of AAP blocking on the Spring Boot / Tomcat stacks of an escalation customer (5 services: Spring Boot 3.5.11 / Tomcat 10.1.52 and Spring Boot 4.0.x / Tomcat 11). With a blocking URI rule (crs-930-100), the span reported http.status_code=403 and appsec.blocked=true, but the client never received the response body and timed out (curl -m 5, 3/3 on each version). This happens on 1.66.0, 1.69.0 and master, so it is not a regression.

How it happens:

  1. With the default encodedSolidusHandling=REJECT, CoyoteAdapter.postParseRequest calls response.sendError(400), which suspends the response output.
  2. postParseRequest still returns true, and the error page is normally rendered later in the pipeline.
  3. Our PostParseAdvice evaluates the WAF and commits the block page. TomcatBlockingHelper.start() calls Response.reset(), which clears the status and headers but does not lift the suspension (only OutputBuffer.recycle() or setSuspended(false) does).
  4. So the template write and the stream close were dropped, while Tomcat still sent 403 + Content-Length: 226 over a keep-alive connection.

commitBlockingResponse returned true, so no block_failure was reported either.

Additional Notes

  • Fix: after reset(), the helper lifts the suspension (if (resp.isSuspended()) resp.setSuspended(false)). Tomcat's own ErrorReportValve, StandardHostValve and CoyoteAdapter do the same before they write a response after sendError. Both methods are public on catalina Response from 5.5 to 11, and muzzle passes on tomcat-5.5 and tomcat-appsec-7.0.
  • Why the 403 and not Tomcat's 400: the WAF already decided to block, and the span and the AppSec event say so. Sending the block page keeps the client, the span and the event consistent, and it matches the same attack sent in the query string. The alternative was to skip the block when the response is already in error and let the 400 go out. It was not picked because the span and event would then report a block the client never saw.
  • Side effect: the same helper serves the response-phase commit in CommitActionInstrumentation (tomcat-appsec-7.0). If the application had already suspended the response (for example with sendError()), the block page is now written instead of being silently dropped. The same holds for a block committed later in the pipeline (body or multipart parsing, user blocking). This is safe even when the pipeline continues after the commit: the coyote Response.reset() also clears the error state (recycle(false) -> resetError()), so StandardHostValve and ErrorReportValve do not render their error page over the block page. No dedicated test covers these paths.
  • Out of scope: a response whose OutputBuffer is already closed is not handled. The integration test runs on Tomcat 10.1 and 11 only. Tomcat 9 uses the same helper and its suites pass, but no test pins this bug there (possible follow-up).
  • Tests:
    • TomcatBlockingHelperTest: the suspension is lifted after reset() and before the write; it is left alone when the response is not suspended.
    • TomcatEncodedSlashBlockingForkedTest runs on Tomcat 10.1 and 11 (latest10ForkedTest, latestDepForkedTest). It blocks from the URI callback, as a URI WAF rule does, and uses a raw socket to check that the body length equals Content-Length. Without the fix it fails with "received 0 of 190 Content-Length bytes". It also checks that an unblocked encoded-slash path still gets Tomcat's 400, and that blocking a plain path still works.
  • End-to-end on the validation harness, with Spring Boot 3.5.11 / Tomcat 10.1.52 and 4.0.6 / Tomcat 11.0.21, Java 21 and 25:
    • The blocked %2f request now returns 403 + 226 bytes in 2-9 ms. Before, it returned 403, 0 bytes and a 5 s timeout.
    • Without the agent and in detect-only mode the result is still 400 + 435 bytes.
    • Compared with master: 0 cells regress.

Contributor Checklist

Jira ticket: APPSEC-71828

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

- HttpMessageConverterInstrumentation: advise the SmartHttpMessageConverter
  overloads read(ResolvableType, HttpInputMessage, Map) and
  write(Object, ResolvableType, MediaType, HttpOutputMessage, Map)
  (spring-web 6.2+: Jackson 3 and Kotlin serialization converters, the
  Spring Boot 4 default for JSON)
- ObjectIntrospection: convert Jackson 3 (tools.jackson) JsonNode bodies
- Add spring7Test suite (Spring 7.0.7, Jackson 3.1.2) in spring-webmvc-6.0
  and jackson3Test suite in appsec
Initial ArrayList/HashMap capacities in doConversionJacksonNode used the
full node size, so an oversized Jackson 2 or 3 node allocated slots the
conversion never fills (it stops at the element budget).
Generic Map, Collection and array conversions now size their output
containers by the remaining element budget, and the three object loops
stop at the first key dropped for lack of budget instead of walking the
remaining keys. The converted output is unchanged.
Covers the Iterable<Map.Entry> branch and the Jackson node key loop with
inputs larger than the element budget.
Tomcat rejects an encoded slash in the path with sendError(400), which
suspends the response output. Response.reset() does not lift that
suspension, so a WAF block committed afterwards sent its 403 status and
Content-Length but dropped the body, and the client waited on the open
connection. The blocking helper now lifts the suspension after the reset,
as Tomcat's own error valves do before they write.
Pins that the blocking helper lifts the sendError suspension after the
reset and before writing the block page, and leaves the suspension flag
alone when the response is not suspended.
Runs on Tomcat 10.1 and 11 through the latest10 and latestDep forked
suites. A URI callback blocks the request, as a URI WAF rule would, and a
raw socket checks that the 403 body matches its Content-Length. It also
checks that an unblocked encoded-slash path still gets Tomcat's 400 and
that blocking a plain path is unchanged.
Shares the blocked-path assertions in one helper, keeps the URI callback
records per test instance, and drops an unused toString().
- Pin encodedSolidusHandling=reject on the forked test connector, so the
  test always reaches the sendError(400) path it guards
- Mention the suspension check in the TomcatBlockingHelperTest Javadoc
@jandro996 jandro996 added type: bug fix Bug fix comp: asm waf Application Security Management (WAF) labels Nov 19, 2026
@jandro996

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T08:13:39.743217Z cd45b72 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-19T08:14:31.408768Z cd45b72 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: cd45b729e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: cd45b729e4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@jandro996
jandro996 marked this pull request as ready for review November 19, 2026 08:11
@jandro996
jandro996 requested review from a team as code owners November 19, 2026 08:11
@jandro996
jandro996 requested review from dromanol, jpbempel, manuel-alvarez-alvarez and ygree and removed request for a team November 19, 2026 08:11

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 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.

Bits Code Review: PASS

More details

Clearing Tomcat’s response suspension before writing addresses the dropped block-page body after encoded-slash rejection. Static review found no actionable defect; runtime behavior was not exercised.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit cd45b72

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 68.82% (+8.15%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 185f934 | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.91 s 14.78 s [+0.1%; +1.7%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.58 s 13.80 s [-2.6%; -0.5%] (maybe better)
startup:petclinic:appsec:Agent 17.79 s 17.41 s [+1.1%; +3.2%] (significantly worse)
startup:petclinic:iast:Agent 17.53 s 16.68 s [-1.1%; +11.3%] (unstable)
startup:petclinic:profiling:Agent 16.77 s 17.27 s [-7.1%; +1.3%] (no difference)
startup:petclinic:sca:Agent 17.71 s 17.61 s [-0.5%; +1.7%] (no difference)
startup:petclinic:tracing:Agent 16.43 s 16.92 s [-7.1%; +1.3%] (no difference)

Commit: 185f934b · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Base automatically changed from APPSEC-71827 to master November 19, 2026 12:12
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested a review from a team as a code owner November 19, 2026 12:12
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot requested review from AlexeyKuznetsov-DD and removed request for a team November 19, 2026 12:12
@jandro996
jandro996 enabled auto-merge November 19, 2026 12:12
@jandro996
jandro996 added this pull request to the merge queue Nov 19, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-19 13:34:41 UTC ℹ️ Start processing command /merge


2026-11-19 13:34:45 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-11-19 14:09:18 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for a75f5fc:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@jandro996
jandro996 added this pull request to the merge queue Nov 19, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-19 14:24:09 UTC ℹ️ Start processing command /merge


2026-11-19 14:24:14 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-11-19 15:09:24 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit bcc328c into master Nov 19, 2026
919 of 921 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the APPSEC-71828 branch November 19, 2026 15:09
@github-actions github-actions Bot added this to the 1.70.0 milestone Nov 19, 2026
jandro996 added a commit that referenced this pull request Nov 20, 2026
#13571)

* Add AppSec response-phase blocking to the Jetty 12 instrumentation (#13318)

Block Jetty 12 responses before commit on response-phase AppSec rules

Enable Jetty 12 blocking on response tests

Mark the Jetty 12 BlockResponseFunction after a response-phase block and reuse shared helpers

Claim the BlockResponseFunction with tryClaim after a response-phase block

Exclude client disconnects from telemetry on response-phase block write failures

Merge branch 'master' into APPSEC-71562-response-phase

Claim the BlockResponseFunction before writing the response-phase block page

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
(cherry picked from commit 5b2296d)

* Defer Jetty 12 request completion until a mid-handler blocking write finishes (#13493)

Defer Jetty 12 request completion until a mid-handler block write finishes

The Jetty 12 BlockResponseFunction writes the blocking response
asynchronously. Mid-handler callers (RASP, user blocking, session id,
Jersey JSON body) then throw BlockingException, and ee8/ee9/ee10 complete
the Handler callback right away. If the block write is still pending,
Jetty cancels it and the client receives a truncated blocking page.

The Server.handle AppSec advice now wraps the Handler callback when AppSec
is active and our BlockResponseFunction is registered. While a block
write is in flight, the wrapper parks the first completion and replays it
with the same outcome from the write callback. Otherwise completions are
forwarded unchanged. No Jetty thread waits.

Add Java/JUnit 5 forked tests for ee10 and ee9 that block mid-handler
with a large custom template against a slow reader. Without the change
the client receives about 64 KB of a 400 KiB page.

Defer Jetty 12 completion for core handler throws and response-phase blocks

A Throwable escaping Server.handle from a core handler made Jetty fail its
own reference to the Handler callback, bypassing the deferring wrapper.
The exit advice now fails the callback through the wrapper and returns as
handled.

The response-phase block write now also marks itself in flight on the
wrapper, so a completion arriving while it is pending (async servlet
writes, or a mid-handler caller that lost the claim) is deferred too.

Combine write callback invocation type and encapsulate in-flight tracking

Write callbacks that may replay the parked Handler completion now declare
the combined invocation type of their own callback and the wrapper, so
Jetty does not run blocking completion work as non-blocking.

Keep the in-flight write tracking inside JettyBlockResponseFunction
(null-safe start/finish, finish-then-release), and tidy the related tests.

review: pre-PR checks

- Only take over a Throwable escaping Server.handle while a block write
  is in flight; otherwise Jetty behaves as before
- Catch Exception, not Throwable, on the request-thread takeover path
- Complete the original write callback before replaying the parked
  Handler completion in the response-phase block callback
- Add a forked end-to-end test for a core Handler that throws after a
  mid-handler block, exercising the real Server.handle advice
- Tidy a block comment and static imports

Address review: cover parked completions and unhandled core blocks

- Take over a Throwable escaping Server.handle while the wrapper is
  deferring, including when a completion is already parked
- When a core handler returns false after a blocking response was
  initiated, complete the wrapper and report the request as handled,
  instead of letting Jetty write a 404 over the blocking page
- Align the failDeferred Javadoc with its catch (Exception)
- Add the ee8 truncation test
- Make the wrapper's write tracking methods package-private

Document the request parameter of completeUnhandledBlock

Merge branch 'master' into APPSEC-71599

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
(cherry picked from commit f74c7fd)

* Fix Spring MVC 7 SmartHttpMessageConverter bodies not reaching the WAF (#13525)

Send Spring 7 SmartHttpMessageConverter bodies to the WAF

- HttpMessageConverterInstrumentation: advise the SmartHttpMessageConverter
  overloads read(ResolvableType, HttpInputMessage, Map) and
  write(Object, ResolvableType, MediaType, HttpOutputMessage, Map)
  (spring-web 6.2+: Jackson 3 and Kotlin serialization converters, the
  Spring Boot 4 default for JSON)
- ObjectIntrospection: convert Jackson 3 (tools.jackson) JsonNode bodies
- Add spring7Test suite (Spring 7.0.7, Jackson 3.1.2) in spring-webmvc-6.0
  and jackson3Test suite in appsec

Cap Jackson node container capacity to the conversion budget

Initial ArrayList/HashMap capacities in doConversionJacksonNode used the
full node size, so an oversized Jackson 2 or 3 node allocated slots the
conversion never fills (it stops at the element budget).

Bound ObjectIntrospection work by the element budget

Generic Map, Collection and array conversions now size their output
containers by the remaining element budget, and the three object loops
stop at the first key dropped for lack of budget instead of walking the
remaining keys. The converted output is unchanged.

Test the entry-iterable and Jackson 2 node budget paths

Covers the Iterable<Map.Entry> branch and the Jackson node key loop with
inputs larger than the element budget.

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
(cherry picked from commit 20045be)

* Fix hanging Tomcat block response for rejected encoded-slash paths (#13543)

Send Spring 7 SmartHttpMessageConverter bodies to the WAF

- HttpMessageConverterInstrumentation: advise the SmartHttpMessageConverter
  overloads read(ResolvableType, HttpInputMessage, Map) and
  write(Object, ResolvableType, MediaType, HttpOutputMessage, Map)
  (spring-web 6.2+: Jackson 3 and Kotlin serialization converters, the
  Spring Boot 4 default for JSON)
- ObjectIntrospection: convert Jackson 3 (tools.jackson) JsonNode bodies
- Add spring7Test suite (Spring 7.0.7, Jackson 3.1.2) in spring-webmvc-6.0
  and jackson3Test suite in appsec

Cap Jackson node container capacity to the conversion budget

Initial ArrayList/HashMap capacities in doConversionJacksonNode used the
full node size, so an oversized Jackson 2 or 3 node allocated slots the
conversion never fills (it stops at the element budget).

Bound ObjectIntrospection work by the element budget

Generic Map, Collection and array conversions now size their output
containers by the remaining element budget, and the three object loops
stop at the first key dropped for lack of budget instead of walking the
remaining keys. The converted output is unchanged.

Test the entry-iterable and Jackson 2 node budget paths

Covers the Iterable<Map.Entry> branch and the Jackson node key loop with
inputs larger than the element budget.

Write the Tomcat block page when the response was suspended by sendError

Tomcat rejects an encoded slash in the path with sendError(400), which
suspends the response output. Response.reset() does not lift that
suspension, so a WAF block committed afterwards sent its 403 status and
Content-Length but dropped the body, and the client waited on the open
connection. The blocking helper now lifts the suspension after the reset,
as Tomcat's own error valves do before they write.

Test the Tomcat block commit on a suspended response

Pins that the blocking helper lifts the sendError suspension after the
reset and before writing the block page, and leaves the suspension flag
alone when the response is not suspended.

Test blocking a Tomcat request whose encoded-slash path was rejected

Runs on Tomcat 10.1 and 11 through the latest10 and latestDep forked
suites. A URI callback blocks the request, as a URI WAF rule would, and a
raw socket checks that the 403 body matches its Content-Length. It also
checks that an unblocked encoded-slash path still gets Tomcat's 400 and
that blocking a plain path is unchanged.

Simplify the Tomcat encoded-slash blocking test

Shares the blocked-path assertions in one helper, keeps the URI callback
records per test instance, and drops an unused toString().

review: pre-PR checks

- Pin encodedSolidusHandling=reject on the forked test connector, so the
  test always reaches the sendError(400) path it guards
- Mention the suspension check in the TomcatBlockingHelperTest Javadoc

Merge branch 'master' into APPSEC-71828

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
(cherry picked from commit bcc328c)

* Complete Jetty 12.1 ee10 async requests left suspended by a blocking response (#13548)

Send Spring 7 SmartHttpMessageConverter bodies to the WAF

- HttpMessageConverterInstrumentation: advise the SmartHttpMessageConverter
  overloads read(ResolvableType, HttpInputMessage, Map) and
  write(Object, ResolvableType, MediaType, HttpOutputMessage, Map)
  (spring-web 6.2+: Jackson 3 and Kotlin serialization converters, the
  Spring Boot 4 default for JSON)
- ObjectIntrospection: convert Jackson 3 (tools.jackson) JsonNode bodies
- Add spring7Test suite (Spring 7.0.7, Jackson 3.1.2) in spring-webmvc-6.0
  and jackson3Test suite in appsec

Cap Jackson node container capacity to the conversion budget

Initial ArrayList/HashMap capacities in doConversionJacksonNode used the
full node size, so an oversized Jackson 2 or 3 node allocated slots the
conversion never fills (it stops at the element budget).

Bound ObjectIntrospection work by the element budget

Generic Map, Collection and array conversions now size their output
containers by the remaining element budget, and the three object loops
stop at the first key dropped for lack of budget instead of walking the
remaining keys. The converted output is unchanged.

Test the entry-iterable and Jackson 2 node budget paths

Covers the Iterable<Map.Entry> branch and the Jackson node key loop with
inputs larger than the element budget.

Write the Tomcat block page when the response was suspended by sendError

Tomcat rejects an encoded slash in the path with sendError(400), which
suspends the response output. Response.reset() does not lift that
suspension, so a WAF block committed afterwards sent its 403 status and
Content-Length but dropped the body, and the client waited on the open
connection. The blocking helper now lifts the suspension after the reset,
as Tomcat's own error valves do before they write.

Test the Tomcat block commit on a suspended response

Pins that the blocking helper lifts the sendError suspension after the
reset and before writing the block page, and leaves the suspension flag
alone when the response is not suspended.

Test blocking a Tomcat request whose encoded-slash path was rejected

Runs on Tomcat 10.1 and 11 through the latest10 and latestDep forked
suites. A URI callback blocks the request, as a URI WAF rule would, and a
raw socket checks that the 403 body matches its Content-Length. It also
checks that an unblocked encoded-slash path still gets Tomcat's 400 and
that blocking a plain path is unchanged.

Simplify the Tomcat encoded-slash blocking test

Shares the blocked-path assertions in one helper, keeps the URI callback
records per test instance, and drops an unused toString().

review: pre-PR checks

- Pin encodedSolidusHandling=reject on the forked test connector, so the
  test always reaches the sendError(400) path it guards
- Mention the suspension check in the TomcatBlockingHelperTest Javadoc

Share the Jetty 12 BlockingException lookup between helpers

Compile Jetty 12 instrumentation against jetty-ee10-servlet 12.0.16

Complete a Jetty 12.1 ee10 async request suspended by a blocking response

Jetty 12.1 ServletChannelState.onError returns false for an ASYNC request without an AsyncListener and does nothing else, so a BlockingException thrown after startAsync() (e.g. ProxyServlet with RASP SSRF) left the connection hanging and the server span unfinished. Complete the request on onError exit when Jetty does not abort, the failure carries a BlockingException, no sendError is pending, the request is not aborted, async was started and the blocking response is committed.

Test completion of a Jetty 12 ee10 async request blocked after startAsync

Read the Jetty version inside the keep-alive test

Share the raw HTTP helpers of the Jetty 12 ee10 forked tests

Reuse the shared body reader in the async blocking test

review: pre-PR checks

- Complete the suspended request only when AppSec initiated and committed the blocking response
- Keep the Jetty 12.1 onError explanation once, on JettyAsyncBlockCompletion
- Make JettyBlockingExceptions package-private again
- Collapse the nested catch in JettyAsyncBlockCompletion
- Test that an uncommitted BlockingException after startAsync() is not completed
- Rename the keep-alive test to match what it checks on Jetty 12.0

Merge branch 'master' into APPSEC-71826

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
(cherry picked from commit 98a3b29)

* Regenerate gradle lockfiles for the #13525 backport on release/v1.69.x

---------

Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF) type: bug fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants