Skip to content

Security Vulnerabilities in User Search API and File Upload #121

Description

@mohab-elshamy

While reviewing the project, I found the following security concerns:

1. Sensitive fields exposed in public search API

The search endpoint returns internal identity fields such as passwordHash, securityStamp, and concurrencyStamp.

Image

Risk: Sensitive authentication data exposure.
Fix: Return a sanitized DTO with only public fields.


2. No file size limit on profile image upload

There is no maximum upload size enforced.

Risk: Possible DoS via large file uploads.
Fix: Add strict size limits and optionally rate limiting.


3. No validation of uploaded file type

No validation for file extension, MIME type, or file signature.

Risk: Malicious file upload (e.g., JS or executable files).
Fix: Enforce allow-list validation and verify file signatures.


I’d be happy to submit a PR addressing these issues if approved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions