Repository navigation
fix(perplexity): store account backups in credential-backups with owner-only permissions and 7-day retention - #76
Merged
devin-ai-integration[bot] merged 2 commits intoOct 3, 2026
Conversation
…er-only permissions and 7-day retention Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
There was a problem hiding this comment.
✅ Devin resolved all 2 findings on 19cd024
Fixed by Devin (2)
- Recent legacy backups remain readable by other users
- New session files expose tokens before permission change
…folder to owner Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Merged
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
Perplexity account backups were much weaker than the CLIProxyAPI ones.
AccountService.RemoveandAccountService.RemoveAllcopied the session token into{perplexity-accounts}/.backup/{stamp}/. That folder used default permissions and was never pruned, so every removed token stayed there forever.Both kinds of backup now go through one shared helper,
CredentialBackups(in Infrastructure, extracted fromProviderCatalogService):UniquePath).CredentialBackups.Retention).AccountServiceconstructor locks the old.backup/folder to 0700, then prunes it and the shared root with the same 7-day rule. It also removes.backup/once it is empty.CredentialBackups.WriteOwnerOnly, usingFileStreamOptions.UnixCreateMode). They live inside a 0700 accounts folder, so there is no window where another user can read them.AccountService(string directory)becomesAccountService(string directory, string backupRoot), so tests never write into the real LocalData folder.Backups stay plaintext on purpose. They are only a manual recovery path (copy the file back), and OS-keyring encryption is not worth it until there is an in-app restore.
Tests: new tests check where the backup lands, the permissions of the backup, the account file and the folders, and that expired legacy
.backup/folders are pruned. Existing prune/unique-path tests now targetCredentialBackups. CHANGELOG has an entry underUnreleased→Security.Link to Devin session: https://app.devin.ai/sessions/86d238e41c424258929c91b0e2ac8a33
Open in Devin Desktop: https://app.devin.ai/desktop/session/86d238e41c424258929c91b0e2ac8a33?variant=devin
Requested by: @Villoh