Medium, CVSS 4.7npmAmendedPublished
Mojic: Observable Timing Discrepancy in HMAC Verification
CVE-2026-41244 · GHSA-wqq3-wfmp-v85g
- Affected
- npm mojic <= 2.1.3
- Fixed in
- 2.1.4· Vendor fix available
- Issue
- The CipherEngine in Mojic v2.1.3 uses a standard equality operator (!==) to verify the HMAC-SHA256 integrity seal during the decryption phase. This creates an Observable Timing Discrepancy (CWE-208), allowing a potential attacker to bypass the file integrity check via a timing attack. Details In lib/CipherEngine.js, the footer check validates the HMAC signature using a standard string comparison: if (footerHex !== calcDigest) { ... } Standard string comparisons in JavaScript short-circuit; they return false the moment a character mismatch occurs. Because the time taken to evaluate the comparison is proportional to the number of matching leading bytes, an attacker can measure the exact microseconds it takes for the engine to throw the FILETAMPERED error. By repeatedly altering the signature byte-by-byte and analyzing these minute timing differences, a malicious actor can theoretically forge a valid HMAC signature without possessing the decryption password. PoC The vulnerable…
Recommended action: Upgrade to 2.1.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.