Skip to content

fix: secure config permissions and address update channel review feedback#53

Merged
scottlovegrove merged 3 commits intomainfrom
scottl/fix-update-channel
Apr 2, 2026
Merged

fix: secure config permissions and address update channel review feedback#53
scottlovegrove merged 3 commits intomainfrom
scottl/fix-update-channel

Conversation

@scottlovegrove
Copy link
Copy Markdown
Contributor

Summary

  • Secure file permissions: setUpdateChannel now creates the config directory with 0o700 and writes config.json with 0o600 to prevent other users from reading sensitive config
  • --check downgrade display: The --check path now has a proper three-way branch distinguishing "up to date", "update available", and "downgrade available" (previously a downgrade showed as "up to date")

Note: The prerelease localeCompare fix and process.argv[1] fallback were already present in the merged code, so no changes were needed for those.

Test plan

  • npm run type-check passes
  • All 122 tests pass (npm test)
  • npm run lint:check passes (0 warnings, 0 errors)

🤖 Generated with Claude Code

…, --check display

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove self-assigned this Apr 2, 2026
Verifies that next.10 is treated as newer than next.2, preventing
reintroduction of the lexicographic comparison bug.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR improves the application's security by applying stricter permissions to the configuration file, alongside refining the version checker to correctly display downgrade options. These updates enhance both user data safety and the clarity of update messaging. However, an explicit permission update may be needed to ensure these tighter restrictions reliably apply to existing configuration files as well as other functions that modify the configuration.

Share FeedbackReview Logs

Comment thread src/lib/update-config.ts
- Add explicit chmodSync(0o600) after writeFileSync to enforce
  permissions on existing files (mode only applies to new files)
- Use "Downgrade available" instead of "Note: older than" for
  consistent phrasing between --check and normal update paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove requested review from a team and pauloslund and removed request for a team April 2, 2026 21:24
@scottlovegrove scottlovegrove added the 👀 Show PR PR must be reviewed before or after merging label Apr 2, 2026
@scottlovegrove scottlovegrove merged commit 63e64f8 into main Apr 2, 2026
4 checks passed
doist-release-bot Bot added a commit that referenced this pull request Apr 2, 2026
## [1.5.1](v1.5.0...v1.5.1) (2026-04-02)

### Bug Fixes

* secure config permissions and address update channel review feedback ([#53](#53)) ([63e64f8](63e64f8))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released 👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants