fix(security): resolve multiple security vulnerabilities#13
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses multiple security vulnerabilities identified in the FloCafe codebase.
Changes
Issue – JWT Secret Hardcoded
settingstableprocess.env.JWT_SECRETif setIssue – Role Enforcement via Spoofable Header
main/routes/order-items.ts: Removed trust ofx-user-roleheaderIssue – Sensitive Keys Exposed in Settings Dump
SENSITIVE_KEYSblocklist onGET /settingsjwt_secret,pin,password,token, etc.) are filtered from the dumpIssue – Settings Wildcard PUT Allows Any Key
ALLOWED_WILDCARD_KEYSallowlistPUT /:keyIssue – KDS WebSocket Has No Authentication
Issue – CORS Allows All Origins
Issue – No Content Security Policy
Issue – No Global Rate Limiting + PIN Stored in Plaintext
Rate Limiting:
/api/*on both the main server (port 3001) and KDS server (port 3002)PIN Hashing:
pin_hashcolumn added touserstable (non-destructive migration v2)pincolumnpin_hashis returned instead of plaintextpincreate-userandupdate-userIPC handlers now write topin_hashIssues Skipped
— deferred, requires printer hardware knowledge
Notes
ALTER TABLE ADD COLUMN)npm run buildpasses with no TypeScript errors