Skip to content

fix: prevent sensitive data leakage from .storage during build#413

Open
SARTHAK2427 wants to merge 1 commit intoneutralinojs:mainfrom
SARTHAK2427:fix/auth-leak
Open

fix: prevent sensitive data leakage from .storage during build#413
SARTHAK2427 wants to merge 1 commit intoneutralinojs:mainfrom
SARTHAK2427:fix/auth-leak

Conversation

@SARTHAK2427
Copy link
Copy Markdown

Description
Prevent Sensitive Data Leakage from .storage during Build

This PR addresses a security vulnerability in the CLI bundler where sensitive development data (e.g., auth tokens, session state, environment variables) was accidentally leaked into production distributions when using the --copy-storage flag

Fixes #412

Changes

  1. Security Blacklist in bundler.js Implemented a SENSITIVE_STORAGE_ITEMS blacklist that automatically filters high-risk files during the directory copy process for eg these files
  • auth_info.json
  • tokens.json
  • .env
  1. Proactive Security Warning
    Added a user-facing warning that appears whenever the .storage directory is being packaged into a build, ensuring developers are aware of the potential for data inclusion.

The .storage directory is used by Neutralino apps at runtime to persist state. Developers often have their own testing credentials or environment secrets stored here locally. Packaging these into a production ZIP by default is a significant security risk that could lead to widespread credential leakage.

  • Non-sensitive user settings (e.g., settings.json) are correctly preserved and copied.
  • Sensitive files (e.g., auth_info.json) are detected, flagged, and skipped by the bundler.

Manual Verification Output:

neu: WARN Copying .storage directory. Please ensure that it does not contain any sensitive data.
neu: INFO Copying storage data...
neu: WARN Skipping sensitive file: auth_info.json

@SARTHAK2427
Copy link
Copy Markdown
Author

@shalithasuranga please review these security improvements let me know if you would like me to expand the blacklist or refine the user warnings

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: Sensitive Data Leakage (Auth Tokens/Session State) in Production Builds

1 participant