8000 [OID4VCI-FAPI2] Pass fapi2-security-profile-final-state-only-outside-request-object-not-used by tdiesler · Pull Request #49788 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[OID4VCI-FAPI2] Pass fapi2-security-profile-final-state-only-outside-request-object-not-used - #49788

Merged
mposolda merged 2 commits into
keycloak:mainfrom
tdiesler:ghi48047
Jun 9, 2026
Merged

mposolda merged 2 commits into
keycloak:mainfrom
tdiesler:ghi48047

Conversation

@tdiesler
@tdiesler tdiesler commented Jun 8, 2026 •
Copy link
Copy Markdown
Contributor

closes #48047

Fixes

  • Minor changes to ABCA test setup
  • Expected error code + message for fapi2-security-profile-final-state-only-outside-request-object-not-used

@mposolda mposolda 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.

@tdiesler Thanks!

It seems there is also alternative approach that request will not be rejected, but state parameter (or other parameters included in the query) would be ignored. However I am rather +1 to the approach from your PR as it is safer.

Added minor comment inline related to the error message.

for (String queryParam : queryKeys) {
if (!requestParametersNameFromPAR.contains(queryParam)) {
AuthzEndpointParParser.removeRequestObject(session, requestUri);
throw new ClientPolicyException(OAuthErrorException.INVALID_REQUEST_OBJECT, "PAR request did not include query parameter: " + queryParam);
@mposolda mposolda Jun 9, 2026 •
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.

Is it please possible to add value of queryParam directly to this exception message?

The possible problem is, that this is user-provided parameter and user can possibly use some strange parameter. And the exception message from here is returned back in the response, which in some corner cases may cause issues like XSS.

If you prefer, it is OK to display log.warn and add the name of missing parameter there? Or eventually add it to the event (but not sure if it is easily possible).

@tdiesler tdiesler Jun 9, 2026 •
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. The error description indicates that there is a param on the url query that is not part of the PAR object. The name of the conflicting parameter is part of the error description, the value of which should not matter.

par-object-no-state

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.

Oh, sorry for the confusion... What I wanted to write was : Is it please possible to avoid adding name of queryParam directly to this exception message?

With the change code similar to this:

Suggested change
throw new ClientPolicyException(OAuthErrorException.INVALID_REQUEST_OBJECT, "PAR request did not include query parameter: " + queryParam);
throw new ClientPolicyException(OAuthErrorException.INVALID_REQUEST_OBJECT, "PAR request did not included query parameter");
log.warnf("PAR request did not included query parameter: %s", queryParam);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

tdiesler added 2 commits June 9, 2026 16:07
Signed-off-by: Thomas Diesler <tdiesler@proton.me>
…request-object-not-used

closes keycloak#48047

Signed-off-by: Thomas Diesler <tdiesler@proton.me>
@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabled

Keycloak CI - Java Distribution IT (windows-latest - temurin - 21)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for value to contain (ignoring case) "sign in to". Current value: "AUTH_RESPONSE" (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2025', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.11'
Driver info: org.jboss.arquillian.drone.webdriver.htmlunit.DroneHtmlUnitDriver_ByGraphene
...

Report flaky test

@mposolda mposolda 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.

@tdiesler Thanks! I hope to merge the PR once tests are finished. They were originally cancelled somehow, but hope the re-run helps...

@keycloak-github-bot keycloak-github-bot Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link
Copy Markdown

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.KcOidcBrokerTest#loginWithExistingUserWithBruteForceEnabled

Keycloak CI - Java Distribution IT (windows-latest - temurin - 21)

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for value to contain (ignoring case) "sign in to". Current value: "AUTH_RESPONSE" (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.28.1', revision: '73f5ad48a2'
System info: os.name: 'Windows Server 2025', os.arch: 'amd64', os.version: '10.0', java.version: '21.0.11'
Driver info: org.jboss.arquillian.drone.webdriver.htmlunit.DroneHtmlUnitDriver_ByGraphene
...

Report flaky test

@mposolda
mposolda merged commit 9b6cb28 into keycloak:main Jun 9, 2026
140 of 144 checks passed
@tdiesler
tdiesler deleted the ghi48047 branch June 9, 2026 18:19
sashyo pushed a commit to tide-foundation/keycloak-IGA that referenced this pull request Jul 20, 2026
…request-object-not-used (keycloak#49788)

closes keycloak#48047


Signed-off-by: Thomas Diesler <tdiesler@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OID4VCI-FAPI2] Pass fapi2-security-profile-final-state-only-outside-request-object-not-used

2 participants

0