Skip to main content

Security Audit Report - November 11, 2025

Executive Summary

Security audit performed on stock screening platform dependencies to identify and resolve known vulnerabilities.

Audit Date: 2025-11-11 Audit Scope: Frontend (Node.js/npm) and Backend (Python) dependencies Total Vulnerabilities Found: 24 (6 frontend, 18 backend) Total Vulnerabilities Fixed: 23 (6 frontend, 17 backend) Status: ✅ Complete

Audit Status

All critical and high severity vulnerabilities have been resolved. One moderate severity issue remains (ecdsa timing attack) with no fix available.


Frontend Dependencies (Node.js/npm)

Audit Results

$ npm audit

Summary:

  • Total: 6 moderate severity vulnerabilities
  • Critical: 0
  • High: 0
  • Moderate: 6
  • Low: 0

Vulnerabilities Detail

1. esbuild <=0.24.2 (GHSA-67mh-4wv8-2f99)

  • Severity: Moderate
  • Package: esbuild
  • Current Version: 0.21.5 (transitive dependency via vite)
  • Vulnerable Range: <=0.24.2
  • CVE: GHSA-67mh-4wv8-2f99
  • Description: esbuild enables any website to send any requests to the development server and read the response
  • Impact: Development environment only
  • Fix: Update vite to 7.2.2+ (which includes esbuild >0.24.2)
Development Only

This vulnerability only affects the development environment and does not impact production builds.

2-6. Transitive Dependencies (vite, vite-node, vitest, @vitest/coverage-v8, @vitest/ui)

  • Severity: Moderate (all depend on vulnerable esbuild)
  • Current Versions:
    • vite: 5.4.21
    • vitest: 1.6.1
    • @vitest/coverage-v8: 1.6.1
    • @vitest/ui: 1.6.1
  • Latest Versions:
    • vite: 7.2.2
    • vitest: 4.0.8
    • @vitest/coverage-v8: 4.0.8
    • @vitest/ui: 4.0.8
  • Fix: Major version upgrade (breaking changes expected)

Dependency Tree

vite@5.4.21
└── esbuild@0.21.5 (VULNERABLE)

vitest@1.6.1
├── vite-node@1.6.1
│ └── vite@5.4.21
│ └── esbuild@0.21.5 (VULNERABLE)
└── vite@5.4.21 (deduped)

@vitest/coverage-v8@1.6.1
└── vitest@1.6.1 (depends on vulnerable vite)

@vitest/ui@1.6.1
└── vitest@1.6.1 (depends on vulnerable vite)

Backend Dependencies (Python)

Audit Status

Tool: safety / pip-audit Status: Unable to run automated scan (PATH issues in Docker container) Manual Review: Pending

Known Package Versions

fastapi==0.104.1
uvicorn==0.24.0
sqlalchemy==2.0.23
asyncpg==0.29.0
alembic==1.12.1
aiohttp==3.9.1
python-jose==3.3.0
bcrypt==4.1.2
celery==5.4.0
pandas==2.1.3
numpy==1.26.2
httpx==0.25.2
sentry-sdk==1.38.0
pytest==7.4.3
Automated Scanning

Automated Python security scanning has been configured in the CI/CD pipeline to prevent future vulnerabilities.


Remediation Plan

Phase 1: Frontend Security Updates (IMMEDIATE)

Step 1.1: Update Build Tools

npm install vite@latest @vitejs/plugin-react@latest
npm install -D vitest@latest @vitest/coverage-v8@latest @vitest/ui@latest

Step 1.2: Verify Build

npm run build
npm run test

Step 1.3: Test Application

  • Verify development server starts
  • Verify production build succeeds
  • Verify all unit tests pass
  • Verify UI functionality intact

Expected Breaking Changes

  1. Vite 5→7:
    • Config API changes
    • Plugin compatibility
    • Build output structure
  2. Vitest 1→4:
    • Test configuration updates
    • Coverage reporter changes
    • Assertions API changes
Breaking Changes

Major version upgrades may introduce breaking changes. Always test thoroughly before deploying.

Phase 2: Backend Security Setup (NEXT)

Step 2.1: Add Python Security Scanner

# Add to backend/Dockerfile
RUN pip install safety pip-audit

Step 2.2: Run Security Audit

docker exec screener_backend pip-audit
docker exec screener_backend safety check

Step 2.3: Update Vulnerable Packages

  • Review audit results
  • Update packages to safe versions
  • Test application functionality

Phase 3: Automated Security Scanning (ONGOING)

Step 3.1: Enable Dependabot

Create .github/dependabot.yml:

version: 2
updates:
- package-ecosystem: "npm"
directory: "/frontend"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

- package-ecosystem: "pip"
directory: "/backend"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
Dependabot

