Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(security): resolve vulnerability scan findings

diegosouzapwce9dc8e85189
diff --git a/bin/reset-password.mjs b/bin/reset-password.mjs
index 9a1fcbcc00..e1d85eced8 100644
--- a/bin/reset-password.mjs
+++ b/bin/reset-password.mjs
@@ -70,10 +70,10 @@ async function main() {
console.log("ℹ️ No password is currently set.");
}
- const password = await ask("Enter new password (min 4 chars): ");
+ const password = await ask("Enter new password (min 8 chars): ");
- if (!password || password.length < 4) {
- console.error("\n❌ Password must be at least 4 characters.\n");
+ if (!password || password.length < 8) {
+ console.error("\n❌ Password must be at least 8 characters.\n");
db.close();
rl.close();
process.exit(1);
diff --git a/src/app/api/compliance/audit-log/route.ts b/src/app/api/compliance/audit-log/route.ts
index e34bd8f109..974974564c 100644
--- a/src/app/api/compliance/audit-log/route.ts
+++ b/src/app/api/compliance/audit-log/route.ts
@@ -1,5 +1,6 @@
import { NextResponse } from "next/server";
import { countAuditLog, getAuditLog } from "@/lib/compliance/index";
+import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
export const dynamic = "force-dynamic";
@@ -10,6 +11,9 @@ function parsePagination(value: string | null, fallback: number, min: number, ma
}
export async function GET(request) {
+ const authError = await requireManagementAuth(request);
+ if (authError) return authError;
+
try {
const { searchParams } = new URL(request.url);
const filters = {
diff --git a/src/app/api/logs/console/route.ts b/src/app/api/logs/console/route.ts
index 96fb706825..cdfe0984dc 100644
--- a/src/app/api/logs/console/route.ts
+++ b/src/app/api/logs/console/route.ts
@@ -13,6 +13,7 @@
import { NextRequest, NextResponse } from "next/server";
import { readFileSync, existsSync } from "fs";
import { getAppLogFilePath } from "@/lib/logEnv";
+import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
const LEVEL_ORDER: Record<string, number> = {
trace: 5,
@@ -45,6 +46,9 @@ function parseLevel(raw: string | number): string {
}
export async function GET(req: NextRequest) {
+ const authError = await requireManagementAuth(req);
+ if (authError) return authError;
+
try {
const { searchParams } = new URL(req.url);
const levelFilter = searchParams.get("level") || "all";
diff --git a/src/app/api/logs/export/route.ts b/src/app/api/logs/export/route.ts
index 3e25814332..2929985abc 100644
--- a/src/app/api/logs/export/route.ts
+++ b/src/app/api/logs/export/route.ts
@@ -1,5 +1,6 @@
import { getDbInstance } from "@/lib/db/core";
import { exportCallLogsSince } from "@/lib/usage/callLogs";
+import { requireManagementAuth } from "@/lib/api/requireManagementAuth";
/**
* GET /api/logs/export — export logs as JSON
@@ -7,6 +8,9 @@ import { exportCallLogsSince } from "@/lib/usage/callLogs";
* &type=call-logs|request-logs|proxy-logs (default call-logs)
*/
export async function GET(request: Request) {
+ const authError = await requireManagementAuth(request);
+ if (authError) return authError;
+
try {
const { searchParams } = new URL(request.url);
const hours = Math.min(Math.max(parseInt(searchParams.get("hours") || "24") || 24, 1), 168);