Skip to content

Encrypted db progress - #1

Closed
vikalp-mightybyte wants to merge 9 commits into
Cybionex:masterfrom
ororsatti:encrypted-db-progress
Closed

Encrypted db progress#1
vikalp-mightybyte wants to merge 9 commits into
Cybionex:masterfrom
ororsatti:encrypted-db-progress

Conversation

@vikalp-mightybyte

@vikalp-mightybyte vikalp-mightybyte commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator

This is an exact copy of PR Nozbe#1635

vikalp-mightybyte added a commit that referenced this pull request Aug 5, 2026
ci.yml declared no permissions at all, so its four jobs ran with the
default token scope (alerts #1-#4, actions/missing-workflow-permissions).
None of them write to the repository, so declare contents: read at the top
level, matching what security.yml and codeql.yml already do.

Alert #5 (js/insecure-randomness) flagged Math.random() reaching the
SQLiteAdapter constructor. It is a false positive in substance: every
source is a test file excluded from the published build, and the value
becomes a database filename, passed to nativeWatermelonCreateAdapter as
the path argument and never mixed with the password. CodeQL treats the
constructor as a security context only because it also accepts a
`passphrase`.

Rather than dismiss it, use counters — these names only ever need to be
unique, and a counter cannot collide at all, so this is if anything more
correct than random. Jest spreads test files across worker processes, so
the file-backed cases combine the counter with process.pid; a counter
alone would not be unique across workers. process.pid is undefined under
React Native, which runs single-process, so it falls back to a constant.

Left alone: Math.random() for record ids in commonTests, which does not
reach an adapter constructor.

Verified jest, eslint, tslint, tsc and flow clean on Node 22 and 24.18.0,
both with parallel workers and in the forced single-process ordering.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.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