LibreChat/api/server/utils
Danny Avila 630cb59e3b 🛡️ fix: Optionally Block Private IPs On User-Provided baseURL
When an admin configures a custom endpoint with `baseURL: 'user_provided'`,
each end user supplies their own base URL via the UI. Without
validation, a user can point that URL at internal services (cloud
metadata endpoints, intranet APIs, etc.), causing the backend to issue
requests to those addresses on every model-listing fetch.

Add `interface.blockPrivateUserBaseURL` (default `false` to preserve
current behavior). When enabled, the `/api/keys` PUT handler parses
the encrypted user-key payload and rejects values whose `baseURL`
fails an http(s) protocol check or resolves to a private, loopback,
or link-local IP. Operators running self-hosted LLMs on private IPs
can leave the flag off; multi-tenant deployments should turn it on.

This is save-time validation; runtime fetch sites should additionally
adopt SSRF-safe agents (defense in depth).
2026-05-03 13:51:13 -04:00
..
__tests__ 📡 feat: Support Unauthenticated SMTP Relays (#12322) 2026-03-20 13:07:39 -04:00
emails 🔒 fix: href Attribute in Email Microsoft Template 2025-09-08 14:39:00 -04:00
import 📥 fix: Resolve Imported-Conversation Default Model From Runtime modelsConfig (#12885) 2026-04-30 00:43:04 -04:00
files.js 📚 feat: Add Source Citations for File Search in Agents (#8652) 2025-08-13 16:24:16 -04:00
getFileStrategy.js 📜 feat: Skills UI + Initial E2E CRUD / Sharing (#12580) 2026-04-25 04:02:00 -04:00
handleText.js 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
index.js 🚦 fix: ERR_ERL_INVALID_IP_ADDRESS and IPv6 Key Collisions in IP Rate Limiters (#12319) 2026-03-19 21:48:03 -04:00
queue.js 🧹 chore: Cleanup Logger and Utility Imports (#9935) 2025-10-01 23:30:47 -04:00
sendEmail.js 📡 feat: Support Unauthenticated SMTP Relays (#12322) 2026-03-20 13:07:39 -04:00
staticCache.js 🗂️ fix: Disable express-static-gzip for Uploaded Images (#8307) 2025-07-11 16:51:53 -04:00
validateBaseURL.js 🛡️ fix: Optionally Block Private IPs On User-Provided baseURL 2026-05-03 13:51:13 -04:00