#13858·paperclip

Unguarded `crypto.randomUUID()` makes the comment composer a silent no-op on any non-HTTPS deployment (2026.916.0+)

Author: ukaya0Created Sep 23, 2026Updated Sep 28, 2026

Summary

Since 2026.916.0, clicking Send in the comment composer does nothing on any Paperclip instance served over plain HTTP from a non-localhost origin. No request, no toast, no error, no server-side trace — the typed text simply stays in the box.

There are two separate defects here. Fixing either one alone still leaves a bad outcome:

  1. The missing guard. crypto.randomUUID() is called unguarded. It is [SecureContext] in the WebCrypto spec, so it is undefined in Chrome, Firefox and Safari on any non-HTTPS, non-localhost origin.
  2. The silent catch. The submit handler wraps the whole operation in a try/catch whose only observable action is restoring the draft text. Any exception on that path is swallowed with no user-visible error at all, which is what turns a clear TypeError into "the button is broken".

Defect 2 is the more serious of the two: it is why this took two days to find, and it will hide the next exception on that path just as completely.

Affected versions

version attemptId machinery unguarded crypto.randomUUID() in the composer
2026.831.1 absent (0 occurrences) no
2026.916.0 present yes
2026.916.1 present yes

The regression arrives with the attemptId / clientRequestId idempotency work in 2026.916.0.

Reproduction

  1. Configure an instance with server.bind: "lan" and an allowedHostnames entry that is a raw IP or LAN hostname — i.e. anything that is not localhost and not HTTPS.
  2. Open the dashboard at http://<lan-ip>:3100.
  3. Type a message into any in-task composer, or into direct agent chat.
  4. Click Send.

Expected: the comment posts, or an error is shown. Actual: nothing happens. POST /api/issues/{id}/comments is never issued.

Confirm the precondition in the devtools console on that origin:

javascript
window.isSecureContext    // false
typeof crypto.randomUUID  // "undefined"

Root cause

From the shipped bundle ui-dist/assets/index-5zyW-AFc.js (2026.916.1), composer submit handler at ~offset 2511852, minified:

javascript
K(""), Q(!0);                       // clear the editor, set busy
let Ms = null;
try {
  ...
  Ms = crypto.randomUUID();         // throws: undefined in an insecure context
  T && (lc(T, Wt), kx(T, { attemptId: Ms, reviewed: !1 }));
  ...
  await e(js, Zt, tt, $s.length ? $s : void 0, Ms);   // the POST that never runs
} catch (us) {
  ...
  const Is = $s ? `${Wt}\n\n${$s}` : Wt;
  We.current = Is, ..., K(Is);      // restore the draft — and nothing else
} finally {
  ..., Q(!1);                       // clear busy
}

The catch restores the draft and clears the busy flag. It surfaces no toast, sets no error state, and does not re-throw — so the UI returns to exactly its pre-click appearance.

Other unguarded call sites in the same bundle

Nine of the fifteen crypto.randomUUID occurrences are unguarded. The remaining six are three call sites already using a typeof crypto.randomUUID === "function" ? … : fallback ternary, so the guarded pattern is clearly the intended one — these look like omissions rather than a deliberate requirement:

~offset surface
1703207 the other composer
2508090 attachment upload
2511852 in-task composer (this report)
2639870 external-channel "Send to channel"
2779498 addComment(… ?? crypto.randomUUID())
3582166 decisions desk — decision idempotencyKey
1215983, 1216226 agent-setup secret keys
4317077 chat-endpoint setup wizard

Impact

Every deployment reached over plain HTTP from anything other than localhost — which is the normal shape for a self-hosted instance on a LAN or a Tailscale address. On such an instance the human operator cannot comment on a task or use agent chat at all, and because the failure is client-side and silent, the server logs and the database look completely healthy. Ours had been in that state for two days before anyone worked out why.

Suggested fix

  1. Guard the call sites, matching the ternary already used elsewhere in the bundle, or route them all through one helper:

    javascript
    const randomId = () =>
      globalThis.crypto?.randomUUID?.() ?? uuidV4FromGetRandomValues();

    crypto.getRandomValues() is not secure-context gated, so a correct v4 is always derivable where randomUUID is not available.

  2. Make the composer catch observable. Restoring the draft is right; doing it with no message is not. Surface a toast, and log the exception — otherwise the next unrelated throw on that path produces the same undiagnosable "nothing happens".

Optionally: warn at startup when the server is configured to serve a non-HTTPS, non-localhost origin, since a growing number of browser APIs will fail that way.

Workaround, for anyone hitting this before a release

A classic inline <script> in ui-dist/index.html, placed before the type="module" bundle tag (a classic inline script runs before a deferred module, so it is installed ahead of any app code):

xml
<script>
  (() => {
    const c = globalThis.crypto;
    if (!c || typeof c.randomUUID === "function" || typeof c.getRandomValues !== "function") return;
    c.randomUUID = () => {
      const b = new Uint8Array(16);
      c.getRandomValues(b);
      b[6] = (b[6] & 0x0f) | 0x40;
      b[8] = (b[8] & 0x3f) | 0x80;
      const h = [...b].map((x) => x.toString(16).padStart(2, "0")).join("");
      return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`;
    };
  })();
</script>

It is a no-op wherever randomUUID already exists, so it is safe on HTTPS and localhost too. index.html is served from disk with Cache-Control: no-cache, so no restart is needed — just reload the page. Note that it lives in a versioned install directory and is wiped by the next upgrade.