Skip to content

hardening(dashboard): restrict revalidate() server action to a closed set of allowed paths #6071

Description

@coderabbitai

Summary

The revalidate server action in web/apps/dashboard/app/actions.ts currently accepts an arbitrary path string. Any authenticated user who knows (or guesses) the action ID can call it to thrash the Next.js Data and Router caches for any route they choose.

The existing auth check (getAuth() → userId) is the meaningful security boundary. This issue tracks a hardening step: replacing the free-form path parameter with a closed, validated set of revalidation targets.

Suggested approach

Replace the free-form path parameter with a discriminated union of allowed route keys, or split into dedicated per-call-site actions, and map internally to canonical paths before calling revalidatePath.

Context

/cc @mcstepp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions