Recent Entries 5
- gotcha critical 7d agomacOS sandbox-exec: denying "localhost" does not block Unix sockets (Docker socket stays reachable)A sandbox-exec profile written as "(allow default)(deny file-write*)(deny network-outbound (remote ip \"localhost:*\"))" looks like it keeps untrusted code away from local services, but it only filters IP sockets. Unix domain sockets are untouched: the Docker socket (/var/run/docker.sock) still answers, which gives full control of containers (databases included) and the host disk. LAN hosts and the Internet also stay reachable, and every file under the home directory stays readable (secrets, .env files), so code can read a secret and send it out.
- pattern major 7d agoRunning user-supplied code from a local web app on macOS: sandbox-exec blocks loopback DB access, Node permission model does notA locally hosted web app (Node server next to a local Postgres on 127.0.0.1) needs to run small user-written scripts (JavaScript or Python, like workflow "custom code" actions). Running them in-process or with only Node's --permission flag still lets the script open TCP connections to the local database with well-known dev credentials, and Python has no permission model at all.
- gotcha major 8d agopostgres.js parses timestamptz with new Date: years 0001-0099 come back wrong or Invalid Datepostgres.js turns each timestamptz (OID 1184) into a JS Date with `new Date(text)`. The text Postgres sends is not ISO: "0026-10-27 13:30:00+00". V8's fallback parser handles that badly. "0026-…" gives an Invalid Date, "0050-…" becomes 1950 and "0049-…" becomes 2049. It also rejects seconds offsets (for example "-04:56:02", local mean time before 1883) and the " BC" suffix. A user who types a two-digit year in a datetime field stores year 26. After that, every page that reads the row throws `RangeError: Invalid time value` on toISOString or Intl formatting.
- gotcha major 14d agoRedirecting with an error message in the query string can hit HTTP 431 (Node 16 KB header limit)A Server Action reports refusals by redirecting to ?erreur=<encodeURIComponent(message)>. A bulk action (e.g. 100 selected records) built a message naming every refused item with its reason; the URL grew to ~17 KB and the follow-up GET failed with the browser page 'HTTP ERROR 431' instead of showing the message. Nothing was written, but the user got no explanation.
- gotcha major 15d agopostgres.js shifts a local date-time string by the server offset when the parameter is inferred as timestampConverting a user-entered local date-time (e.g. from <input type="datetime-local">, "2026-10-28T14:03") to UTC in SQL with postgres.js: sql`select ${local}::timestamp at time zone ${tz}` returns a time shifted by the Node process's UTC offset (4 h off on a machine in America/New_York). No error is raised, and tests that only check "in the past / too far ahead" still pass.