Skip to content

fix: treat the OAuth2 user id as opaque - #392

Merged
phil-davis merged 2 commits into
release-0.6from
fix/opaque-user-id-0.6
Sep 9, 2026
Merged

phil-davis merged 2 commits into
release-0.6from
fix/opaque-user-id-0.6

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Backport of #389 to the 0.6 / ownCloud 10 line. The code diff is identical to what was merged
on master.

The token endpoint and the bearer auth module split the user id stored on an authorization code,
access token or refresh token at the first colon and then resolved whatever user the remainder
named. That is a leftover of the login name:user id format which only v0.5.0 - v0.5.2 ever
wrote: e5b508c restored raw user id storage in 2022, so the parsers see a plain user id today,
and a legacy pair value cannot reach them either - authorization codes expire after 10 minutes,
access tokens after 1 hour, and refresh tokens were always stored with the already-split value.

The parsing is therefore dead code, and a user id which legitimately contains a colon must not be
reinterpreted. This treats the stored value as an opaque user id in all three places.

The AuthModuleTest case which asserted the splitting behaviour is replaced by one asserting that
the stored user id is used verbatim, and OAuthApiControllerTest gains regression coverage for
both grant paths.


Stacked on #391 so that it runs under the CI that PR adds - the release-0.6 branch has no
workflows until #391 lands. GitHub retargets this PR to release-0.6 automatically when #391 is
merged. Review #391 first.

oc-tmueller and others added 2 commits September 9, 2026 10:27
The 0.6 line was branched from v0.6.1, whose tree still carries the drone
configuration only. Releases are tag triggered through
.github/workflows/release.yml, and GitHub resolves that file from the tagged
commit, so without the workflows a v0.6.x tag would build nothing at all and
the branch would have no CI.

Port the workflow set from master, adapted for this line:

- CI and the dist build run on php 7.4 against owncloud/core 10.16, because
  appinfo/info.xml declares max-version="10" and php min-version="7.4".
- Trivy builds the tree to scan with php 7.4 for the same reason.
- The acceptance job is left out: the reusable acceptance workflow installs a
  hardcoded owncloud-daily-master-qa.tar.bz2 (11.x) with the
  owncloudci/core:php83 image and offers no input to point it elsewhere, so an
  app declaring max-version="10" cannot be enabled on that server.

Signed-off-by: Thomas M眉ller <323649642+oc-tmueller@users.noreply.github.com>
The token endpoint and the bearer auth module split the user id stored on an
authorization code, access token or refresh token at the first colon and then
resolved whatever user the remainder named. That is a leftover of the
`login name:user id` format which only v0.5.0 - v0.5.2 ever wrote:
e5b508c restored raw user id storage in 2022, so the parsers see a plain user
id today, and a legacy pair value cannot reach them either - authorization
codes expire after 10 minutes, access tokens after 1 hour, and refresh tokens
were always stored with the already-split value.

The parsing is therefore dead code, and a user id which legitimately contains
a colon must not be reinterpreted. Treat the stored value as an opaque user id
in all three places.

The AuthModuleTest case which asserted the splitting behaviour is replaced by
one asserting that the stored user id is used verbatim.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Thomas M眉ller <323649642+oc-tmueller@users.noreply.github.com>
Base automatically changed from ci/add-workflows-0.6 to release-0.6 September 9, 2026 09:25
@phil-davis
phil-davis merged commit bd365ba into release-0.6 Sep 9, 2026
13 checks passed
@phil-davis
phil-davis deleted the fix/opaque-user-id-0.6 branch September 9, 2026 09:28
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.

2 participants