Skip to content

fix: Fix 14 security issues in @langchain/community, jsonpath, mailparser and 9 more - #26391

Closed
aikido-autofix[bot] wants to merge 1 commit into
1.xfrom
fix/aikido-security-update-packages-17822458-37TD
Closed

fix: Fix 14 security issues in @langchain/community, jsonpath, mailparser and 9 more#26391
aikido-autofix[bot] wants to merge 1 commit into
1.xfrom
fix/aikido-security-update-packages-17822458-37TD

Conversation

@aikido-autofix

@aikido-autofix aikido-autofix Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Upgrade dependencies to fix XSS in URL escaping, SQL injection via type-dependent escaping, ReDoS in glob patterns, XML stack overflow, and prototype pollution vulnerabilities.

✅ 14 CVEs resolved by this upgrade

This PR will resolve the following CVEs:

Issue Severity           Description
CVE-2025-61140
MEDIUM
[@langchain/community] The value function in jsonpath 1.1.1 lib/index.js is vulnerable to Prototype Pollution.
AIKIDO-2026-10127
HIGH
[@langchain/community] A cross-site scripting (XSS) vulnerability exists in plain text to HTML conversion due to improper escaping of URLs and link text in anchor tags. Attackers can inject malicious code through specially crafted URLs containing quotes or HTML content.
AIKIDO-2026-10225
HIGH
[@langchain/community] SQL injection vulnerability in parameterized queries due to inconsistent escape behavior across different parameter types, allowing attackers to inject SQL logic and bypass authentication controls.
CVE-2026-27942
HIGH
[@langchain/community] XML builder with preserveOrder:true causes stack overflow leading to denial of service. The vulnerability allows attackers to crash the application by triggering recursive processing of malformed XML structures.
CVE-2026-27903
HIGH
[@langchain/community] A ReDoS vulnerability in glob pattern matching causes unbounded recursive backtracking with multiple GLOBSTAR segments, allowing attackers to stall the event loop for tens of seconds via crafted patterns in build tools, CI/CD pipelines, or multi-tenant systems.
CVE-2026-26996
LOW
[@langchain/community] A Regular Expression Denial of Service (ReDoS) vulnerability exists when glob patterns contain many consecutive * wildcards followed by a literal character, causing exponential backtracking with O(4^N) time complexity. User-controlled glob patterns can trigger severe performance degradation or complete application hangs.
CVE-2026-27904
LOW
[@langchain/community] Nested extglobs in minimatch produce regexps with catastrophic backtracking, causing severe ReDoS denial-of-service attacks with minimal input patterns. A 12-byte pattern can stall processing for over 7 seconds, with performance degrading exponentially with additional nesting levels.
CVE-2026-25528
MEDIUM
[@langchain/community] Distributed tracing feature is vulnerable to Server-Side Request Forgery via malicious HTTP headers, allowing attackers to inject arbitrary api_url values through the baggage header and exfiltrate sensitive trace data to attacker-controlled endpoints. The SDK accepts unvalidated replica configurations from incoming headers, enabling data exfiltration when traced operations complete.
CVE-2025-13437
MEDIUM
[@langchain/community] A logic error in symlink handling causes zx to delete the target directory instead of the symlink, allowing arbitrary deletion of external node_modules folders specified via --prefer-local parameter.
AIKIDO-2026-10058
MEDIUM
[@langchain/community] Regular expression injection vulnerability allows arbitrary JavaScript code execution through crafted payloads with unescaped quotes that break out of string literals in eval contexts or inline scripts.
CVE-2026-27795
MEDIUM
[@langchain/community] RecursiveUrlLoader in LangChain allows redirect-based Server-Side Request Forgery (SSRF) by validating only the initial URL while automatically following redirects to unvalidated internal endpoints. This bypass undermines SSRF protections and enables attackers to access sensitive internal or metadata services.
CVE-2023-26115
LOW
[@langchain/community] All versions of the package word-wrap are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of an insecure regular expression within the result variable.
GHSA-gq3j-xvxp-8hrf
LOW
[@langchain/community] The basicAuth and bearerAuth middlewares used non-timing-safe string comparison for hash validation, potentially allowing timing-based analysis attacks to bypass authentication under controlled conditions.
AIKIDO-2025-10811
LOW
[@langchain/community] DOM Clobbering vulnerability in URL resolution logic allows attackers to inject malicious HTML elements that override document.currentScript and document.baseURI, potentially redirecting script imports to arbitrary URLs and enabling XSS or code execution.
🔗 Related Tasks

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant Client as External User / Attacker
    participant LC as @langchain/community
    participant Parsers as Parsers (jsonpath, fast-xml, mail)
    participant SQL as Database (mysql2)
    participant Net as Network / File System (zx)
    participant Trace as Tracing (LangSmith)

    Note over Client,Trace: Runtime security flow changes (vulnerability mitigations)

    Client->>LC: Send Request (Payload: XML, SQL params, Glob, or URLs)
    
    rect rgb(23, 37, 84)
    Note right of LC: Input Processing & Validation
    
    alt SQL Execution
        LC->>SQL: CHANGED: Execute parameterized query
        SQL->>SQL: CHANGED: Apply type-consistent escaping
        SQL-->>LC: Safe result (Mitigates SQL Injection)
    
    else Data Extraction (jsonpath)
        LC->>Parsers: CHANGED: value(path, data)
        Parsers->>Parsers: CHANGED: Block __proto__ / constructor keys
        Parsers-->>LC: Sanitized object (Mitigates Prototype Pollution)
    
    else Web Scraping (RecursiveUrlLoader)
        LC->>Net: CHANGED: Follow redirects
        Net->>Net: CHANGED: Validate redirect target against base URL
        Net-->>LC: Remote content (Mitigates SSRF/Internal Access)
    
    else Pattern Matching (minimatch/glob)
        LC->>LC: CHANGED: Evaluate glob pattern
        LC->>LC: CHANGED: Limit recursive backtracking in regex
        Note right of LC: Prevents ReDoS event-loop hang
    
    else XML Processing
        LC->>Parsers: CHANGED: Parse with preserveOrder: true
        Parsers->>Parsers: CHANGED: Apply recursion depth limits
        Parsers-->>LC: Document tree (Mitigates Stack Overflow DoS)
    end
    end

    opt Distributed Tracing
        Client->>LC: Request with 'baggage' headers
        LC->>LC: CHANGED: Validate 'api_url' in headers
        LC->>Trace: Send trace data to verified endpoint
        Note right of LC: Prevents data exfiltration (SSRF)
    end

    LC->>Client: Return Response (CHANGED: HTML URLs/links escaped for XSS)
