Skip to content

Fix Dependabot and code scanning security alerts#352

Merged
kovtcharov merged 7 commits intomainfrom
fix/security-alerts-2026-02
Feb 27, 2026
Merged

Fix Dependabot and code scanning security alerts#352
kovtcharov merged 7 commits intomainfrom
fix/security-alerts-2026-02

Conversation

@kovtcharov
Copy link
Copy Markdown
Collaborator

Summary

  • Fix all open Dependabot alerts: update tar (>=7.5.8), qs (6.14.2), and lodash (4.17.23) across all package-lock.json files
  • Fix all open code scanning alerts across Python and JavaScript files
  • Add missing GitHub Actions workflow permissions to pypi.yml and docs.yml

Changes

Dependabot (15 alerts)

  • tar (high): Add npm overrides to force tar>=7.5.8, fixing path traversal and symlink vulnerabilities across root, example/webui, and jira/webui workspaces
  • qs (low): Update to 6.14.2 fixing arrayLimit bypass DoS in root, docs, eval/webapp, and vscode extension
  • lodash (medium): Update to 4.17.23 fixing prototype pollution in all workspaces

Code Scanning (22 alerts)

Alert File Fix
Missing workflow permissions pypi.yml, docs.yml Added permissions: contents: read to jobs
Stack trace exposure (6) emr/dashboard/server.py Replaced str(e) in HTTP responses with generic messages
Path injection (4) emr/dashboard/server.py Added path traversal validation and system directory checks
Clear-text logging (4) emr/dashboard/server.py, emr/agent.py Removed patient IDs from log messages
Path injection (3) utils/file_watcher.py Added .. traversal check in compute_file_hash
Path injection (1) eval/webapp/server.js Added safePath() validation to all file-serving routes
URL redirect (1) docs/server.js Use explicit HTTP 303 redirect status
Missing rate limiting (1) docs/server.js Added express-rate-limit to login endpoint

Test plan

  • Verify gaia chat works correctly
  • Verify EMR dashboard starts and processes forms
  • Verify eval webapp loads experiment data
  • Verify docs proxy starts correctly
  • Run npm audit in each workspace to confirm 0 vulnerabilities for tar/qs/lodash

🤖 Generated with Claude Code

Dependabot fixes:
- Update tar to >=7.5.8 via npm overrides (CVE path traversal/symlink)
- Update qs to 6.14.2 (arrayLimit bypass DoS)
- Update lodash to 4.17.23 (prototype pollution)
- Regenerate package-lock.json files across all workspaces

Code scanning fixes:
- Add explicit permissions blocks to pypi.yml and docs.yml workflows
- Add rate limiting to docs proxy login endpoint
- Fix URL redirect to use explicit 303 status code
- Add path traversal protection (safePath) to eval webapp server
- Add path validation to file_watcher.py compute_file_hash
- Remove stack trace exposure from EMR dashboard error responses
- Remove sensitive patient data from EMR log messages
- Add path injection protection to EMR upload-path endpoint
- Add system directory validation to EMR watch-dir config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Documentation changes dependencies Dependency updates devops DevOps/infrastructure changes agents jira Jira agent changes eval Evaluation framework changes performance Performance-critical changes labels Feb 25, 2026
Comment thread src/gaia/agents/emr/dashboard/server.py Fixed
Comment thread src/gaia/utils/file_watcher.py Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread docs/server.js Fixed
kovtcharov and others added 2 commits February 25, 2026 15:12
- Add tar>=7.5.8 overrides to example/webui and jira/webui package.json
- Regenerate package-lock.json for both workspace packages
- Fixes npm ci failures in CI where lock files were out of sync

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Inline path validation in eval/webapp/server.js so CodeQL can trace
  data flow through resolve() + startsWith() checks
- Add rate limiting middleware to eval webapp API endpoints
- Restructure file_watcher.py to validate path before resolve()
- Restructure EMR upload-path to validate extension before file ops
- Inline URL redirect validation in docs/server.js login handler

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread src/gaia/agents/emr/dashboard/server.py Fixed
Comment thread src/gaia/agents/emr/dashboard/server.py Fixed
Comment thread src/gaia/utils/file_watcher.py Fixed
Comment thread src/gaia/utils/file_watcher.py Fixed
Comment thread src/gaia/utils/file_watcher.py Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread docs/server.js Fixed
- file_watcher.py: Use os.path.realpath() + startswith() for path
  validation with new allowed_dir parameter (py/path-injection)
