Skip to content

Commit 4b31354

Browse files
committed
fix(registry): close 0.23 audit findings
1 parent c8925fe commit 4b31354

24 files changed

Lines changed: 760 additions & 359 deletions

‎.github/dependabot.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
- package-ecosystem: cargo
9+
directory: /services/registry-verifier
10+
schedule:
11+
interval: weekly
12+
open-pull-requests-limit: 5
13+
- package-ecosystem: npm
14+
directory: /services/registry-api
15+
schedule:
16+
interval: weekly
17+
open-pull-requests-limit: 5
18+
- package-ecosystem: gitsubmodule
19+
directory: /
20+
schedule:
21+
interval: weekly
22+
open-pull-requests-limit: 5
23+
- package-ecosystem: github-actions
24+
directory: /
25+
schedule:
26+
interval: weekly
27+
open-pull-requests-limit: 5

‎.github/workflows/ci.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
REGISTRY_TEST_DATABASE_URL: postgresql://cellscript_test:cellscript_test_password@127.0.0.1:5432/cellscript_registry_test
4343
steps:
4444
- name: Check out repository
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
4646
with:
4747
submodules: recursive
4848

@@ -73,7 +73,7 @@ jobs:
7373
git config --global user.email "ci@cellscript.dev"
7474
7575
- name: Cache Cargo dependencies
76-
uses: actions/cache@v4
76+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
7777
with:
7878
path: |
7979
~/.cargo/git
@@ -90,23 +90,23 @@ jobs:
9090
9191
- name: Upload backend shape report
9292
if: always()
93-
uses: actions/upload-artifact@v4
93+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
9494
with:
9595
name: cellscript-backend-shape-report
9696
if-no-files-found: error
9797
path: /tmp/cellscript-backend-shape/
9898

9999
- name: Upload syntax combination audit report
100100
if: always()
101-
uses: actions/upload-artifact@v4
101+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
102102
with:
103103
name: cellscript-syntax-combo-audit
104104
if-no-files-found: ignore
105105
path: target/syntax-combo-audit/
106106

107107
- name: Upload strict backend audit report
108108
if: always()
109-
uses: actions/upload-artifact@v4
109+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
110110
with:
111111
name: cellscript-strict-backend-audit
112112
if-no-files-found: ignore

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
timeout-minutes: 180
2727
steps:
2828
- name: Check out tagged source
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
3030
with:
3131
fetch-depth: 0
3232
submodules: recursive
3333

3434
- name: Install Node.js
35-
uses: actions/setup-node@v4
35+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
3636
with:
3737
node-version: "22"
3838
cache: npm
@@ -41,7 +41,7 @@ jobs:
4141
editors/vscode-cellscript/package-lock.json
4242
4343
- name: Install Rust release toolchain
44-
uses: dtolnay/rust-toolchain@stable
44+
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
4545
with:
4646
toolchain: "1.97.1"
4747
components: rustfmt, clippy, llvm-tools-preview
@@ -99,7 +99,7 @@ jobs:
9999

100100
- name: Upload release evidence
101101
if: always()
102-
uses: actions/upload-artifact@v4
102+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
103103
with:
104104
name: cellscript-release-gate-evidence
105105
if-no-files-found: warn
@@ -126,7 +126,7 @@ jobs:
126126
os: ubuntu-latest
127127
steps:
128128
- name: Check out repository
129-
uses: actions/checkout@v4
129+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
130130
with:
131131
fetch-depth: 0
132132
submodules: recursive
@@ -139,7 +139,7 @@ jobs:
139139
git -C "$GITHUB_WORKSPACE/../ckb-sdk-rust" rev-parse --short HEAD
140140
141141
- name: Install Rust toolchain
142-
uses: dtolnay/rust-toolchain@stable
142+
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
143143
with:
144144
toolchain: "1.97.1"
145145
targets: ${{ matrix.target }}
@@ -179,7 +179,7 @@ jobs:
179179
sha256sum "${{ steps.package.outputs.archive }}" > SHA256SUMS.${{ matrix.target }}
180180
181181
- name: Upload artifact
182-
uses: actions/upload-artifact@v4
182+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
183183
with:
184184
name: cellscript-${{ matrix.target }}
185185
path: |
@@ -194,12 +194,12 @@ jobs:
194194
contents: write
195195
steps:
196196
- name: Check out repository
197-
uses: actions/checkout@v4
197+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
198198
with:
199199
submodules: recursive
200200

