mattgodbolt-molty and Claude Fable 5.1
49b7e073ba
Make the trusted proxy hop count configurable instead of trusting every hop
...
Express was configured with "trust proxy" set to true, so req.ip was the
leftmost X-Forwarded-For entry: whatever the client chose to send. Scanners
sending "X-Forwarded-For: 127.0.0.1" were logged as 127.0.0.0, and
storeItem in the S3 storage read the raw header directly, so short link
audit records had the same problem.
Add a trustProxy property that is passed straight through to Express. The
default is "loopback" (a proxy on the same host is trusted, which covers
make dev and the common local-nginx setup); the amazon and amazonwin
environments set 2 for their CloudFront then ALB chain. storeItem now
derives the recorded address from req.ip and req.ips, so only hops Express
trusted are used.
Behaviour is covered by tests that run a real Express app through
setupBaseServerConfig with a spoofed header.
Companion infra change: compiler-explorer/infra#2353 .
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com >
2026-09-14 18:09:43 -05:00
..
2025-02-26 14:09:24 -06:00
2026-09-14 18:09:43 -05:00
2026-07-14 08:46:10 +01:00
2026-08-06 07:30:26 -05:00
2026-08-15 15:03:13 +02:00
2025-08-11 14:31:44 -05:00
2026-02-02 20:02:38 -06:00
2023-05-22 22:35:01 -05:00
2026-08-24 19:51:20 -05:00
2021-04-26 18:34:16 -05:00
2026-08-11 11:19:28 -05:00
2021-10-05 01:45:05 +02:00
2021-06-02 22:58:41 +02:00
2019-08-21 01:26:16 +02:00
2026-08-14 17:38:37 -05:00
2025-01-29 10:41:03 -06:00
2021-09-13 20:22:27 +02:00
2025-10-14 13:56:59 -05:00
2026-02-01 20:50:46 -06:00
2026-06-14 22:38:23 +01:00
2026-08-18 18:29:04 +02:00
2026-09-14 18:09:43 -05:00
2024-10-26 17:42:22 +02:00
2023-11-27 22:32:04 -06:00
2024-03-08 22:25:09 -06:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2025-01-29 10:46:17 -06:00
2026-02-16 14:01:37 -06:00
2026-02-01 20:50:46 -06:00
2026-08-24 19:51:20 -05:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2026-09-02 19:40:00 +02:00
2024-03-08 22:25:09 -06:00
2026-08-27 22:58:30 +02:00
2026-06-11 22:25:07 +01:00
2026-08-22 13:03:32 -05:00
2026-08-06 07:30:26 -05:00
2025-06-28 14:01:36 +02:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2025-08-05 09:31:48 -05:00
2026-02-01 20:50:46 -06:00
2026-06-11 23:02:35 +01:00
2026-02-01 20:50:46 -06:00
2024-03-08 22:25:09 -06:00
2026-02-01 20:50:46 -06:00
2026-06-26 22:10:36 +03:00
2026-05-10 09:15:36 -05:00
2026-02-16 15:12:07 -06:00
2025-08-12 08:50:53 -05:00
2026-09-05 16:28:02 +02:00
2026-07-02 19:13:21 +01:00
2026-02-01 20:50:46 -06:00
2026-09-14 09:27:19 -06:00
2026-02-08 12:50:20 +01:00
2025-05-26 16:24:04 -05:00
2026-05-09 17:14:30 -05:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2025-02-25 13:39:26 -06:00
2026-02-01 20:50:46 -06:00
2025-09-27 10:17:55 +03:00
2026-02-22 17:25:36 -06:00
2026-02-01 20:50:46 -06:00
2026-02-02 20:06:09 -06:00
2026-06-03 22:45:23 -05:00
2024-03-08 22:25:09 -06:00
2025-07-30 10:15:28 -05:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00
2026-02-16 10:35:07 -06:00
2026-02-01 20:50:46 -06:00
2018-05-24 12:36:57 -05:00
2026-08-24 19:34:52 -05:00
2026-02-01 20:50:46 -06:00
2025-06-11 18:22:44 -05:00
2026-02-01 20:50:46 -06:00
2025-09-27 10:17:55 +03:00
2025-09-27 10:17:55 +03:00
2026-02-01 20:50:46 -06:00
2026-02-27 21:10:47 -05:00
2026-03-11 21:40:54 +01:00
2026-07-14 08:46:10 +01:00
2025-09-27 10:17:55 +03:00
2026-05-07 19:26:03 -04:00
2025-11-04 09:00:19 -06:00
2026-07-02 19:13:21 +01:00
2025-06-11 18:22:44 -05:00
2025-06-10 12:06:57 -05:00
2026-02-01 20:50:46 -06:00
2026-08-09 22:06:51 +02:00
2026-08-06 06:59:52 -05:00
2026-08-18 18:29:04 +02:00
2026-08-22 13:03:32 -05:00
2026-02-01 20:50:46 -06:00
2026-08-09 22:06:51 +02:00
2026-08-13 20:54:42 -05:00
2025-12-15 17:50:07 -06:00
2026-07-02 19:13:21 +01:00
2026-07-27 18:54:17 +02:00
2026-08-25 19:41:35 -05:00
2026-02-08 14:23:56 -06:00
2026-02-01 20:50:46 -06:00
2026-02-01 20:50:46 -06:00