Skip to content

chore(deps): bump vulnerable frontend/backend packages - #21

Open
omerakben wants to merge 2 commits into
mainfrom
chore/security-deps-cleanup
Open

chore(deps): bump vulnerable frontend/backend packages#21
omerakben wants to merge 2 commits into
mainfrom
chore/security-deps-cleanup

Conversation

@omerakben

Copy link
Copy Markdown
Owner

Summary

Cleans up high-priority Dependabot security advisories by bumping direct dependencies and refreshing the lockfile, after several Dependabot PRs (axios #17, next #18, python-multipart #19, follow-redirects #20) stalled because of a pre-existing CI failure unrelated to the bumps themselves.

This single PR rolls every safe security update into one place so the dependency surface can be patched without waiting on the underlying CI fix.

Frontend — chatbot-frontend/package.json + package-lock.json

Direct bumps:

  • axios ^1.11.0^1.15.2 (resolves to 1.16.0). Closes 9 advisories incl. SSRF via no_proxy normalization, header-injection cloud-metadata exfiltration, ReDoS, log-injection, prototype-pollution.
  • next ^15.5.3^15.5.18. Closes image-cache key confusion, content-injection, cache poisoning, SSRF, middleware auth-bypass advisories.
  • next-auth ^5.0.0-beta.29^5.0.0-beta.30 (advisory GHSA-5jpx-9hw9-2fx4).
  • @playwright/test ^1.55.0^1.55.1 (file-write advisory GHSA-7mvr-c777-76hp).
  • @next/bundle-analyzer and eslint-config-next aligned to ^15.5.18.

Transitive bumps via npm audit fix --package-lock-only (lockfile-only, no API changes): follow-redirects, tar, flatted, picomatch, minimatch, js-yaml, brace-expansion, ajv, smol-toml, yaml.

After: npm audit reports 3 remaining moderate advisories — postcss bundled inside next's own dependency tree. Not fixable without a next major bump; out of scope here.

Backend — chatbot-backend/requirements.txt + pyproject.toml

  • python-multipart 0.0.120.0.27 (high-severity boundary-parsing DoS).
  • python-jose 3.3.03.4.0 (critical algorithm confusion + DoS).
  • gunicorn 21.2.023.0.0 (HTTP request smuggling, GHSA-w3h3-4rj7-4ph4 / GHSA-hc5x-x2vx-497g).
  • cryptography 46.0.346.0.7.
  • python-dotenv 1.0.11.2.2.

Test plan

  • Backend: pip install .[dev] clean
  • Backend: ruff check . — passes
  • Backend: black --check . — passes
  • Backend: mypy — passes
  • Backend: pytest -q — 3 passed
  • Backend: python -m build — wheel + sdist built
  • Frontend: npm ci clean, npm audit reduced from 12 → 3 moderate
  • Frontend: npm run lint — passes
  • Frontend: npm run type-check / npm run buildstill fail, but on pre-existing breakage unrelated to this PR (see below)

Known unresolved issue (pre-existing on main, not introduced here)

The frontend imports many modules under @/lib/* that do not exist in chatbot-frontend/src/:

  • @/lib/utils, @/lib/api, @/lib/constants, @/lib/validation-schemas, @/lib/uuid, @/lib/brand, @/lib/auth-utils

tsconfig.json maps @/* to ./src/* but src/lib/ does not exist. This is the root cause of every failing CI run on main and on every Dependabot PR — the Type check step fails before any other step runs. These modules appear to have been omitted from the initial commit. Restoring/recreating them is a separate task and was deliberately not attempted here to keep this PR strictly scoped to security bumps.

Once the missing src/lib/* modules are restored, this PR's CI should turn green and the open Dependabot PRs (#17, #18, #19, #20) can be closed/merged.

Resolve open Dependabot security advisories by bumping direct deps
and refreshing lockfile transitively.

Frontend (chatbot-frontend/package.json + package-lock.json):
- axios ^1.11.0 -> ^1.15.2 (resolves to 1.16.0; SSRF, header-injection,
  DoS, log-injection, ReDoS, prototype-pollution advisories)
- next ^15.5.3 -> ^15.5.18 (image-cache key confusion, content-injection,
  cache poisoning, SSRF, auth bypass advisories)
- next-auth ^5.0.0-beta.29 -> ^5.0.0-beta.30
- @next/bundle-analyzer ^15.5.3 -> ^15.5.18
- @playwright/test ^1.55.0 -> ^1.55.1 (file-write advisory)
- eslint-config-next ^15.5.3 -> ^15.5.18
- transitive bumps via npm audit fix --package-lock-only:
  follow-redirects, tar, flatted, picomatch, minimatch, js-yaml,
  brace-expansion, ajv, smol-toml, yaml

Backend (chatbot-backend/requirements.txt + pyproject.toml):
- python-multipart 0.0.12 -> 0.0.27 (DoS via boundary parsing,
  multiple high-severity advisories)
- cryptography 46.0.3 -> 46.0.7
- python-jose 3.3.0 -> 3.4.0 (algorithm confusion, DoS — critical)
- gunicorn 21.2.0 -> 23.0.0 (HTTP request smuggling)
- python-dotenv 1.0.1 -> 1.2.2

Validation:
- backend: ruff/black/mypy/pytest/python -m build all green locally
- frontend: lint passes; type-check and build still fail on
  pre-existing missing modules under @/lib/* (utils, api, constants,
  validation-schemas, uuid, brand, auth-utils) which are imported but
  not present in src/. This breakage exists on main today and is the
  reason every Dependabot PR's CI run fails. Out of scope for this PR.

3 npm-audit advisories remain (postcss bundled inside next; only
fixable via a next major upgrade — out of scope here).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 9, 2026 01:23
@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@omerakben has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 59 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 588060bf-7141-45a7-ac76-592db54e5bb9

📥 Commits

Reviewing files that changed from the base of the PR and between 20be8fe and 5c14eb4.

⛔ Files ignored due to path filters (1)
  • chatbot-frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (11)
  • .gitignore
  • chatbot-backend/pyproject.toml
  • chatbot-backend/requirements.txt
  • chatbot-frontend/package.json
  • chatbot-frontend/src/lib/api.ts
  • chatbot-frontend/src/lib/auth-utils.ts
  • chatbot-frontend/src/lib/brand.ts
  • chatbot-frontend/src/lib/constants.ts
  • chatbot-frontend/src/lib/utils.ts
  • chatbot-frontend/src/lib/uuid.ts
  • chatbot-frontend/src/lib/validation-schemas.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/security-deps-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates multiple security-related dependency upgrades across the frontend (Next.js app) and backend (FastAPI service) to address high-priority advisories and refresh lockfiles in a single change set.

Changes:

  • Frontend: bump axios/next/next-auth and align Next-related tooling; refresh package-lock.json via audit-driven updates.
  • Backend: bump multipart/JWT/crypto/runtime dependencies (e.g., python-multipart, python-jose, gunicorn, cryptography, python-dotenv) in both requirements.txt and pyproject.toml.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
chatbot-frontend/package.json Updates direct frontend dependencies/devDependencies to patched versions.
chatbot-frontend/package-lock.json Refreshes the npm lockfile with updated resolved versions and transitive security fixes.
chatbot-backend/requirements.txt Pins patched backend runtime dependency versions.
chatbot-backend/pyproject.toml Mirrors backend dependency pin updates for packaging/install workflows.
Files not reviewed (1)
  • chatbot-frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1420 to +1427
"node_modules/@playwright/test": {
"version": "1.55.0",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz",
"integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==",
"version": "1.59.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.59.1.tgz",
"integrity": "sha512-PG6q63nQg5c9rIi4/Z5lR5IVF7yU5MqmKaPOe0HSc0O2cX1fPi96sUQu5j7eo4gKCkB2AnNGoWt7y4/Xx3Kcqg==",
"devOptional": true,
"license": "Apache-2.0",
"dependencies": {
"playwright": "1.55.0"
"playwright": "1.59.1"
Comment on lines 6764 to 6771
"node_modules/next-auth": {
"version": "5.0.0-beta.29",
"resolved": "https://registry.npmjs.org/next-auth/-/next-auth-5.0.0-beta.29.tgz",
"integrity": "sha512-Ukpnuk3NMc/LiOl32njZPySk7pABEzbjhMUFd5/n10I0ZNC7NCuVv8IY2JgbDek2t/PUOifQEoUiOOTLy4os5A==",
"version": "5.0.0-beta.31",
"resolved": "https://registry.npmjs.org/next-auth/-/next-auth-5.0.0-beta.31.tgz",
"integrity": "sha512-1OBgCKPzo+S7UWWMp3xgvGvIJ0OpV7B3vR4ZDRqD9a4Ch+OT6dakLXG9ivhtmIWVa71nTSXattOHyCg8sNi8/Q==",
"license": "ISC",
"dependencies": {
"@auth/core": "0.40.0"
"@auth/core": "0.41.2"
},
Comment on lines 8302 to 8308
"node_modules/tar": {
"version": "7.4.3",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz",
"integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==",
"version": "7.5.15",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz",
"integrity": "sha512-dzGK0boVlC4W5QFuQN1EFSl3bIDYsk7Tj40U6eIBnK2k/8ml7TZ5agbI5j5+qnoVcAA+rNtBml8SEiLxZpNqRQ==",
"dev": true,
"license": "ISC",
"license": "BlueOak-1.0.0",
"dependencies": {

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request performs a comprehensive update of dependencies across both the backend and frontend components. Backend changes include version bumps for python-dotenv, python-multipart, python-jose, cryptography, and gunicorn. Frontend updates involve next, next-auth, axios, and several development tools. A review comment highlights that python-jose is deprecated and suggests migrating to a maintained library such as Authlib or PyJWT for improved security.

"structlog==25.4.0",
"python-jose[cryptography]==3.3.0",
"cryptography==46.0.3",
"python-jose[cryptography]==3.4.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The python-jose package is officially unmaintained and has been deprecated for several years. While version 3.4.0 was released as a community-driven security patch to address algorithm confusion vulnerabilities, it is strongly recommended to migrate to a modern, actively maintained library such as Authlib, PyJWT, or the Python port of jose (e.g., python-jose's successor or alternatives) for long-term security and compatibility.

The initial commit silently dropped chatbot-frontend/src/lib/ because
the root .gitignore's unanchored 'lib/' rule (intended for Python
packaging output) matched it. CI failed at typecheck because every
file importing @/lib/utils, @/lib/api, @/lib/constants,
@/lib/validation-schemas, @/lib/uuid, @/lib/brand, or @/lib/auth-utils
could not resolve its module.

- Anchor the Python ignore to /lib/ and /lib64/ so it only matches at
  the repo root.
- Add minimal implementations of the seven missing modules, matching
  the call sites and types that exist elsewhere in the frontend
  (axios-style API responses, Zod schemas for the chatbot wizard,
  shadcn cn() helper, JWT admin check, brand metadata, RFC 4122 UUID
  fallback).

Verified locally: npm run lint, type-check, and build all pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants