[object Object]

← back to Gracie Internal

Strip product count from unauthenticated /healthz

88443b8a787a556ce691340c01093069f3ddc0de · 2026-07-09 13:44:48 -0700 · Steve Abrams

Red-team FIX2: open /healthz leaked count:<n>; now returns {ok:true} only
(HTTP 200 preserved for keep-alive/uptime probes). Count stays behind auth
via /api/facets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 88443b8a787a556ce691340c01093069f3ddc0de
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Jul 9 13:44:48 2026 -0700

    Strip product count from unauthenticated /healthz
    
    Red-team FIX2: open /healthz leaked count:<n>; now returns {ok:true} only
    (HTTP 200 preserved for keep-alive/uptime probes). Count stays behind auth
    via /api/facets.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 server.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index fea2728..92c6695 100644
--- a/server.js
+++ b/server.js
@@ -17,8 +17,9 @@ const PG = process.env.PG || 'postgresql://localhost/dw_unified';
 const app = express();
 app.use(require('compression')());
 
-// Unauthenticated health probe BEFORE the auth gate.
-app.get('/healthz', (_req, res) => res.json({ ok: true, count: SNAP.length, refreshed: LAST_REFRESH }));
+// Unauthenticated health probe BEFORE the auth gate — bare liveness only, no catalog
+// size/detail leaked to the open probe (count stays behind auth via /api/facets).
+app.get('/healthz', (_req, res) => res.json({ ok: true }));
 
 const [AUTH_USER, AUTH_PASS] = (process.env.BASIC_AUTH || 'admin:DW2024!').split(':');
 app.use((req, res, next) => {

← d9e5f8b Persist gracie viewer sort selection to localStorage  ·  back to Gracie Internal  ·  jsonl-backed data layer: self-contained bundle for Kamatera 0b12522 →