From e16d3f1230f22cd1a5a8406fb332fb92a55e2c60 Mon Sep 17 00:00:00 2001 From: caadiq Date: Sun, 7 Jun 2026 15:40:42 +0900 Subject: [PATCH] =?UTF-8?q?fix(security):=20=EA=B3=B5=EA=B0=9C=20/api/bots?= =?UTF-8?q?=EC=97=90=EC=84=9C=20=EB=AF=BC=EA=B0=90=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 무인증 공개 엔드포인트가 봇 설정(채널/계정/필터)과 에러 내부정보 (errorMessage 등)를 그대로 노출하던 것을 상태 요약 필드만 반환하도록 화이트리스트. getBots() await 누락(잠재 버그)도 함께 수정. 관리자 화면은 인증된 /api/admin/bots 사용(영향 없음). Co-Authored-By: Claude Opus 4.7 --- backend/src/app.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/backend/src/app.js b/backend/src/app.js index ce72c1a..c297139 100644 --- a/backend/src/app.js +++ b/backend/src/app.js @@ -122,13 +122,22 @@ export async function buildApp(opts = {}) { return { status: 'ok', timestamp: nowKST() }; }); - // 봇 상태 조회 엔드포인트 + // 봇 상태 조회 엔드포인트 (공개) + // 민감한 설정(채널/계정/필터)·에러 내부정보는 제외하고 상태 요약만 노출. + // 관리자 화면은 인증된 /api/admin/bots를 사용한다. fastify.get('/api/bots', async () => { - const bots = fastify.scheduler.getBots(); + const bots = await fastify.scheduler.getBots(); const statuses = await Promise.all( bots.map(async bot => { const status = await fastify.scheduler.getStatus(bot.id); - return { ...bot, ...status }; + return { + id: bot.id, + type: bot.type, + enabled: bot.enabled, + status: status.status, + lastCheckAt: status.lastCheckAt, + lastAddedCount: status.lastAddedCount, + }; }) ); return statuses;