owncloud / owncloud/ocis

server returns status code 500 when deleting auth-app token of a different user

Open
#10,921 0 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 2h
Merged PRs (30d)
106

Description

## Describe the bug
deleting auth-app token of a user by another user both normal user and admin gives `500` status code.
https://owncloud.dev/services/auth-app/#via-api

## Steps to reproduce
1. moss creates an auth-app token
```shell
curl -kv -XPOST 'https://localhost:9200/auth-app/tokens?expiry=72h' -umoss:vista
```
2. marie and admin tries to delete token
```shell
curl -kv -XDELETE "https://localhost:9200/auth-app/tokens?token=$2a$11$mkKiEkxurCe4/W8CTfXcrOS0I5nWFNmT.U6PEey8KsO5k2E2b8iAG" -umarie:radioactivity|jq

or

curl -kv -XDELETE "https://localhost:9200/auth-app/tokens?token=$2a$11$mkKiEkxurCe4/W8CTfXcrOS0I5nWFNmT.U6PEey8KsO5k2E2b8iAG" -uadmin:admin|jq
```

## Expected behavior
The server should return something like `403`.
but in case of admin user i'm not clear about the expected behavior.

## Actual behavior
the server return `500` status code
```shell
TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
```

## Setup
env
```shell
OCIS_ADD_RUN_SERVICES=auth-app
AUTH_APP_ENABLE_IMPERSONATION=true
```

```console
ownCloud Web UI 11.1.0
Infinite Scale 7.1.0-rc.2+4dc5d13631 Community
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing DELETE /auth-app/tokens with a token created by another user, using the curl commands in the issue and the documented auth-app API. Trace the auth-app token deletion entry point and determine why the request returns 500; the fix should return 403 for the normal user, while the permitted behavior for admin still needs clarification. Verify both user cases with the stated impersonation setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.