Hierarchical Keyring: cold-cache stampede — N concurrent decrypts → N DynamoDB/KMS calls
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- aws, node.js, typescript
Rechercherichtung
Beginne beim Pfad getBranchKeyMaterials von Node Hierarchical Keyring und verfolge, wie der Materials-Cache eine Abfrage bei leerem Cache verarbeitet. Reproduziere das Problem mit gleichzeitigen Entschlüsselungen oder Verschlüsselungen für eine Branch-Key-Version und überprüfe, dass eine einzige laufende Keystore-Anfrage gemeinsam genutzt wird, abgeschlossene Einträge entfernt werden und eine fehlgeschlagene Anfrage erneut versucht werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Security issue notifications
If you discover a potential security issue in the AWS Encryption SDK we ask that you notify AWS Security via our vulnerability reporting page. Please do not create a public GitHub issue.
Problem:
The Node Hierarchical Keyring doesn't de-dupe concurrent branch-key lookups. If I fire a lot of decrypts for the same branch key at once against a cold cache, they all miss the cache together (it's only filled after the keystore call returns), so each one hits the keystore on its own.
So instead of one lookup I get N DynamoDB GetItem + N KMS Decrypt calls. Easy to repro: await Promise.all of ~3000 decrypts for the same key version, and you see ~3000 keystore calls instead of 1. Encrypt has the same problem since it shares the same code path.
Solution:
Add single-flight to getBranchKeyMaterials: on a miss, the first caller starts the keystore fetch and stores the in-flight promise (keyed by cache entry id); everyone else for the same key awaits that promise instead of starting their own. The entry is dropped once it settles, so the materials cache still owns caching and TTL, and a failed request isn't shared — the next call just retries.
Out of scope:
The legacy caching CMM has the same gap but it's a separate path, so I'm not touching it here.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 260
- Forks
- 68
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus aws/aws-encryption-sdk-javascript
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
aws/aws-encryption-sdk-javascript#1656 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
aws/aws-encryption-sdk-javascript#1691 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
aws/aws-encryption-sdk-javascript#1665 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
aws/aws-encryption-sdk-javascript#1520 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
aws/aws-encryption-sdk-javascript#1192 · 3 Kommentare ·
Alle Issues in aws/aws-encryption-sdk-javascript
Ähnliche Issues
-
Browser Waiting for: Product Owner
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
getsentry/sentry-javascript#24577 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
agilepathway/label-checker#640 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Offenagentic-workflows
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
anomalyco/models.dev#7701 ·