Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security issue where *.server.js are exposed in dev mode #10383

Open
ybouane opened this issue Jan 4, 2025 · 0 comments
Open

Security issue where *.server.js are exposed in dev mode #10383

ybouane opened this issue Jan 4, 2025 · 0 comments

Comments

@ybouane
Copy link

ybouane commented Jan 4, 2025

Reproduction

https://stackblitz.com/edit/remix-run-remix-vcsxcesm?file=package.json

You can visit the:
/app/secret.server.js endpoint and see the content of the file.

Note: this happens in dev mode via: the vite dev command.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @remix-run/dev: 2.3.0 => 2.3.0 
    @remix-run/eslint-config: ^2.3.0 => 2.3.0 
    @remix-run/node: ^2.3.0 => 2.15.2 
    @remix-run/react: ^2.3.0 => 2.15.2 
    @remix-run/serve: ^2.3.0 => 2.15.2 
    vite: 5.0.0 => 5.0.0

Used Package Manager

npm

Expected Behavior

The fiel should either not be accessible or the server-side code should be stripped.

Note that sometimes it does work and the file's server content is properly stripped but I could not find a way to reproduce this. It almost seems random.

Actual Behavior

The file is exposed as is.

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

No branches or pull requests

1 participant