Loading

@codecov

codecov Bot commented Mar 1, 2026

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
15471 3 15468 0
View the top 3 failed test(s) by shortest run time
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time correctly
Stack Traces | 0.025s run time
Error: expect(received).toHaveLength(expected)

Expected length: 4
Received length: 3
Received array:  [{"date": "2026-02-19T00:00:00.000Z", "values": {"averageRunTime": 15, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, {"date": "2026-02-27T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, {"date": "2026-03-01T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 4, "failureRate": 0.5714285714285714, "succeeded": 3, "timeSaved": 0, "total": 7}}]
    at Object.<anonymous> (.../insights/__tests__/insights.service.integration.test.ts:765:19)
InsightsService (Integration) getInsightsByWorkflow compacted data are grouped by workflow correctly with projectId filter
Stack Traces | 0.033s run time
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "failed": 2,
    "projectId": "SjNvnXiLpNaKBwHr",
    "projectName": "x9askefe",
    "runTime": 123,
-   "succeeded": 5,
+   "succeeded": 4,
    "timeSaved": 0,
-   "total": 7,
+   "total": 6,
    "workflowId": "ZHyua0QmK9N8ak3c",
    "workflowName": "test workflow",
  }
    at Object.<anonymous> (.../insights/__tests__/insights.service.integration.test.ts:609:31)
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time correctly with projectId filter
Stack Traces | 0.068s run time
Error: expect(received).toEqual(expected) // deep equality

Expected: ArrayContaining [ObjectContaining {"date": "2026-02-15T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 1, "failureRate": 0.5, "succeeded": 1, "timeSaved": 0, "total": 2}}, ObjectContaining {"date": "2026-02-19T00:00:00.000Z", "values": {"averageRunTime": 15, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, ObjectContaining {"date": "2026-02-27T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, ObjectContaining {"date": "2026-03-01T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 4, "failureRate": 0.5714285714285714, "succeeded": 3, "timeSaved": 0, "total": 7}}]
Received: [{"date": "2026-02-19T00:00:00.000Z", "values": {"averageRunTime": 15, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, {"date": "2026-02-27T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 0, "failureRate": 0, "succeeded": 2, "timeSaved": 0, "total": 2}}, {"date": "2026-03-01T00:00:00.000Z", "values": {"averageRunTime": 0, "failed": 4, "failureRate": 0.5714285714285714, "succeeded": 3, "timeSaved": 0, "total": 7}}]
    at Object.<anonymous> (.../insights/__tests__/insights.service.integration.test.ts:923:19)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@blacksmith-sh

blacksmith-sh Bot commented Mar 1, 2026

Copy link
Copy Markdown

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time
correctly
View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time
correctly with projectId filter
View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByWorkflow compacted data are grouped by workf
low correctly with projectId filter
View Logs

Fix in Cursor

@blacksmith-sh

blacksmith-sh Bot commented Mar 1, 2026

Copy link
Copy Markdown

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time
correctly
View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByTime compacted data are are grouped by time
correctly with projectId filter
View Logs
InsightsService (Integration)/
InsightsService (Integration) getInsightsByWorkflow compacted data are grouped by workf
low correctly with projectId filter
View Logs

Fix in Cursor

@n8n-assistant n8n-assistant Bot added community Authored by a community member in linear DEPRECATED labels Mar 2, 2026
@n8n-assistant

n8n-assistant Bot commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

Hey @aikido-autofix[bot],

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following:
• Tests are included for any new functionality, logic changes or bug fixes.
• The PR aligns with our contribution guidelines.

Regarding new nodes:
We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach.

About review timelines:
This PR has been added to our internal tracker as "GHC-7067". While we plan to review it, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Thank you again for contributing to n8n.

@aikido-autofix aikido-autofix Bot closed this Mar 8, 2026
@github-actions
github-actions Bot deleted the fix/aikido-security-update-packages-17822458-37TD branch June 15, 2026 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Authored by a community member in linear DEPRECATED

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants