🧭 fix: Harden User Provided Endpoint URL Protection#13919
Conversation
|
@codex review |
1d26c86 to
553d67b
Compare
|
@codex review |
553d67b to
5ad3f3d
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ad3f3d036
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
5ad3f3d to
d7b3f86
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
LibreChat/packages/api/src/endpoints/openai/initialize.ts
Lines 67 to 68 in d7b3f86
When AZURE_OPENAI_BASEURL is user_provided but the selected Azure model maps to a YAML group with its own baseURL, this validates the stored user URL before mapModelToAzureConfig later replaces reverseProxyUrl with the admin-configured configBaseURL and marks it not user-provided. A stale or blocked user URL can therefore reject an otherwise valid Azure serverless/group request even though that URL is not used; defer validation until after the final URL is chosen and only validate it if it remains user-provided.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d7b3f86 to
4382cda
Compare
|
@codex review |
|
Addressed the Codex review note “Validate only the Azure URL that will be used” in I deferred OpenAI/Azure URL validation until after Azure model-group mapping chooses the final Coverage added in |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
4382cda to
c567ab4
Compare
Summary
I hardened user-provided custom/OpenAI-compatible provider URLs against SSRF and DNS-rebinding paths affecting model fetches, token-config fetches, model-list loading, and chat requests.
allowedAddressesexemptions./api/tagsand OpenAI-compatible/models, and disable redirects on user-provided provider requests.Change Type
Testing
npx jest --runTestsByPath src/endpoints/models.spec.ts src/endpoints/openai/config.spec.ts src/endpoints/custom/initialize.spec.ts src/endpoints/openai/initialize.spec.ts src/endpoints/config/models.spec.ts src/auth/agent.spec.ts --runInBand --coverage=false --watch=false.npm --prefix packages/api run build.Test Configuration:
packages/data-providerandpackages/data-schemaslocally before tests so workspace package imports resolved todist.Checklist