-
Notifications
You must be signed in to change notification settings - Fork 683
DATACMNS-1757 PagedResourcesAssembler generated navigation links ignore non pageable request parameters #452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
reda-alaoui
commented
Jun 28, 2020
- You have read the Spring Data contribution guidelines.
- There is a ticket in the bug tracker for the project in our JIRA.
- You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
- You submit test cases (unit or integration tests) that back your changes.
- You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).
…re non pageable request parameters
Hello? |
Ping :) |
Is there something I can do to ease the merge of this fix? |
I'm not sure we want to include this change because it echos all incoming parameters which open up potential attack vectors. Instead, the page links are intended to remain neutral in terms of the original URL that produced the response. |
Hi @mp911de , What kind of attack are you referring to?
This is already not the case. IMO, this is part of the core philosophy of HATEOAS. Ideally, the client should not ever have to build an uri itself, it should only follow relations returned by the server. Now suppose the server sends a relation referring to |
I was referring to injection and XSS vulnerabilities. Looking at the outcome of a Spring Data REST repository, we indeed report all query parameters in the self and pagination Looking at the implementation, parameters seem to be skipped if a baseUri or a base link are provided. |
If you cannot accept it as is, here are alternatives I can think of from most preferred to the least:
|
Actually, we need to investigate why |
See #2173 for details on how we decided to solve this. |
We now avoid the pre-computation of the base URI in PagedResourceAssemblerArgumentResolver as the actual assembler will fall back to using the URI of the current request by default anyway. The latter makes sure that request parameters, that are contained in the original requests appear in links created. If a controller wants to deviate from that behavior, they can create a dedicated link themselves and hand that to the assembler explicitly. Fixes GH-2173, GH-452.
We now avoid the pre-computation of the base URI in PagedResourceAssemblerArgumentResolver as the actual assembler will fall back to using the URI of the current request by default anyway. The latter makes sure that request parameters, that are contained in the original requests appear in links created. If a controller wants to deviate from that behavior, they can create a dedicated link themselves and hand that to the assembler explicitly. Fixes GH-2173, GH-452.
We now avoid the pre-computation of the base URI in PagedResourceAssemblerArgumentResolver as the actual assembler will fall back to using the URI of the current request by default anyway. The latter makes sure that request parameters, that are contained in the original requests appear in links created. If a controller wants to deviate from that behavior, they can create a dedicated link themselves and hand that to the assembler explicitly. Fixes GH-2173, GH-452.