Dependabot automatically creates PRs for dependency updates, making it easy to keep dependencies secure and up-to-date.

Step 3.2: Add Security Scanning to CI/CD

Update .github/workflows/security.yml:

name: Security Scan

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: '0 0 * * 0' # Weekly on Sunday

jobs:
npm-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: npm audit
run: |
cd frontend
npm audit --audit-level=moderate

python-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install security tools
run: |
pip install safety pip-audit
- name: Run pip-audit
run: |
cd backend
pip-audit -r requirements.txt

Risk Assessment

Current Risk Level: MODERATE

Factors:

  1. Production Impact: NONE (esbuild vulnerability only affects dev environment)
  2. ⚠️ Developer Risk: MODERATE (potential for dev machine compromise)
  3. ⚠️ CI/CD Risk: MODERATE (build servers could be targeted)
  4. Data Risk: NONE (no data-layer vulnerabilities found)

Deployment Recommendation

Current State: ✅ SAFE TO DEPLOY

  • Production builds do not include esbuild or development server
  • Vulnerabilities are dev-dependency only
  • No runtime security issues detected

Post-Update State: ⚡ IMPROVED SECURITY POSTURE

  • All known vulnerabilities resolved
  • Automated scanning prevents future issues
  • Reduced attack surface
Production Safety

The identified vulnerabilities do not affect production deployments. However, updating dependencies improves overall security posture.


Timeline

PhaseTaskEstimated TimeStatus
1.1Frontend dependency updates30 min✅ Complete
1.2Frontend testing30 min✅ Complete
1.3Frontend verification15 min✅ Complete
2.1Backend security scanner setup15 min✅ Complete
2.2Backend security audit15 min✅ Complete
2.3Backend updates1 hour✅ Complete
3.1Dependabot configuration15 min✅ Complete
3.2CI/CD security workflow30 min✅ Complete
TotalEnd-to-end security hardening3 hours100%

References


Final Results Summary

Frontend Updates ✅

PackageOld VersionNew VersionVulnerabilities Fixed
vite5.4.217.2.26 (transitive via esbuild)
vitest1.6.14.0.8(dependency of vite)
@vitest/coverage-v81.6.14.0.8(dependency of vite)
@vitest/ui1.6.14.0.8(dependency of vite)
esbuild0.21.50.25.12GHSA-67mh-4wv8-2f99

Test Results: ✅ 139 tests passed, build successful

Backend Updates ✅

PackageOld VersionNew VersionVulnerabilities Fixed
aiohttp3.9.13.11.146 CVEs (directory traversal, XSS, DoS, request smuggling)
fastapi0.104.10.115.6PYSEC-2024-38 (ReDoS)
gunicorn21.2.022.0.02 (request smuggling)
python-jose3.3.03.4.02 (algorithm confusion, JWT bomb)
python-multipart0.0.60.0.202 (ReDoS)
sentry-sdk1.38.02.22.0GHSA-g92j-qhmh-64v2 (env exposure)
black23.12.024.10.0PYSEC-2024-48 (ReDoS)
starlette0.27.00.41.32 (DoS via form data)

Test Results: ✅ 258 tests passed, 77% coverage maintained

Automation Configured ✅

  1. Dependabot (.github/dependabot.yml):

    • Weekly npm dependency updates (frontend)
    • Weekly pip dependency updates (backend, data pipeline)
    • Monthly GitHub Actions updates
    • Monthly Docker base image updates
    • Auto-grouping of minor/patch updates
    • Automatic PR creation with security labels
  2. Security Scanning (.github/workflows/security.yml):

    • Runs on every push to main/develop
    • Runs on every pull request
    • Weekly scheduled scans (Mondays 9:00 AM KST)
    • Manual trigger available
    • Scans frontend (npm audit)
    • Scans backend (pip-audit)
    • Scans data pipeline (pip-audit)
    • Secret scanning with Gitleaks
    • Fails CI if high/critical vulnerabilities found
    • Generates security summary in GitHub Actions
Continuous Security

Automated security scanning ensures vulnerabilities are detected and addressed quickly, maintaining a strong security posture.

Known Issues Remaining

ecdsa 0.19.1 - Minerva Timing Attack:

  • Severity: Moderate
  • Status: No fix available (maintainers consider out of scope)
  • Risk: LOW-MODERATE (side-channel attack requires precise timing)
  • Mitigation: Documented in SECURITY_NOTES.md
  • Action: Monitor for python-jose updates that might switch crypto library
Known Issue

One moderate severity issue remains with no fix available. The risk is low and has been documented for monitoring.


Report Generated: 2025-11-11 Completion Date: 2025-11-11 Next Review: 2026-02-11 (quarterly or when Dependabot alerts trigger) Auditor: Development Team Status: ✅ All Critical and High Vulnerabilities Resolved