Skip to content

Resource file deletion via delete_variant#8726

Open
AngelFQC wants to merge 1 commit into
chamilo:masterfrom
AngelFQC:security/auto-fix-GHSA-4j89-qjx2-3wcr
Open

Resource file deletion via delete_variant#8726
AngelFQC wants to merge 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
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