-
Notifications
You must be signed in to change notification settings - Fork 6.7k
chore(deps): update dependency langchain-core to v1 [security] #13816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore(deps): update dependency langchain-core to v1 [security] #13816
Conversation
Summary of ChangesHello @renovate-bot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on a critical dependency upgrade to enhance the security posture of the project. By updating Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This PR updates langchain-core across several requirements.txt files to address a security vulnerability. My review has identified two main concerns. First, this is a major version upgrade, which carries a risk of breaking changes. This risk is amplified by the presence of multiple skipped tests in the project's test suite. It is critical to run a full, un-skipped test suite to validate this change. Second, the security fix is for a vulnerability in langchain-openai, but this package is not listed as a dependency. To fully remediate the vulnerability, langchain-openai should be explicitly added and updated if it's in use.
| google-auth==2.38.0 | ||
| anthropic[vertex]==0.28.0 | ||
| langchain-core==0.2.33 | ||
| langchain-core==1.2.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating langchain-core to a new major version (0.2.x to 1.x) introduces a significant risk of breaking changes. The project's test suite contains multiple skipped tests (e.g., in generative_ai/reasoning_engine/test_reasoning_engine_examples.py and generative_ai/model_tuning/supervised_tuning_examples_test.py), which means that potential regressions introduced by this upgrade may not be caught. It is critical to enable and run the full test suite to validate this change before merging.
| google-auth==2.38.0 | ||
| anthropic[vertex]==0.28.0 | ||
| langchain-core==0.2.33 | ||
| langchain-core==1.2.11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This update addresses CVE-2026-26013, a vulnerability in the langchain-openai package. The patch is in langchain-openai>=1.1.9, which requires langchain-core>=1.2.11. While this PR correctly updates langchain-core, the langchain-openai package is not listed as a dependency. If the project uses langchain-openai, it must be explicitly added to the requirements (e.g., langchain-openai>=1.1.9) to ensure the vulnerability is fully remediated.
This PR contains the following updates:
==0.2.33→==1.2.11GitHub Vulnerability Alerts
CVE-2026-26013
Server-Side Request Forgery (SSRF) in ChatOpenAI Image Token Counting
Summary
The
ChatOpenAI.get_num_tokens_from_messages()method fetches arbitraryimage_urlvalues without validation when computing token counts for vision-enabled models. This allows attackers to trigger Server-Side Request Forgery (SSRF) attacks by providing malicious image URLs in user input.Severity
Low - The vulnerability allows SSRF attacks but has limited impact due to:
Impact
An attacker who can control image URLs passed to
get_num_tokens_from_messages()can:Note: This vulnerability occurs during token counting, which may happen outside of model invocation (e.g., in logging, metrics, or token budgeting flows).
Details
The vulnerable code path:
get_num_tokens_from_messages()processes messages containingimage_urlcontent blocksdetail: "low", it calls_url_to_size()to fetch the image and compute token counts_url_to_size()performshttpx.get(image_source)on any URL without validationFile:
libs/partners/openai/langchain_openai/chat_models/base.pyPatches
The vulnerability has been patched in
langchain-openai==1.1.9(requireslangchain-core==1.2.11).The patch adds:
langchain_core._security._ssrf_protection.validate_safe_url()to block:httpx.getdefault)allow_fetching_images=FalseparameterWorkarounds
If you cannot upgrade immediately:
image_urlvalues before passing messages to token counting or model invocationConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Never, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.