Repository navigation
fix(open-sse): write Adobe Firefly session tokens and cookie jars with 0700/0600 perms (#12572) - #13242
Merged
Conversation
…h 0700/0600 perms (#12572) adobeFireflySession.ts and adobeFireflyBrowserLogin.ts persisted the IMS Bearer JWT and full Adobe cookie jar to disk via mkdirSync/writeFileSync with no mode argument, so directories and files inherited the process umask (0755/0644) instead of the 0700/0600 pattern already established by src/lib/vncSession/service.ts::createProfileDir. Adds a shared open-sse/utils/secureFileWrite.ts (ensureSecureDir/writeSecureFile) used by both Adobe modules, and applies it at every directory-creation and session/cookie-jar write call site.
diegosouzapw
force-pushed
the
fix/12572-firefly-perms
branch
from
September 10, 2026 17:00
bf5ba2b to
60931fc
Compare
Githab-capibara
added a commit
to Githab-capibara/OmniRoute
that referenced
this pull request
Sep 17, 2026
…h 0700/0600 perms (cheaper-inference#12572) (cheaper-inference#13242) Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit. Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them. - ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243) - `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline - 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs - `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…h 0700/0600 perms (cheaper-inference#12572) (cheaper-inference#13242) Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit. Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them. - ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on cheaper-inference#13243) - `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK - complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline - 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs - `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for cheaper-inference#13278 and cheaper-inference#13276, annotated and landed on cheaper-inference#13243⚠️ base-red inherited: cheaper-inference#12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
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.
Closes #12572
Root cause
open-sse/services/adobeFireflySession.tsandopen-sse/services/adobeFireflyBrowserLogin.tspersist Adobe Firefly session state — including a live IMS Bearer JWT (accessToken) and the full Adobe cookie jar — to disk viamkdirSync(dir, { recursive: true })andwriteFileSync(path, ..., "utf8")with nomodeargument, so the directory/file inherit the process umask (0755/0644 typically) instead of the restrictive0700/0600pattern already established in this repo for the analogous case (src/lib/vncSession/service.ts::createProfileDir).The Notion half of the original report is a confirmed false positive (
notionThreadSessions.ts'sThreadSessionEntrynever persists a cookie/token) and is intentionally out of scope, per the plan-file analysis.Fix
open-sse/utils/secureFileWrite.ts(ensureSecureDir/writeSecureFile) mirroring thevncSession/service.ts::createProfileDirpattern (mkdirSync(..., mode: 0o700)+chmodSync(..., 0o700)for dirs;writeFileSync(..., mode: 0o600)for files) so a future browser-login integration can't reintroduce the unhardened pattern.adobeFireflySession.ts:sessionFilePath()directory creation, themarkAdobeFireflyArpSuccess()disk-fallback write, andsaveDiskSession()now go through the shared helper.adobeFireflyBrowserLogin.ts:adobeBrowserCookieJarPath()directory creation andsaveAdobeBrowserCookies()now go through the shared helper.Regression test
tests/unit/adobe-firefly-session-file-perms.test.ts(TDD, reusing the plan-file's proven-red repro mechanics):markAdobeFireflyArpSuccess()on a freshDATA_DIRcreatesadobe-firefly-sessions/at mode 0700.ensureSecureDir()tightens an already-existing 0777 directory back to 0700.writeSecureFile()writes files at mode 0600.The plan-file's own repro (
markAdobeFireflyArpSuccesson a fresh mkdtempDATA_DIR) was already proven RED against the current release/v3.8.51 tip (910f58c):AssertionError: expected adobe-firefly-sessions dir to be 0700 ..., got mode 775. The same call path is exercised by the new test suite above, now GREEN against the fix.Gates run
node scripts/check/check-file-size.mjs→ OK (no violations attributable to changed files)node scripts/check/check-complexity.mjs→ OK — 2798 violations (baseline 3218)node scripts/check/check-cognitive-complexity.mjs→ OK — 1265 violations (baseline 1437)npm run typecheck:core→ exit 0npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>→ cleanadobe-firefly.test.ts,adobe-firefly-browser-login.test.ts,adobe-firefly-security.test.ts): 68/68 pass, unaffectedScope
Out of scope per the plan-file (maintainer-confirmed):
notionThreadSessions.ts(false positive, no credential fields persisted) andsrc/lib/db/core.tsDATA_DIR hardening (related but separate, lower-priority gap).