Skip to content

[BUG] Link title has no maximum length validation — extremely long titles break the dashboard UI #136

@HunarBhatia

Description

@HunarBhatia

Bug Description

The POST /api/links and PUT /api/links/:id endpoints in server.js accept a link title of unlimited length. There is no maximum length check on either the frontend or the backend. A user can submit a title with hundreds or thousands of characters, which breaks the dashboard card layout and causes the UI to overflow.

// server.js — no length validation on title
title: req.body.title || 'New Link',

Steps to Reproduce

  1. Log in and open the dashboard
  2. Add a new link with a title of 500+ characters
  3. Observe the dashboard card layout breaks and overflows

Expected Behavior

Link titles should be limited to a reasonable maximum length (e.g. 100 characters). If exceeded, a clear error should be returned:

"Link title must be 100 characters or fewer."

Proposed Fix

Add a length check before inserting:

if (req.body.title && req.body.title.length > 100) {
  return res.status(400).json({ error: 'Link title must be 100 characters or fewer.' });
}

Apply the same check in the PUT /api/links/:id update endpoint.

Files Affected

  • server.jsPOST /api/links and PUT /api/links/:id

I am a GSSoC '26 contributor and would like to be assigned this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions