Skip to content

Harden shell command escaping and fix data storage bug#49

Open
niutech wants to merge 1 commit intoFreeterApp:masterfrom
niutech:code-audit
Open

Harden shell command escaping and fix data storage bug#49
niutech wants to merge 1 commit intoFreeterApp:masterfrom
niutech:code-audit

Conversation

@niutech
Copy link
Contributor

@niutech niutech commented Mar 2, 2026

  • In src/main/base/apps/terminal.ts, updated escBackslashesDblQuotes to escape $ and ` characters to prevent command injection in double-quoted strings.
  • In src/main/infra/dataStorage/fileDataStorage.ts, added the missing await keyword to the rm(filePath) call in deleteItem.
  • In src/main/infra/dataStorage/fileDataStorage.ts, updated setText to use the sanitized filePath variable instead of join(normStorageDirPath, key).

- In `src/main/base/apps/terminal.ts`, updated `escBackslashesDblQuotes`
  to escape `$` and `` ` `` characters to prevent command injection
  in double-quoted strings.
- In `src/main/infra/dataStorage/fileDataStorage.ts`, added the missing
  `await` keyword to the `rm(filePath)` call in `deleteItem`.
- In `src/main/infra/dataStorage/fileDataStorage.ts`, updated `setText`
  to use the sanitized `filePath` variable instead of `join(normStorageDirPath, key)`.

Co-authored-by: niutech <384997+niutech@users.noreply.github.com>
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.

1 participant