fix(bark): rotate GCM IV per push - #113
Conversation
|
Warning Review limit reached
Next review available in: 26 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughBark AES-GCM encryption now generates a fresh 12-character IV for each message, returns it with the ciphertext, and documents the request-carried IV behavior. Tests verify deterministic encryption and distinct IVs across chunks. ChangesBark encryption IV rotation
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant BarkPublisher
participant BarkEncryptor
participant BarkApp
BarkPublisher->>BarkEncryptor: Encrypt message
BarkEncryptor-->>BarkPublisher: Return ciphertext and fresh IV
BarkPublisher->>BarkApp: Send encrypted push with IV
BarkApp->>BarkApp: Decrypt using request IV
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
/agentic_review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #113 +/- ##
=======================================
Coverage 99.83% 99.83%
=======================================
Files 93 93
Lines 10509 10517 +8
Branches 620 620
=======================================
+ Hits 10492 10500 +8
Misses 12 12
Partials 5 5 ☔ View full report in Codecov by Harness. |
PR Summary by QodoRotate AES-GCM IV per Bark push and send per-message iv field
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
46 rules 1.
|
2c7eae8 to
0f18d5b
Compare
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 0f18d5b |
0f18d5b to
ada70af
Compare
|
/agentic_review |
ada70af to
f9408f0
Compare
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit f9408f0 |
Summary
ciphertext, as supported by the Bark notification extensionRoot cause
The publisher reused
BARK_ENCRYPTION_IVfor every AES-GCM encryption under the same key. GCM requires nonce uniqueness; reuse breaks its authentication and confidentiality guarantees.The official Bark client accepts an
ivfield on each encrypted push and uses it in preference to the IV stored in the App:https://github.com/Finb/Bark/blob/master/NotificationServiceExtension/Processor/CiphertextProcessor.swift
Scope
This PR only changes IV rotation and its directly related tests and documentation. It does not change the 650-character Bark product limit or add APNs payload-budget behavior.
Validation
prek run --all-filesAll E2E rounds completed with accepted encrypted Bark chunks and exit code 0. No credentials, locations, or generated notification content are included here.
Summary by CodeRabbit
New Features
Documentation
Tests