Skip to content

don't load masterkey from arbitrary paths - #4180

Merged
overheadhunter merged 2 commits into
developfrom
feature/patched-masterkey-loading
Mar 12, 2026
Merged

overheadhunter merged 2 commits into
developfrom
feature/patched-masterkey-loading

Conversation

@overheadhunter

Copy link
Copy Markdown
Member

No description provided.

@overheadhunter
overheadhunter requested a review from infeo March 12, 2026 09:03
@coderabbitai

coderabbitai Bot commented Mar 12, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d765d4b4-fe31-4161-b347-ca605c9d5d08

📥 Commits

Reviewing files that changed from the base of the PR and between 8e4bff8 and 5c75eea.

📒 Files selected for processing (1)
  • src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingStrategy.java

Walkthrough

The change updates masterkey file resolution in MasterkeyFileLoadingStrategy.java to use a fixed filename from Constants (Constants.MASTERKEY_FILENAME) instead of deriving the filename from the key ID's scheme-specific part. It logs a warning when the scheme-specific part differs from the expected masterkey filename, resolves the masterkey via vault.getPath().resolve(Constants.MASTERKEY_FILENAME), and falls back to prompting the user if the file is missing. The unlock sequence is annotated with a dedicated unlock comment marker, and backup-related comments now indicate a “backup on successful unlock” with existing conditional backup logic preserved for vault-contained vs external files.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether it relates to the changeset. Add a pull request description explaining the security rationale and implementation details of restricting masterkey file path resolution.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'don't load masterkey from arbitrary paths' directly describes the main security-focused change: restricting masterkey loading to use a fixed filename instead of arbitrary paths from keyId.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/patched-masterkey-loading

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingStrategy.java`:
- Line 36: Replace the duplicated filename constant in
MasterkeyFileLoadingStrategy by removing DEFAULT_MASTERKEY_PATH and using the
existing Constants.MASTERKEY_FILENAME; update any usages in
MasterkeyFileLoadingStrategy (e.g., where DEFAULT_MASTERKEY_PATH is referenced)
to reference Constants.MASTERKEY_FILENAME instead and import
org.cryptomator.ui.Constants if necessary so the class uses the single shared
constant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4cf94e6c-6b12-45db-b701-f48dc05c9b9d

📥 Commits

Reviewing files that changed from the base of the PR and between b8413a2 and 8e4bff8.

📒 Files selected for processing (1)
  • src/main/java/org/cryptomator/ui/keyloading/masterkeyfile/MasterkeyFileLoadingStrategy.java

@overheadhunter
overheadhunter merged commit 1e3dfe3 into develop Mar 12, 2026
5 checks passed
@overheadhunter overheadhunter added this to the 1.19.1 milestone Mar 12, 2026
@infeo
infeo deleted the feature/patched-masterkey-loading branch March 12, 2026 09:25
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.

2 participants