201201
- name: Download all artifacts
202-
uses: actions/download-artifact@v4
202+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
203203
with:
204204
path: artifacts
205205
merge-multiple: false
@@ -220,7 +220,7 @@ jobs:
220220
printf 'version=%s\n' "$VERSION" >> "$GITHUB_OUTPUT"
221221
222222
- name: Create GitHub Release
223-
uses: softprops/action-gh-release@v2
223+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
224224
with:
225225
tag_name: v${{ steps.version.outputs.version }}
226226
name: CellScript ${{ steps.version.outputs.version }}

‎.github/workflows/website-build.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
timeout-minutes: 15
1414
steps:
1515
- name: Check out repository
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
1717
with:
1818
submodules: recursive
1919

2020
- name: Set up Node.js
21-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
2222
with:
2323
node-version: "22"
2424
cache: "npm"
@@ -46,7 +46,7 @@ jobs:
4646
npm exec -- astro build
4747
4848
- name: Upload website dist
49-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
5050
with:
5151
name: cellscript-website-dist
5252
path: website/dist/

‎CHANGELOG.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
## Unreleased
44

5+
- Close the 0.23 Registry audit findings across admission, verification, and
6+
delivery. Publisher-controlled repository and homepage fields now require
7+
credential-free HTTPS URLs, malformed base64 is a stable client error, and
8+
unexpected server failures no longer disclose internal messages. Source
9+
hashing confines manifest entry/source-root paths to the package, the
10+
isolated verifier rejects path/Git dependencies, and signed dependency
11+
metadata must exactly match the materialized `Cell.toml`. The Node adapter
12+
derives quota identity only across an explicitly configured trusted-proxy
13+
boundary. Fix Registry CI under a shared `CARGO_TARGET_DIR` and additive
14+
migrations, pin GitHub Actions by commit, add Dependabot coverage, and
15+
update vulnerable Registry/website build dependencies. The website filters
16+
Registry navigation URLs and adds a defense-in-depth CSP.
517
- Make Registry chain confirmation compatible with the standard CKB v0.207.0
618
RPC schema by resolving a live Cell's committed block through
719
`get_transaction.tx_status` instead of depending on a proxy-specific

‎docs/releases/CELLSCRIPT_0_23_RELEASE_NOTES.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**Status**: Development release notes for `nightly-0.23`; not a stable release
44
certificate.
55

6-
**Updated**: 2026-08-02.
6+
**Updated**: 2026-08-08.
77

88
CellScript 0.23 makes its source semantics and compatibility axes explicit.
99
Edition 2026 is the first and only CellScript source-semantics epoch. The
@@ -30,12 +30,14 @@ work.
3030
| Build identity | The resolved profile independently combines edition, target, primitive assurance, metadata schemas, and entry/witness ABIs, then binds them into metadata, registry, lock, deployment, receipt, and builder records. |
3131
| Registry contract | The deployed publish contract requires Edition 2026 plus its compatibility-profile hash from CLI signature through API, Postgres, version-addressed JSON, and website; assurance states require ordered evidence. |
3232
| Registry operations | `api.registry.cellscript.dev` and `registry.cellscript.dev` run as an isolated self-hosted Postgres/Node/object-volume/read-only-nginx stack behind trusted TLS. |
33+
| Registry testnet | Pudge runs as a separate short-lived testnet sandbox with distinct API, object, database, wallet-session, RPC, and website state; it is not a mode of the production Registry. |
3334
| Registry retry safety | Pre-admission failures release only the failed request's nonce and retry reservation; accepted metadata commits transactionally, and readiness covers the actual managed object prefixes. |
3435
| Registry verification | Publish transactionally queues a leased, bounded real-compiler verification job; verified evidence/status commit atomically before crash-safe static-index convergence, and default search stays hidden until the baseline passes. |
3536
| Registry artifact profiles | CellScript dependencies, CKB executables, runtime verifiers, reproducible binaries, and copy-only templates share discovery but retain different resolver, TCB, deployment, and copy contracts. |
3637
| Registry reproducibility | Reproducible profiles stay `evidence_required` until independent builder reports bind the signed environment, source, recipe, executable, and build logs. |
3738
| Registry chain evidence | Mainnet deployment records are RPC-checked; configured Registry Type/Lock Scripts produce wallet transaction intents and a bounded Type-Script indexer reconciles live commitments without erasing history. |
3839
| Production HTTP boundary | API/static JSON responses use HSTS, deny-all content policy, anti-framing, no-sniff, and restrictive browser permissions; the website ships a reproducible read-only nginx deployment with health checks and bounded logs/temp storage. |
40+
| Audit closure | Registry links are HTTPS-only, source paths and dependency sources are verifier-confined, signed dependencies are manifest-bound, proxy identity is explicit, and CI/supply-chain dependencies are deterministic and monitored. |
3941
| Registry install policy | Explicit unverified/quarantined install acknowledgements persist per dependency, so lock refresh and subsequent builds retain the same auditable risk choice. |
4042
| Tooling | CLI, LSP, WASM, website bindings, examples, and package tooling use the same edition contract. |
4143
| Syntax audit | Canonical type fields use trailing commas, checked examples use named `u64` boundaries, and compatibility plus CKB-VM regressions cover both source and witness placement. |

