Skip to content

Security: All users can see all datasets including private ones #79

Closed

Description

@neuromechanist

Problem

Currently, the nemar dataset list command shows ALL datasets (including private ones) to ALL users, regardless of authentication or ownership. This is a critical security and privacy vulnerability.

Example of the Issue

$ nemar whoami
Authenticated
  Username: cool-vibers

$ nemar dataset list
Datasets (12):  # Shows ALL datasets, including private ones owned by others!

ID          Name                            Owner        Status
---------------------------------------------------------------
nm000149    My second NEMAR EEG Dataset...  arnodelorme  active  # SHOULD NOT SEE
nm000148    My NEMAR EEG Dataset ds0026...  arnodelorme  active  # SHOULD NOT SEE
nm000147    BIDS_test                       yahya        active  # SHOULD NOT SEE
...

Root Cause

  1. Missing Database Column: The datasets table has no visibility column to track public/private state
  2. No Backend Filtering: The /datasets list endpoint returns all datasets without checking:
    • Dataset visibility
    • User authentication status
    • User permissions (owner vs non-owner)

Expected Behavior

For nemar dataset list (no flags)

  • Unauthenticated users: Show only PUBLIC datasets
  • Authenticated non-admin users: Show only PUBLIC datasets
  • Admin users: Show all datasets (for oversight)

For nemar dataset list --mine

  • Show only the authenticated user's own datasets (both private and public)
  • Require authentication

Solution

  1. Add visibility column to datasets table (values: 'private' or 'public')
  2. Default all datasets to 'private' for security
  3. Update list endpoint to filter by visibility and user permissions
  4. Update publication workflow to set visibility='public' when making repo public
  5. Update documentation to clarify the behavior

Impact

Before fix:

  • All users can see all private datasets
  • Serious privacy and security vulnerability

After fix:

  • Users can only see:
    • Their own datasets (with --mine)
    • Public datasets (without --mine)
  • Admins can see all datasets
  • Default to private for new datasets

Activity

  1. added
    bug
    on Jan 27, 2026
  2. neuromechanist commented on Jan 27, 2026

    @neuromechanist
    ContributorAuthor

    Addressed in #80

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions