[Security][Blog][Record] Create endpoints accepted spoofable client-supplied AuthorId — fixed by backend #423 (epic #705) #716

Closed
opened 2026-07-19 01:15:58 +00:00 by spikerj · 1 comment
Owner

Epic #705. Record ticket for traceability (every merged fix traces to a closed issue): POST /api/blog/posts and /posts/upload had no [Authorize] and took AuthorId from the client DTO — spoofable authorship, which was the anchor of the owner-only delete check AND (via the profile-missing fallback) could steer media into another user's /app/blogs/<username>/ directory.

Fixed in spikersoft-backend PR #423: [Authorize] on both endpoints + AuthorId derived server-side from the Keycloak sub claim; 4 new tests. Close this once #423 merges.

Remaining same-class holes tracked separately: comment endpoints (#707), update endpoint (#709).

Epic #705. Record ticket for traceability (every merged fix traces to a closed issue): `POST /api/blog/posts` and `/posts/upload` had no `[Authorize]` and took `AuthorId` from the client DTO — spoofable authorship, which was the anchor of the owner-only delete check AND (via the profile-missing fallback) could steer media into another user's `/app/blogs/<username>/` directory. **Fixed in spikersoft-backend PR #423**: `[Authorize]` on both endpoints + `AuthorId` derived server-side from the Keycloak `sub` claim; 4 new tests. Close this once #423 merges. Remaining same-class holes tracked separately: comment endpoints (#707), update endpoint (#709).
Author
Owner

Verified fixed and on master. BlogController create now anchors authorship to the caller's Keycloak identity server-side and ignores the client-supplied AuthorId (in-code comment: "it was spoofable"); command = new CreateBlogPostCommand { … AuthorId = callerId }. Commit f4ac2418 ("feat(blog): anchor create authorship to the caller's Keycloak identity") is an ancestor of origin/master and added BlogControllerTests regression coverage. Deployed/live. Closing.

Verified fixed and on `master`. `BlogController` create now anchors authorship to the caller's Keycloak identity server-side and **ignores** the client-supplied `AuthorId` (in-code comment: "it was spoofable"); `command = new CreateBlogPostCommand { … AuthorId = callerId }`. Commit `f4ac2418` ("feat(blog): anchor create authorship to the caller's Keycloak identity") is an ancestor of `origin/master` and added `BlogControllerTests` regression coverage. Deployed/live. Closing.
Sign in to join this conversation.