fix: refuse a stranger TPP reading a consent's status or SCA status - #71
Merged
Conversation
Four endpoints read a Berlin Group consent by id. Two compared the consent's
lodging Consumer against the caller's; two did not, and answered any AISP that
knew the consent id:
GET /consents/{id}/status -> consentStatus
GET /consents/{id}/authorisations/{id} -> scaStatus
Both were already fetching the consent, to prove it exists, and then simply
did not look at who was asking. So the id alone confirmed a consent existed
and let its progress through authorisation be watched from outside. The PUT
that answers an authorisation is guarded, so this disclosed state rather than
granting access.
Guarded the same way as the two that were already right. Verified with two
TPPs against a running instance: the stranger now gets 403 on all four while
the lodging TPP still gets 200 on all four.
The probe covering this was the direct cause of the gap -- it asserted the one
endpoint that had been noticed, so the other three went unexamined. It now
walks the whole family, which is why the two that were open showed up at all.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Four endpoints read a Berlin Group consent by id. Two compared the consent’s lodging Consumer against the caller’s; two did not.
GET /consents/{id}GET /consents/{id}/authorisationsGET /consents/{id}/statusGET /consents/{id}/authorisations/{authorisationId}Both unguarded routes were already fetching the consent — to prove it exists — and then simply did not look at who was asking. The consent id alone therefore confirmed a consent existed and let its progress through authorisation be watched from outside. The
PUTthat answers an authorisation is guarded, so this disclosed state rather than granting access.Verified against a running instance
Two TPPs: A lodges the consent, B is a stranger holding valid AISP credentials.
Before:
After — all four refuse the stranger and all four still serve the lodging TPP:
code.api.berlin.group183/183. Full local probe matrix 101/101.Why it was missed
The probe added when the first of these was fixed asserted only the endpoint that had been noticed, so the other three were never examined. It now walks the whole family — which is what surfaced the two that were still open.