From 076d6df5ba212ab31ed8918fc3be52ad98ad3479 Mon Sep 17 00:00:00 2001 From: Rohan5commit Date: Sun, 30 Aug 2026 12:06:17 +0530 Subject: [PATCH 1/2] fix(security): add missing import base64 and fix CORS origin in api/roast.py 1. Missing import base64 - base64url_encode/decode use the base64 module but never imported it, causing NameError at runtime. 2. Stale CORS origin - ALLOWED_ORIGINS referenced old Vercel URL instead of current production URL, rejecting all cross-origin requests. Also covers CVE-2026-64645 (SSRF in rewrites) which is patched by next@16.3.3. App rewrite is internal only with no attacker-controlled hostname. --- web/api/roast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/api/roast.py b/web/api/roast.py index ba3b1c9..ce8b6e0 100644 --- a/web/api/roast.py +++ b/web/api/roast.py @@ -1,3 +1,4 @@ +import base64 import json import os import re @@ -589,7 +590,7 @@ def download_github_archive(owner: str, repo: str, ref: str, dest: str) -> str: # ============================================================ ALLOWED_ORIGINS = { - "https://roast-web-six.vercel.app", + "https://roast-my-code-five.vercel.app", "http://localhost:3000", "http://127.0.0.1:3000", } From f009b542cfea2612b42d11c1feb9ba1786474fc9 Mon Sep 17 00:00:00 2001 From: Rohan5commit Date: Sun, 30 Aug 2026 12:10:50 +0530 Subject: [PATCH 2/2] fix(security): pin jinja2>=3.1.5 to prevent CVE-2024-56326 Pins minimum jinja2 version to 3.1.5 in both pyproject.toml and web/requirements.txt. The installed version (3.1.6) is already patched, but unpinned dependencies could allow a vulnerable version on fresh install. CVE-2024-56326: Jinja sandbox breakout through indirect reference to format method. Patched in 3.1.5. Tests: 25/25 passing Web build: OK --- pyproject.toml | 2 +- web/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c5c792b..792df3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "typer[all]", "rich", "openai", - "jinja2", + "jinja2>=3.1.5", "pyyaml", ] diff --git a/web/requirements.txt b/web/requirements.txt index b212575..0cd337e 100644 --- a/web/requirements.txt +++ b/web/requirements.txt @@ -1,5 +1,5 @@ typer[all] rich openai -jinja2 +jinja2>=3.1.5 pyyaml