FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore(deps): update dependency langchain-openai to v1.1.14 [security] by renovate[bot] · Pull Request #69 · koki-develop/git-aicommit · GitHub

This repository was archived by the owner on Apr 19, 2026. It is now read-only.
/ git-aicommit Public archive

chore(deps): update dependency langchain-openai to v1.1.14 [security] - #69

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-langchain-openai-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/pypi-langchain-openai-vulnerability

Conversation

renovate Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
langchain-openai (changelog) 1.0.3 → 1.1.14

GitHub Vulnerability Alerts

GHSA-r7w7-9xr2-qq2r

Summary

langchain-openai's _url_to_size() helper (used by get_num_tokens_from_messages for image token counting) validated URLs for SSRF protection and then fetched them in a separate network operation with independent DNS resolution. This left a TOCTOU / DNS rebinding window: an attacker-controlled hostname could resolve to a public IP during validation and then to a private/localhost IP during the actual fetch.

The practical impact is limited because the fetched response body is passed directly to Pillow's Image.open() to extract dimensions — the response content is never returned, logged, or otherwise exposed to the caller. An attacker cannot exfiltrate data from internal services through this path. A potential risk is blind probing (inferring whether an internal host/port is open based on timing or error behavior).

Affected versions

  • langchain-openai < 1.1.14

Patched versions

  • langchain-openai >= 1.1.14 (requires langchain-core >= 1.2.31)

Affected code

File: libs/partners/openai/langchain_openai/chat_models/base.py — _url_to_size()

The vulnerable pattern was a validate-then-fetch with separate DNS resolution:

validate_safe_url(image_source, allow_private=False, allow_http=True)

# ... separate network operation with independent DNS resolution ...
response = httpx.get(image_source, timeout=timeout)

Fix

The fix replaces the validate-then-fetch pattern with an SSRF-safe httpx transport (SSRFSafeSyncTransport from langchain-core) that:

  • Resolves DNS once and validates all returned IPs against a policy (private ranges, cloud metadata, localhost, k8s internal DNS)
  • Pins the connection to the validated IP, eliminating the DNS rebinding window
  • Disables redirect following to prevent redirect-based SSRF bypasses

This fix was released in langchain-openai 1.1.14.

Severity
  • CVSS Score: 3.1 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:N

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Copy link
Copy Markdown
Contributor

Renovate PR Review Results

⚖️ Safety Assessment: ✅ Safe

🔍 Release Content Analysis

This PR updates langchain-openai from version 1.0.3 to 1.1.14, which includes a critical security patch for an SSRF (Server-Side Request Forgery) vulnerability.

Security Fix (GHSA-r7w7-9xr2-qq2r):

  • Vulnerability: TOCTOU/DNS rebinding weakness in _url_to_size() helper function used for image token counting
  • Attack Vector: An attacker-controlled hostname could resolve to a public IP during validation and then to a private/localhost IP during the actual fetch
  • Severity: Low (CVSS 3.1 score: 3.1/10)
  • Practical Impact: Limited - response content is only passed to Pillow for dimension extraction and never exposed to callers; potential risk limited to blind probing of internal hosts
  • Fix: Implemented SSRF-safe httpx transport that resolves DNS once, validates all IPs, pins connections to validated IPs, and disables redirects

Additional Updates:

  • Dependency updates: langchain-core updated from 1.2.7 to 1.2.31 (required for SSRF-safe transport)
  • Dependency updates: openai package updated from 2.8.1 to 2.32.0
  • Bug fixes for content block handling and User-Agent headers
  • Enhanced token extraction for usage metadata
  • Refreshed model profile data

Breaking Changes:

  • No breaking changes identified between v1.0.3 and v1.1.14
  • All changes maintain backward compatibility with existing APIs

🎯 Impact Scope Investigation

Direct Usage Analysis:

  • langchain-openai is used exclusively in src/git_aicommit/provider.py:8 via the ChatOpenAI import
  • Usage pattern: Standard initialization with model, api_key, and temperature parameters (provider.py:119-123)
  • The codebase uses only basic text-based chat completion functionality through LangChain's BaseChatModel interface
  • No image processing or token counting features are used - the vulnerable _url_to_size() function is not invoked by this codebase

Dependency Chain Impact:

  • langchain-core upgraded from 1.2.7 → 1.2.31 (required for SSRF-safe transport)
  • openai upgraded from 2.8.1 → 2.32.0 (transitive dependency)
  • Current minimum constraint (langchain-core>=1.0.5) is satisfied by the new version
  • No conflicts with other LangChain provider packages (anthropic, aws, google-genai, ollama)

Configuration Impact:

  • No changes required to configuration files (aicommit.yml)
  • OpenAI provider configuration schema remains unchanged (model, api-key, temperature)
  • No changes to CLI interface or user-facing behavior

Code Compatibility:

  • The ChatOpenAI initialization pattern used in this codebase remains fully compatible
  • Structured output via with_structured_output(Commit) continues to work as expected
  • No changes to the BaseChatModel interface that would affect the abstraction layer

💡 Recommended Actions

Immediate Actions:

  1. Merge this PR immediately - This is a security patch with no breaking changes
  2. No code modifications required - The update is fully backward compatible
  3. No configuration changes needed - Existing OpenAI configurations will continue to work

Verification Steps:

  1. After merging, verify the package builds successfully: uv build
  2. Run linting to ensure no issues: uv run ruff check
  3. Test basic functionality with OpenAI provider (if configured): uv run git-aicommit

Why This Is Safe:

  • The vulnerability affects image token counting functionality that this codebase does not use
  • All API interfaces remain backward compatible
  • Only security improvements and bug fixes included
  • Dependency constraints are satisfied (langchain-core minimum version met)
  • No breaking changes in the entire version jump (1.0.3 → 1.1.14)

🔗 Reference Links

Generated by koki-develop/claude-renovate-review

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants


Back | FazBrowse Home | New Git URL