Summary
A normal authenticated member can overwrite an existing tenant blob, including the tenant logo, by creating a post attachment whose bkey is set to an already existing tenant blob key. Because the attachment upload path accepts a client-controlled bkey and the storage layer overwrites content for an existing key, a low-privileged member can replace a shared trusted asset such as the tenant logo.
Details
During testing of getfider/fider on commit 446bce9802d82b53b439748b390e9af81eb91491, I found that attachment uploads trust a client-supplied blob key.
Relevant behavior:
ImageUpload exposes bkey directly:
type ImageUpload struct {
BlobKey string `json:"bkey"`
Upload *ImageUploadData `json:"upload"`
Remove bool `json:"remove"`
}
- Member-accessible post creation uploads images before attachment association:
POST /api/v1/posts
POST /api/v1/posts/:number/comments
- The post creation path calls:
cmd.UploadImages{Images: action.Attachments, Folder: "attachments"}
- then
cmd.SetAttachments{Attachments: action.Attachments}
- Tenant settings use blob-backed logos, and the tenant object exposes logoBlobKey.
In practice, a normal authenticated member can:
- learn the current
tenant.logoBlobKey
- submit a normal post attachment upload
- set
attachments[0].bkey to the tenant logo blob key
- upload attacker-controlled image content
- cause the existing tenant logo blob content to be replaced
This is an object-level authorization/integrity issue: an unprivileged member can overwrite an existing privileged shared blob by reusing its key.
PoC
Tested locally on commit:
446bce9802d82b53b439748b390e9af81eb91491
Reproduction steps:
- Start Fider locally.
- Create the first tenant and verify the admin email.
- Create a low-privileged member account.
- Sign in as the member.
- As admin, upload a tenant logo image.
- Read the tenant logo blob key (
logoBlobKey).
- As the member, create a new post and send an attachment object where:
attachments[0].bkey = tenant.logoBlobKey
attachments[0].upload contains attacker-controlled image bytes
- Observe the request succeeds with HTTP 200.
- Fetch the original logo URL before and after the member request.
- Compare hashes and confirm the logo content changed.
- Confirm the
attachments table stores the forged attachment_bkey equal to the tenant logo blob key.
Observed proof from my reproduction:
- low-privileged member role:
visitor
- forged member request returned
200 OK
attachments.attachment_bkey matched the tenant logo_bkey
- the logo content hash changed after the member request
Example impact demonstrated:
- tenant logo was overwritten by a normal authenticated member
Impact
A normal authenticated member can overwrite the tenant logo and potentially other tenant blobs if their keys are known. This enables:
- tenant branding defacement
- phishing / trust abuse within the application
- unauthorized modification of shared tenant assets
This appears to be an object-level authorization and integrity failure caused by trusting a client-controlled blob key for uploads and allowing reuse/overwrite of an existing key.
Suggested remediation
- Ignore client-supplied
bkey for new uploads and always generate a fresh server-side blob key.
- Prevent overwrite of existing blob keys unless explicitly authorized.
- Bind blobs to purpose/ownership and reject cross-purpose reuse.
- Restrict attachment uploads to attachment-specific namespace only.
Attachment
report_fider_blob_overwrite.zip
Summary
A normal authenticated member can overwrite an existing tenant blob, including the tenant logo, by creating a post attachment whose
bkeyis set to an already existing tenant blob key. Because the attachment upload path accepts a client-controlledbkeyand the storage layer overwrites content for an existing key, a low-privileged member can replace a shared trusted asset such as the tenant logo.Details
During testing of
getfider/fideron commit446bce9802d82b53b439748b390e9af81eb91491, I found that attachment uploads trust a client-supplied blob key.Relevant behavior:
ImageUploadexposesbkeydirectly:POST /api/v1/postsPOST /api/v1/posts/:number/commentscmd.UploadImages{Images: action.Attachments, Folder: "attachments"}cmd.SetAttachments{Attachments: action.Attachments}In practice, a normal authenticated member can:
tenant.logoBlobKeyattachments[0].bkeyto the tenant logo blob keyThis is an object-level authorization/integrity issue: an unprivileged member can overwrite an existing privileged shared blob by reusing its key.
PoC
Tested locally on commit:
446bce9802d82b53b439748b390e9af81eb91491Reproduction steps:
logoBlobKey).attachments[0].bkey = tenant.logoBlobKeyattachments[0].uploadcontains attacker-controlled image bytesattachmentstable stores the forgedattachment_bkeyequal to the tenant logo blob key.Observed proof from my reproduction:
visitor200 OKattachments.attachment_bkeymatched the tenantlogo_bkeyExample impact demonstrated:
Impact
A normal authenticated member can overwrite the tenant logo and potentially other tenant blobs if their keys are known. This enables:
This appears to be an object-level authorization and integrity failure caused by trusting a client-controlled blob key for uploads and allowing reuse/overwrite of an existing key.
Suggested remediation
bkeyfor new uploads and always generate a fresh server-side blob key.Attachment
report_fider_blob_overwrite.zip