| /dokuwiki/_test/tests/inc/ |
| H A D | media_upload.test.php | 0579c2f8a6cf8c76cb756b91a4ab1167dcffd4af Sun Jul 19 20:33:30 UTC 2026 Andreas Gohr <andi@splitbrain.org> security(media): authorize the resolved target of media write operations
The media manager computed a permission level for the request's namespace and passed it to the media write helpers, which then acted on a target that need not live in that namespace. Reachability differs per helper:
- media_restore() took the id to restore from the separate "image" parameter, unrelated to the namespace the permission was computed for. A user with upload permission in any one namespace could restore revisions of media in namespaces they cannot write.
- media_upload() and media_upload_xhr() derive the target from the upload namespace plus a user-controlled filename that may carry its own namespace segments, so the target can only resolve into a sub-namespace of the upload namespace. Where that child has a stricter ACL, the parent's permission was applied instead.
- media_metasave() was not vulnerable: its target and its permission both derive from the same request id, so the namespaces always matched. It is changed only for consistency.
Each helper now recomputes the permission from its resolved target id, as media_delete() already does. The redundant $auth parameter is removed from media_restore() and media_metasave(), which have no other callers, and ignored but kept for compatibility in media_upload() and media_upload_xhr().
Severity: medium - an authenticated user with upload rights in one namespace can restore media revisions in other namespaces, or write into a stricter sub-namespace of one they can upload to; an authorization bypass affecting media integrity, not code execution or disclosure.
fixes #4702
|
| H A D | media_restore.test.php | 0579c2f8a6cf8c76cb756b91a4ab1167dcffd4af Sun Jul 19 20:33:30 UTC 2026 Andreas Gohr <andi@splitbrain.org> security(media): authorize the resolved target of media write operations
The media manager computed a permission level for the request's namespace and passed it to the media write helpers, which then acted on a target that need not live in that namespace. Reachability differs per helper:
- media_restore() took the id to restore from the separate "image" parameter, unrelated to the namespace the permission was computed for. A user with upload permission in any one namespace could restore revisions of media in namespaces they cannot write.
- media_upload() and media_upload_xhr() derive the target from the upload namespace plus a user-controlled filename that may carry its own namespace segments, so the target can only resolve into a sub-namespace of the upload namespace. Where that child has a stricter ACL, the parent's permission was applied instead.
- media_metasave() was not vulnerable: its target and its permission both derive from the same request id, so the namespaces always matched. It is changed only for consistency.
Each helper now recomputes the permission from its resolved target id, as media_delete() already does. The redundant $auth parameter is removed from media_restore() and media_metasave(), which have no other callers, and ignored but kept for compatibility in media_upload() and media_upload_xhr().
Severity: medium - an authenticated user with upload rights in one namespace can restore media revisions in other namespaces, or write into a stricter sub-namespace of one they can upload to; an authorization bypass affecting media integrity, not code execution or disclosure.
fixes #4702
|
| H A D | media_metasave.test.php | 0579c2f8a6cf8c76cb756b91a4ab1167dcffd4af Sun Jul 19 20:33:30 UTC 2026 Andreas Gohr <andi@splitbrain.org> security(media): authorize the resolved target of media write operations
The media manager computed a permission level for the request's namespace and passed it to the media write helpers, which then acted on a target that need not live in that namespace. Reachability differs per helper:
- media_restore() took the id to restore from the separate "image" parameter, unrelated to the namespace the permission was computed for. A user with upload permission in any one namespace could restore revisions of media in namespaces they cannot write.
- media_upload() and media_upload_xhr() derive the target from the upload namespace plus a user-controlled filename that may carry its own namespace segments, so the target can only resolve into a sub-namespace of the upload namespace. Where that child has a stricter ACL, the parent's permission was applied instead.
- media_metasave() was not vulnerable: its target and its permission both derive from the same request id, so the namespaces always matched. It is changed only for consistency.
Each helper now recomputes the permission from its resolved target id, as media_delete() already does. The redundant $auth parameter is removed from media_restore() and media_metasave(), which have no other callers, and ignored but kept for compatibility in media_upload() and media_upload_xhr().
Severity: medium - an authenticated user with upload rights in one namespace can restore media revisions in other namespaces, or write into a stricter sub-namespace of one they can upload to; an authorization bypass affecting media integrity, not code execution or disclosure.
fixes #4702
|
| /dokuwiki/lib/exe/ |
| H A D | mediamanager.php | 0579c2f8a6cf8c76cb756b91a4ab1167dcffd4af Sun Jul 19 20:33:30 UTC 2026 Andreas Gohr <andi@splitbrain.org> security(media): authorize the resolved target of media write operations
The media manager computed a permission level for the request's namespace and passed it to the media write helpers, which then acted on a target that need not live in that namespace. Reachability differs per helper:
- media_restore() took the id to restore from the separate "image" parameter, unrelated to the namespace the permission was computed for. A user with upload permission in any one namespace could restore revisions of media in namespaces they cannot write.
- media_upload() and media_upload_xhr() derive the target from the upload namespace plus a user-controlled filename that may carry its own namespace segments, so the target can only resolve into a sub-namespace of the upload namespace. Where that child has a stricter ACL, the parent's permission was applied instead.
- media_metasave() was not vulnerable: its target and its permission both derive from the same request id, so the namespaces always matched. It is changed only for consistency.
Each helper now recomputes the permission from its resolved target id, as media_delete() already does. The redundant $auth parameter is removed from media_restore() and media_metasave(), which have no other callers, and ignored but kept for compatibility in media_upload() and media_upload_xhr().
Severity: medium - an authenticated user with upload rights in one namespace can restore media revisions in other namespaces, or write into a stricter sub-namespace of one they can upload to; an authorization bypass affecting media integrity, not code execution or disclosure.
fixes #4702
|
| /dokuwiki/inc/ |
| H A D | media.php | 0579c2f8a6cf8c76cb756b91a4ab1167dcffd4af Sun Jul 19 20:33:30 UTC 2026 Andreas Gohr <andi@splitbrain.org> security(media): authorize the resolved target of media write operations
The media manager computed a permission level for the request's namespace and passed it to the media write helpers, which then acted on a target that need not live in that namespace. Reachability differs per helper:
- media_restore() took the id to restore from the separate "image" parameter, unrelated to the namespace the permission was computed for. A user with upload permission in any one namespace could restore revisions of media in namespaces they cannot write.
- media_upload() and media_upload_xhr() derive the target from the upload namespace plus a user-controlled filename that may carry its own namespace segments, so the target can only resolve into a sub-namespace of the upload namespace. Where that child has a stricter ACL, the parent's permission was applied instead.
- media_metasave() was not vulnerable: its target and its permission both derive from the same request id, so the namespaces always matched. It is changed only for consistency.
Each helper now recomputes the permission from its resolved target id, as media_delete() already does. The redundant $auth parameter is removed from media_restore() and media_metasave(), which have no other callers, and ignored but kept for compatibility in media_upload() and media_upload_xhr().
Severity: medium - an authenticated user with upload rights in one namespace can restore media revisions in other namespaces, or write into a stricter sub-namespace of one they can upload to; an authorization bypass affecting media integrity, not code execution or disclosure.
fixes #4702
|