fix(ci): guardrail decorator, security CVEs, UI tests, proxy test

- Add @log_guardrail_information decorator to CrowdStrike AIDR handler
- Add DOMPurify (CVE-2026-0540) and SVGO (CVE-2026-29074) to .trivyignore
  and package.json overrides for docs
- Fix navbar test: mock serverRootPath export
- Fix KeyLifecycleSettings test: update placeholder and tooltip assertions
  to match current component text
- Improve proxy file upload test error message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Harshit28j 2026-03-07 01:21:52 +05:30
parent cc8140eeb6
commit d8b7236864
6 changed files with 26 additions and 11 deletions

View file

@ -10,3 +10,11 @@ GHSA-h25m-26qc-wcjf
# MEDIUM: Image Optimizer DoS
CVE-2025-59471
# DOMPurify XSS (transitive dep of @docusaurus/theme-mermaid)
# Fix: override dompurify>=3.3.2 in docs/my-website/package.json
CVE-2026-0540
# SVGO Billion Laughs DoS (transitive dep of @docusaurus/core)
# Fix: override svgo>=3.3.3 in docs/my-website/package.json
CVE-2026-29074

View file

@ -53,7 +53,9 @@
"form-data": ">=4.0.4",
"mermaid": ">=11.10.0",
"gray-matter": "4.0.3",
"node-forge": ">=1.3.2"
"node-forge": ">=1.3.2",
"dompurify": ">=3.3.2",
"svgo": ">=3.3.3"
},
"overrides": {
"webpack-dev-server": ">=5.2.1",
@ -93,6 +95,9 @@
"axios": ">=0.30.2",
"webpack": ">=5.94.0",
"serve-static": ">=1.16.0",
"path-to-regexp": ">=0.1.12"
}
"path-to-regexp": ">=0.1.12",
"dompurify": ">=3.3.2",
"svgo": ">=3.3.3"
},
"resolutions_note": "dompurify and svgo overrides fix CVE-2026-0540 and CVE-2026-29074"
}

View file

@ -5,7 +5,7 @@ from typing_extensions import Any, override
from fastapi import HTTPException
from litellm._logging import verbose_proxy_logger
from litellm.integrations.custom_guardrail import CustomGuardrail
from litellm.integrations.custom_guardrail import CustomGuardrail, log_guardrail_information
from litellm.llms.custom_httpx.http_handler import (
get_async_httpx_client,
httpxSpecialProvider,
@ -272,6 +272,7 @@ class CrowdStrikeAIDRHandler(CustomGuardrail):
transformed_texts.append(texts[len(transformed_texts)])
return transformed_texts[: len(texts)]
@log_guardrail_information
@override
async def apply_guardrail(
self,

View file

@ -1157,10 +1157,10 @@ def test_create_file_with_deep_nested_litellm_metadata(
)
# Verify success
assert response.status_code == 200
assert response.status_code == 200, f"Expected 200, got {response.status_code}. Response: {response.text}"
result = response.json()
assert result["id"] == "file-test-456"
# Verify deeply nested metadata was correctly parsed
assert "config" in captured_litellm_metadata
assert "database" in captured_litellm_metadata["config"]

View file

@ -113,7 +113,7 @@ describe("KeyLifecycleSettings", () => {
renderWithProviders(<KeyLifecycleSettings {...defaultProps} isCreateMode={false} />);
const input = screen.getByTestId("duration-input");
expect(input).toHaveAttribute("placeholder", "e.g., 30d or -1 to never expire");
expect(input).toHaveAttribute("placeholder", "e.g., 30d");
});
it("should show correct tooltip in create mode", () => {
@ -121,12 +121,12 @@ describe("KeyLifecycleSettings", () => {
const tooltips = screen.getAllByTestId("tooltip");
const expiryTooltip = tooltips.find((tooltip) =>
tooltip.getAttribute("title")?.includes("Leave empty to never expire")
tooltip.getAttribute("title")?.includes("Leave empty to keep the current expiry unchanged")
);
expect(expiryTooltip).toBeInTheDocument();
expect(expiryTooltip).toHaveAttribute(
"title",
"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to never expire."
"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged."
);
});
@ -135,12 +135,12 @@ describe("KeyLifecycleSettings", () => {
const tooltips = screen.getAllByTestId("tooltip");
const expiryTooltip = tooltips.find((tooltip) =>
tooltip.getAttribute("title")?.includes("Use -1 to never expire")
tooltip.getAttribute("title")?.includes("Leave empty to keep the current expiry unchanged")
);
expect(expiryTooltip).toBeInTheDocument();
expect(expiryTooltip).toHaveAttribute(
"title",
"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Use -1 to never expire."
"Set when this key should expire. Format: 30s (seconds), 30m (minutes), 30h (hours), 30d (days). Leave empty to keep the current expiry unchanged."
);
});

View file

@ -6,6 +6,7 @@ import Navbar from "./navbar";
// Mock the hooks and utilities
vi.mock("@/components/networking", () => ({
getProxyBaseUrl: vi.fn(() => "http://localhost:4000"),
serverRootPath: "/",
}));
vi.mock("@/utils/proxyUtils", () => ({