Skip to content

Resource file deletion via delete_variant - #8726

Merged
AngelFQC merged 1 commit into
chamilo:masterfrom
AngelFQC:security/auto-fix-GHSA-4j89-qjx2-3wcr
Jul 31, 2026
Merged

Resource file deletion via delete_variant#8726
AngelFQC merged 1 commit into
chamilo:masterfrom
AngelFQC:security/auto-fix-GHSA-4j89-qjx2-3wcr

Conversation

@AngelFQC

@AngelFQC AngelFQC commented Jul 13, 2026

Copy link
Copy Markdown
Member

Adds authorization to the DELETE /r/resource_files/{id}/delete_variant endpoint, which previously deleted ResourceFile by numeric id. The handler now requires EDIT permission on the owning ResourceNode (admins pass via ROLE_ADMIN) and only allows removal of genuine access-URL variants (accessUrl !== null), returning 404 otherwise.

Note: CSRF token validation was not added — the endpoint is consumed by the SPA over JWT bearer auth and adding a token would require a coordinated frontend change; the authorization check already eliminates the unauthenticated/cross-privilege vector. Flagging in case a CSRF layer is desired as defense-in-depth.

Refs GHSA-4j89-qjx2-3wcr

@ywarnier ywarnier changed the title Security: Unauthenticated arbitrary resource file deletion via delete_variant Arbitrary resource file deletion via delete_variant Jul 20, 2026
@ywarnier ywarnier changed the title Arbitrary resource file deletion via delete_variant Resource file deletion via delete_variant Jul 20, 2026
@AngelFQC
AngelFQC merged commit 48c4fdb into chamilo:master Jul 31, 2026
4 of 7 checks passed
@AngelFQC
AngelFQC deleted the security/auto-fix-GHSA-4j89-qjx2-3wcr branch July 31, 2026 19:17
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.

1 participant