‎roadmap/CELLSCRIPT_0_23_ROADMAP.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Source documents:
144144

145145
## Pillar 1: Public Registry Production Deployment
146146

147-
**Status (2026-08-02): production infrastructure, public reads, website, CLI
147+
**Status (2026-08-08): production infrastructure, public reads, website, CLI
148148
resolution, evidence promotion, and the bounded automatic source/build
149149
verification pipeline are implemented and deployed. The generalized artifact,
150150
independent reproduction, mainnet deployment, and configured chain-commitment
@@ -320,7 +320,9 @@ runtime or the optional Cloudflare/R2/Hyperdrive/Neon adapter.
320320
remain under their own Lock/Type Scripts and transaction protocols.
321321
- No bond or refundable deposit mechanism; the schema leaves `policy_hooks`
322322
and `bond_policy_hooks` for later.
323-
- No testnet Registry authorisation, deployment, or commitment state.
323+
- No testnet state or network selector inside the production Registry. Pudge
324+
authorisation, deployment, and commitment testing runs in a separately
325+
isolated, expiring sandbox.
324326
- No D1 as primary database.
325327

326328
Source documents:

‎scripts/cellscript_gate.sh‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,11 @@ run_registry_api_check() {
390390
fi
391391
run npm --prefix services/registry-api run check
392392
run cargo build --locked --manifest-path services/registry-verifier/Cargo.toml
393-
run env CELLSCRIPT_REGISTRY_VERIFIER_TEST_BINARY="$ROOT_DIR/services/registry-verifier/target/debug/cellscript-registry-verify" \
393+
local verifier_target_dir="${CARGO_TARGET_DIR:-$ROOT_DIR/services/registry-verifier/target}"
394+
if [[ "$verifier_target_dir" != /* ]]; then
395+
verifier_target_dir="$ROOT_DIR/$verifier_target_dir"
396+
fi
397+
run env CELLSCRIPT_REGISTRY_VERIFIER_TEST_BINARY="$verifier_target_dir/debug/cellscript-registry-verify" \
394398
npm --prefix services/registry-api test
395399
run npm --prefix services/registry-api run build
396400
run npm --prefix services/registry-api run build:node

‎services/registry-api/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,14 @@ use `CKB_MIN_CONFIRMATIONS` to raise or lower the default 24-block confirmation
472472
floor. The Node adapter, production Compose file, and Worker example pass the
473473
same settings.
474474

475+
The Node adapter never trusts client-supplied `CF-Connecting-IP`,
476+
`CF-ASN`, or internal Registry identity headers. `REGISTRY_TRUST_PROXY_HOPS`
477+
defaults to `0`; the checked-in Compose stacks set it to `1` because ingress is
478+
restricted to the external TLS proxy. That proxy must overwrite or append the
479+
actual peer to `X-Forwarded-For`, and direct client access to the API container
480+
must remain blocked. Change the hop count only when the ingress topology
481+
changes.
482+
475483
The API container applies tracked additive migrations before serving traffic.
476484
`0001_initial.sql` is the frozen deployed baseline. `0002` adds the verifier
477485
queue; `0003` adds multi-wallet principals; `0004` converts an empty legacy
@@ -482,6 +490,8 @@ hash-integrity evidence from semantic verification with `hash_bound`; and
482490
renames historical chain evidence, adds the current-commitment pointer and
483491
status projection constraints, and deliberately demotes legacy current claims
484492
until the mainnet indexer re-observes a sufficiently confirmed live Cell.
493+
`0008` adds expiring Pudge sandbox state and purge tombstones; `0009` adds the
494+
browser/CLI authorisation-session lifecycle.
485495

486496
`GET /health` is process liveness and is the Compose container healthcheck.
487497
`GET /ready` is the traffic and operator gate: it checks store/object access,

‎services/registry-api/deploy/docker-compose.production.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ services:
6666
CKB_MIN_CONFIRMATIONS: ${CKB_MIN_CONFIRMATIONS:-24}
6767
ENVIRONMENT: production
6868
REGISTRY_ENVIRONMENT: production
69+
REGISTRY_TRUST_PROXY_HOPS: "1"
6970
MAX_INCOMING_BODY_BYTES: "7340032"
7071
MAX_JSON_BODY_BYTES: "6291456"
7172
MAX_SNAPSHOT_BYTES: "5242880"

0 commit comments

Comments
 (0)