- emr/dashboard/server.py: Validate upload paths against user home
  directory using os.path.realpath() + startswith() (py/path-injection)
- eval/webapp/server.js: Replace custom rate limiter with express-rate-limit,
  inline path validation in each route handler (js/path-injection,
  js/missing-rate-limiting)
- docs/server.js: Use server-side nonce map for redirect URLs to eliminate
  user-controlled data from res.redirect() (js/server-side-unvalidated-url-redirection)
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread src/gaia/eval/webapp/server.js Fixed
Comment thread docs/server.js Fixed
- eval/webapp/server.js: Use path.basename() (CodeQL-recognized sanitizer)
  for filename params, includes('..') check for subdirectory params
- docs/server.js: Use if/else guard with startsWith('/') check on redirect
  target instead of ternary expression
Comment thread docs/server.js Fixed
Replace startsWith guard with url.parse() + host/protocol check,
which is explicitly recognized by CodeQL as a URL redirect sanitizer.
Comment thread docs/server.js
const parsed = url.parse(target || '');
// Only redirect to relative paths (no host/protocol) to prevent open redirects
if (!parsed.host && !parsed.protocol && parsed.pathname) {
res.redirect(303, parsed.pathname);

Check warning

Code scanning / CodeQL

Server-side URL redirect Medium documentation

Untrusted URL redirection depends on a
user-provided value
.
Untrusted URL redirection depends on a
user-provided value
.
@kovtcharov kovtcharov added this pull request to the merge queue Feb 27, 2026
Merged via the queue into main with commit fdaa0cb Feb 27, 2026
52 checks passed
@kovtcharov kovtcharov deleted the fix/security-alerts-2026-02 branch February 27, 2026 21:45
itomek pushed a commit that referenced this pull request Mar 12, 2026
## Summary

- Fix all open Dependabot alerts: update `tar` (>=7.5.8), `qs` (6.14.2),
and `lodash` (4.17.23) across all package-lock.json files
- Fix all open code scanning alerts across Python and JavaScript files
- Add missing GitHub Actions workflow permissions to `pypi.yml` and
`docs.yml`

## Changes

### Dependabot (15 alerts)
- **tar** (high): Add npm overrides to force `tar>=7.5.8`, fixing path
traversal and symlink vulnerabilities across root, example/webui, and
jira/webui workspaces
- **qs** (low): Update to 6.14.2 fixing arrayLimit bypass DoS in root,
docs, eval/webapp, and vscode extension
- **lodash** (medium): Update to 4.17.23 fixing prototype pollution in
all workspaces

### Code Scanning (22 alerts)

| Alert | File | Fix |
|-------|------|-----|
| Missing workflow permissions | `pypi.yml`, `docs.yml` | Added
`permissions: contents: read` to jobs |
| Stack trace exposure (6) | `emr/dashboard/server.py` | Replaced
`str(e)` in HTTP responses with generic messages |
| Path injection (4) | `emr/dashboard/server.py` | Added path traversal
validation and system directory checks |
| Clear-text logging (4) | `emr/dashboard/server.py`, `emr/agent.py` |
Removed patient IDs from log messages |
| Path injection (3) | `utils/file_watcher.py` | Added `..` traversal
check in `compute_file_hash` |
| Path injection (1) | `eval/webapp/server.js` | Added `safePath()`
validation to all file-serving routes |
| URL redirect (1) | `docs/server.js` | Use explicit HTTP 303 redirect
status |
| Missing rate limiting (1) | `docs/server.js` | Added
`express-rate-limit` to login endpoint |

## Test plan
- [ ] Verify `gaia chat` works correctly
- [ ] Verify EMR dashboard starts and processes forms
- [ ] Verify eval webapp loads experiment data
- [ ] Verify docs proxy starts correctly
- [ ] Run `npm audit` in each workspace to confirm 0 vulnerabilities for
tar/qs/lodash

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency updates devops DevOps/infrastructure changes documentation Documentation changes eval Evaluation framework changes jira Jira agent changes performance Performance-critical changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants