Skip to content

Restore baseline GraphQL and REST behaviour on Boot 3 (application/graphql, empty error locations, trailing slashes) - #1266

Merged
devin-ai-integration[bot] merged 3 commits into
devin/unt-5-spring-boot-2.7from
devin/unt-8-boot3-regressions
Nov 17, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
devin/unt-5-spring-boot-2.7from
devin/unt-8-boot3-regressions

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

Fixes the Boot 3 behaviour regressions left after #1265, so the smoke check matches the Boot 2.6.3 baseline again. Stacked on #1252 (base devin/unt-5-spring-boot-2.7). Ticket: Fix Boot 3 test and behaviour regressions (plan step s3.2).

1. POST /graphql with Content-Type: application/graphql (was 415). Spring for GraphQL, which DGS 10 runs on, only routes JSON bodies. New GraphQLRawQueryFilter is registered for /graphql and /graphql/ only, and only for POST requests whose content type is application/graphql (any charset). It rewrites the request as JSON:

POST /graphql  Content-Type: application/graphql   { tags }
  -> Content-Type: application/json                {"query":"{ tags }"}

An empty body returns 400 with the same body text and content type as the baseline. JSON requests don't pass through the filter.

2. GraphQL errors[].locations is [] again. In GraphQLCustomizeExceptionHandler:

  • The custom UNAUTHENTICATED and BAD_REQUEST errors set .locations(emptyList()). The DGS 10 builder leaves locations null, and graphql-java 22+ then leaves the key out.
  • Errors from DGS's default handler (INTERNAL) are rebuilt as TypedGraphQLErrors with empty locations. DGS 10 adds the field's {line, column}; DGS 5 did not. Message, errorType, path, extensions and logging are unchanged.

3. Trailing-slash URLs (GET /articles/, /user/, /profiles/{u}/, /articles/feed/) work again (were 404). Spring MVC 6 dropped trailing-slash matching. TrailingSlashConfig registers Spring 6.2's UrlHandlerFilter.trailingSlashHandler("/**").wrapRequest() at SecurityProperties.DEFAULT_FILTER_ORDER + 1, which is after the Security filter chain. Security still checks the path as sent, the same as on the baseline: GET /tags/ stays 401 and POST /users/login/ stays 401.

Other ticket hypotheses I checked against the baseline app (Boot 2.6.3 on JDK 11, commit b36adb47), comparing full values, not just shapes, side by side: validation messages in errors (Hibernate Validator 8), UNWRAP_ROOT_VALUE handling, Joda date formats in REST and GraphQL, the 404 and 403 error bodies, and the GraphQL createUser validation payload. All of them were already identical, so they need no change. The ERROR-dispatch permit was already done in #1264/#1265.

Smoke check

  • 6 new calls: graphql.tags.application-graphql, graphql.me.application-graphql (with token), rest.articles.list.trailing-slash, rest.current-user.trailing-slash, rest.profile.trailing-slash, rest.tags.trailing-slash (401).
  • The baseline was not regenerated. I ran the updated smoke.sh against the baseline app: its first 75 lines are byte-identical to the committed baseline.jsonl, and only those 6 new lines were appended.
  • Local run on this branch (JDK 17): Smoke check passed: 81 calls / Responses match baseline. No accepted differences.

Tests

./gradlew clean spotlessCheck build on JDK 17: 77 tests in 22 classes, 0 failures. The baseline is 68 tests in 20 classes. New tests:

  • GraphQLApiTest (7, the first GraphQL-layer tests): raw application/graphql, with a charset, on /graphql/ with a token, and with an empty body, plain JSON, and locations: [] for INTERNAL and UNAUTHENTICATED errors.
  • TrailingSlashTest (2).

Differences outside the smoke contract (for review, not fixed)

I found these while probing. Smoke doesn't cover them, and they only affect malformed requests:

  • GET /graphql returns 405 (baseline 400), and POST /graphql with text/plain returns 415 (baseline 400).
  • POST /graphql with an empty JSON body returns a problem+json 400 (baseline: a 400 with the text Invalid GraphQL request - no request body was provided).
  • Unchanged from the baseline, not fixed: anonymous GET /articles/feed/ returns 500 (Security matches /articles/** before the slash is stripped). Making it 401 would change the contract, so it is left for review.
  • graphql-java syntax-error messages changed wording ("Invalid syntax with offending token…" instead of "Invalid Syntax : offending token…"), and Spring for GraphQL adds extensions.errorType: BAD_REQUEST to them.

Snyk

This PR adds no dependencies and changes no versions. CVE-2026-47890 (spring-webmvc 6.2.19) is expected to stay red, as on #1265. I added no ignores and made no policy changes.


👀 Devin fixed 1 finding · 1 finding for you to triage · Follow Devin's work

Devin Review

…aphql bodies, empty error locations, trailing-slash URLs

Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration Bot and others added 2 commits November 17, 2026 09:37
Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>
Co-Authored-By: joel.oshea <joel.oshea@cognition.ai>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Devin Review found 2 findings. Devin fixed 1 finding; 1 finding is left for you to triage below.

Custom reviewers

  • 👁️ TD Information Security: 1 finding · View
Fixed by Devin (1)
  • Raw GraphQL fails with trailing slashes — Confirmed: authenticated raw POST /graphql/ returned 415 (baseline 200). The filter is now also mapped to /graphql/, and a test covers it.

View findings in Devin Review · Follow Devin's work

Devin Review

Comment on lines +21 to +22
UrlHandlerFilter.trailingSlashHandler("/**").wrapRequest().build());
registration.setOrder(SecurityProperties.DEFAULT_FILTER_ORDER + 1);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👁️ TD Information Security: P2 — Trailing slash bypasses feed authentication

Anonymous GET /articles/feed/ now reaches getFeed, bypassing §5 authentication. securityFilterChain protects only /articles/feed and permits /articles/** before normalization. findUserFeed dereferences the null user, producing an internal error rather than exposing feed data.

Devin left this for you to triage: Not a regression: the Boot 2.6 baseline app returns the same 500 for anonymous GET /articles/feed/ (security matches /articles/** before the slash is stripped, then the null user fails), and no feed data leaks. Turning it into a 401 changes the API contract, so it needs Joel's approval; recommend a follow-up that also protects /articles/feed/ in WebSecurityConfig.

View in Devin Review · Custom reviewer

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@devin-ai-integration

Copy link
Copy Markdown
Author

CI results for head ae88287f:

  • build: passed (JDK 17; 77 tests in 22 classes locally, 0 failures).
  • smoke: passed. All 81 calls match the baseline, with no accepted differences.
  • Snyk: security/snyk and license/snyk passed on this PR. The PR changes no dependencies. The ticket expected CVE-2026-47890 (spring-webmvc 6.2.19) to stay red, but this PR check didn't flag it. I added no ignores and made no policy changes.

Written by Devin

@devin-ai-integration
devin-ai-integration Bot merged commit 48f44f3 into devin/unt-5-spring-boot-2.7 Nov 17, 2026
11 of 12 checks passed
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