Cloudflare Workers (nodejs_compat): SignedDataVerifier passes with online checks; two non-crypto blockers remain
@vishalhabib99 đang làm issue này rồi.
Từ ngày 13/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 32/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, node.js, typescript
- Lĩnh vực
- backend, networking
Hướng nghiên cứu
Start from the OCSP request path — follow where node-fetch is imported and where fetch(url, { timeout }) and response.buffer() are used — and replace them with the global fetch plus AbortSignal.timeout(30000) and Buffer.from(await response.arrayBuffer()). For the import-time randomness, find where jsrsasign is statically imported and move it to a lazy dynamic import inside the async verification methods. The existing test should validate a real chain with OCSP is the check: done means it still passes on Node and a Worker with nodejs_compat boots without a global-scope error.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In #255 you asked to be told if a runtime such as Cloudflare Workers now has the crypto needed to verify signed data. We tested it, and it does. Only two small issues block it, and neither involves the crypto.
What we measured
2026-10-23, @apple/app-store-server-library 3.1.0, wrangler 4.149.0 (workerd 1.20261006.1), compatibility_date = "2026-10-01", compatibility_flags = ["nodejs_compat"]. Node v24 was the control.
| Check | Cloudflare edge (NRT), 3 runs | Node v24 |
|---|---|---|
Real Apple chain with OCSP (enableOnlineChecks = true). We used the certificates and date from this repo's test should validate a real chain with OCSP |
passes (116–146 ms) | passes (199–216 ms) |
verifyAndDecodeTransaction on a JWS signed by a test chain (online checks off) |
passes | passes |
| Same JWS with its payload tampered | rejected | rejected |
The library's use of node:crypto (X509Certificate, signature verification, hashing) worked as-is under nodejs_compat.
What blocked it
- jsrsasign generates random values at import time. When the module loads, it calls
crypto.getRandomValues. Workers do not allow random generation in global scope (Disallowed operation called within global scope), so a staticimportstops the Worker from starting. Our workaround is a dynamicimport()inside the request handler. - The OCSP request relies on node-fetch v2-only APIs:
fetch(url, { timeout })andresponse.buffer(). On Workers, the bundler replacesnode-fetchwith a polyfill that forwards to the platformfetch. That polyfill has neither API, and the call fails with(0 , node_fetch_1.default) is not a function. Our workaround is to aliasnode-fetchto a wrapper of about 30 lines.
Suggestion
For (2), the OCSP request could use the global fetch (Node 18+) with signal: AbortSignal.timeout(30000), and read the body with Buffer.from(await response.arrayBuffer()). Because the abort signal also covers reading the body, I think this would also fix #455.
For (1), #472 is one approach (it replaces jsrsasign). A smaller change would be to load jsrsasign lazily in the verification path, since those methods are already async.
Note for local testing
wrangler dev --local sends CF-Worker: example.com on outgoing requests, and Apple's OCSP responder answers 403 to that value. Requests with no header, or with other values (foo.com, workers.dev), get 200. A deployed Worker gets 200 too. This only matters when testing OCSP locally. --local-upstream <your-domain> avoids it.
- Ngôn ngữ chính
- TypeScript
- Star
- 388
- Fork
- 88
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apple/app-store-server-library-node
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
NotificationHistoryResponseValidator uses the response validator for history items and accepts malformed item fieldsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
-
Abort OCSP requests when the response times outCó thể đã có người làm @TorinAsakura đã nhận 71 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Subscription status response validators omit validation of data and nested lastTransactionsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 84/100
Tất cả issue của apple/app-store-server-library-node
Issue tương tự
-
bug priority: low role: BE stage: now
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
ahmadrosid/nakama#2594 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
milind-soni/OpenMausBot#6495 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Navigating the session tree adds the branch's prompts to Up-arrow history againCó thể đã có người làm @acmerfight đã nhận hôm nay. Đang mởuntriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
earendil-works/pi#12279 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
approved documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 89/100
vitest-dev/vitest#12015 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày