[Bug] signup.ts: uploadCommunityLogo is a simulated stub that converts files to data URLs with no size or type validation, sending multi-megabyte base64 strings in the signup payload
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- authentication
Research direction
Start in src/features/Auth/v1/utils/signup.ts at uploadCommunityLogo, then trace where its returned value enters the signup payload for /api/v1/auth/signup-community. Confirm the existing FileReader flow and the intended image types and size limit from the issue. Done means oversized or unsupported files are rejected before FileReader runs, while accepted images continue through the signup flow.
Written by the indexing model from the issue text.
Description
Bug Summary
uploadCommunityLogo in src/features/Auth/v1/utils/signup.ts is explicitly marked as a simulation that encodes any uploaded file as a base64 data: URL and returns it as the logo value:
export async function uploadCommunityLogo(file: File): Promise<string> {
// SIMULATION: If you need to switch to a real API, change this implementation
return new Promise((resolve) => {
const reader = new FileReader();
reader.onload = () => resolve(reader.result as string);
reader.readAsDataURL(file); // no size check, no type check
});
}
This data URL is then included in the signup form payload sent to /api/v1/auth/signup-community. Two issues:
-
No file size limit: A user can select a 50 MB PNG.
FileReader.readAsDataURL()succeeds, producing a ~67 MB base64 string (base64 overhead). This string is then embedded in the JSON request body sent to the API. The backend must parse a ~67 MB request body per signup attempt. -
No file type validation: Any file (executables, PDFs, ZIP archives) can be passed to this function.
readAsDataURL()encodes anything. The resulting string may later be rendered in an<img src={...}>tag, which silently fails for non-image types rather than warning the user.
The comment acknowledges this is a simulation ("Replace with real FormData upload"), but the stub ships with no guards in the meantime.
Expected Behavior
uploadCommunityLogo should validate that:
file.sizeis within a reasonable limit (for example, 2 MB).file.typeis one of["image/jpeg", "image/png", "image/webp"].
Both checks should throw an error before FileReader is invoked.
Actual Behavior
Any file of any size and type is encoded and included in the signup payload.
Affected File
src/features/Auth/v1/utils/signup.ts, uploadCommunityLogo function.
@NexGenStudioDev I would like to work on this issue. Could you please assign/ it to me? Contributing under NSoC '26.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NexGenStudioDev/CommDesk
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NexGenStudioDev/CommDesk#140 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
NexGenStudioDev/CommDesk#138 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NexGenStudioDev/CommDesk#123 · 2 comments ·
-
NexGenStudioDev/CommDesk#141 · 1 assignee ·
-
NexGenStudioDev/CommDesk#139 · 1 assignee ·
All issues in NexGenStudioDev/CommDesk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·