Repository navigation
Chore: address security audit findings and improve system stability - #11
Conversation
This branch resolves reliability, type-safety, dependency-security, and documentation issues across the codebase. - Strictly enforce periodId ownership validation during R2 uploads to prevent cross-tenant access - Resolve the bill recalculation race condition by passing pre-validated snapshot values through the calculation chain - Explicitly configure Hono secureHeaders options in app.ts for predictable security headers - Add DOM to the tsconfig.json lib array to avoid relying on transitively included globals - Update AGENTS.md with accurate Husky pre-push commands and dependency security remediation guidance - Upgrade hono to v4.13.1 and pdfjs-dist to v6.2.108 to address known vulnerabilities - Add pnpm.overrides for undici (>=7.29.0), js-yaml (^4.3.1), and nanoid (>=3.3.17) to resolve transitive vulnerabilities - Remove 25 stale GHSA entries from ignoreGhsas in package.json - Document five unfixable transitive vulnerabilities and their rationale in AGENTS.md
📝 WalkthroughWalkthroughThe PR updates dependency audit guidance and package overrides, adds API security headers, validates upload period-property relationships, and preserves recalculation inputs through snapshots. ChangesApplication and tooling updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
src/api/lib/recalculation.ts (1)
162-172: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for the snapshot contract.
The current cascade test verifies that recalculation runs, but it does not assert the exact
oneOffChargesandrateOverridevalues passed to bill generation. Add assertions for the captured values, including an interleaving mutation case if the test harness supports it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/lib/recalculation.ts` around lines 162 - 172, Add regression coverage around recalculateBillsForPeriod to capture and assert the exact oneOffCharges and rateOverride snapshot values passed into bill generation during cascade recalculation. Include an interleaving mutation scenario if supported by the existing test harness, verifying generation uses the original snapshot rather than mutated period values.src/api/routes/uploads.ts (1)
199-223: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winAdd regression tests for the property-period binding.
Cover a period for the requested property, a period from another property, and a nonexistent period. For the latter two cases, assert
404, no R2 write, and upload-counter rollback. Keep the coverage insrc/api/routes/uploads.test.ts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/api/routes/uploads.ts` around lines 199 - 223, Add regression coverage in uploads.test.ts for the periodId/propertyId binding: verify uploads succeed for a period belonging to the requested property, while a period belonging to another property and a nonexistent period return 404. For both rejected cases, assert no R2 write occurs and the upload counter is rolled back.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 46: Add unmocked runtime smoke coverage for the PDF.js integration using
the upgraded pdfjs-dist dependency, exercising both valid and malformed PDF
inputs through the production parser or Cloudflare Worker path. Ensure the test
executes the actual Worker loader rather than the existing pdfjs-dist mock, and
verifies successful parsing plus appropriate handling of malformed data.
- Around line 101-109: The GHSA-2p49-hgcm-8545 suppression currently identifies
the wrong dependency. In package.json lines 101-109, update the audit
suppression rationale to reference svgo and the exact incompatible upgrade
constraint required by policy; make the corresponding rationale correction in
AGENTS.md lines 126-133. Keep the advisory suppressed only if that documented
constraint is still valid.
- Line 44: Update the dependencies.hono entry in package.json from ^4.12.34 to
^4.13.1, matching the version already resolved by pnpm-lock.yaml and preventing
future installs from selecting an earlier release.
- Line 96: Update the nanoid override in package.json to remain within the 3.x
major while enforcing at least version 3.3.17; use an exact patched version or
the range >=3.3.17 <4 so transitive consumers cannot resolve nanoid 4 or later.
---
Nitpick comments:
In `@src/api/lib/recalculation.ts`:
- Around line 162-172: Add regression coverage around recalculateBillsForPeriod
to capture and assert the exact oneOffCharges and rateOverride snapshot values
passed into bill generation during cascade recalculation. Include an
interleaving mutation scenario if supported by the existing test harness,
verifying generation uses the original snapshot rather than mutated period
values.
In `@src/api/routes/uploads.ts`:
- Around line 199-223: Add regression coverage in uploads.test.ts for the
periodId/propertyId binding: verify uploads succeed for a period belonging to
the requested property, while a period belonging to another property and a
nonexistent period return 404. For both rejected cases, assert no R2 write
occurs and the upload counter is rolled back.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6e2f1810-6132-4c73-9e31-5f2b574b944d
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (7)
.github/workflows/ci.ymlAGENTS.mdpackage.jsonsrc/api/app.tssrc/api/lib/recalculation.tssrc/api/routes/uploads.tstsconfig.json
| "clsx": "^2.1.1", | ||
| "drizzle-orm": "^0.45.2", | ||
| "hono": "^4.12.31", | ||
| "hono": "^4.12.34", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Expect: the manifest minimum and lockfile resolution match the intended Hono release.
rg -n '"hono":|hono@|hono:' package.json pnpm-lock.yamlRepository: VaibhavDaveDev/Meterly
Length of output: 963
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Manifest hono ranges / scripts:\n'
python3 - <<'PY'
import json
with open('package.json') as f:
p=json.load(f)
for k in ('scripts','devDependencies','dependencies'):
print(f'[{k}]')
for k2,v in (p.get(k,{})).items():
if 'hono' in k2.lower() or k2 in ('hono','lint-staged','prepare','pre-commit','pre-push','lint','typecheck','test'):
print(f'{k2}: {v}')
PY
printf '\nRelevant package.json sections:\n'
sed -n '1,120p' package.json | nl -ba
printf '\nLockfile hono importer context:\n'
python3 - <<'PY'
from pathlib import Path
lines=Path('pnpm-lock.yaml').read_text().splitlines()
targets=[60,10415,13045]
for t in targets:
lo=max(1,t-5); hi=min(len(lines),t+12)
print(f'--- lines {lo}-{hi} around {t} ---')
for n in range(lo,hi+1):
print(f'{n}: {lines[n-1]}')
PYRepository: VaibhavDaveDev/Meterly
Length of output: 462
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Relevant package.json lines:\n'
sed -n '1,125p' package.json
printf '\nLockfile hono importer context:\n'
python3 - <<'PY'
from pathlib import Path
lines=Path('pnpm-lock.yaml').read_text().splitlines()
for t in (60, 10415, 13045):
lo=max(1,t-5); hi=min(len(lines),t+12)
print(f'--- lines {lo}-{hi} around {t} ---')
for n in range(lo,hi+1):
print(f'{n}: {lines.pop(0)}')
PYRepository: VaibhavDaveDev/Meterly
Length of output: 6616
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re, json
lines = Path('pnpm-lock.yaml').read_text().splitlines()
tree = {}
imports = []
current_import = None
current_spec = None
for i, line in enumerate(lines, 1):
if line.startswith(' .:'):
current_import = dict(line, spec='<root>')
imports.append(current_import)
current_spec = None
if line.startswith((' dependencies:', ' devDependencies:', ' devDependencies:')):
current_spec = line.split(':',1)[0].strip()
if current_import:
current_import['section'] = current_spec
if line == ' hono:' and current_import:
current_import.update({'hono_line_no': i, 'hono_spec': i+1})
# append subsequent lines until next dependency or blank
j=i+1
res=''
while j <= len(lines):
nxt=lines[j-1]
if nxt.strip() == '' or nxt.startswith(' ') and not nxt.strip().startswith('version:'):
break
if nxt.startswith(' version:'):
m=re.match(r'\s+version:\s*(.+)', nxt)
if m:
res=m.group(1).strip()
break
j += 1
current_import['hono_version'] = res
break
for imp in imports:
if current_import and 'hono_line_no' in imp:
print('importer:')
print(json.dumps({k:imp.get(k,'MISSING') for k in ('hono_line_no','hono_spec','hono_version','section')}, indent=2))
PYRepository: VaibhavDaveDev/Meterly
Length of output: 312
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re, json
lines = Path('pnpm-lock.yaml').read_text().splitlines()
current_import = {}
current_spec = None
imports = []
for i, line in enumerate(lines, 1):
if re.fullmatch(r'\s*\.\s*:', line):
if current_import:
imports.append(current_import)
current_import = {'parent_line_no': i, 'imports': {} if current_spec else []}
current_spec = None
elif line.endswith(':') and current_import:
key = line.strip().rstrip(':')
val = key if key.startswith('dependencies') else json.dumps({})
current_import['imports'][key] = current_spec = []
elif (current_import and current_spec is not None and key == 'hono' and line.strip().startswith('version:')):
m = re.match(r'\s*version:\s*(.+)', line)
current_spec.append({
'line_no': i,
'version': (m.group(1) if m else line.strip()).strip(),
})
imports.append(current_import)
root = next((imp for imp in imports if '.:'), {}) or imports[-1]
print(json.dumps(root, indent=2))
PYRepository: VaibhavDaveDev/Meterly
Length of output: 294
🏁 Script executed:
#!/bin/bash
set -euo pipefail
python3 - <<'PY'
from pathlib import Path
import re
lines = Path('pnpm-lock.yaml').read_text().splitlines()
current_import = {}
imports = []
hono_found = None
for i, line in enumerate(lines, 1):
if re.fullmatch(r'\s*\.\s*:', line):
imports.append(current_import)
current_import = {'parent_line_no': i, 'imports': {}}
elif re.fullmatch(r' (dependencies|devDependencies):\s*', line):
section = re.match(r' (.+):\s*', line).group(1)
current_import.setdefault('imports', {})[section] = []
elif current_import and 'imports' in current_import:
section = next((s for s in current_import.get('imports', {}) if current_import.get('imports')[s]), None)
if section and line.strip().startswith('hono:'):
m = re.search(r'(\d+\.\d+\.\d+)', lines[i])
version = m.group(1) if m else 'unknown'
current_import[section].append({'line_no': i, 'version': version})
hono_found = {'importer_line_no': current_import['parent_line_no'], 'section': section, 'line_no': i, 'version': version}
if not hono_found:
for i, line in enumerate(lines, 1):
if 'hono:' in line:
print(i, line)
else:
print('importer:', hono_found)
PYRepository: VaibhavDaveDev/Meterly
Length of output: 333
Pin Hono to the intended minimum.
pnpm-lock.yaml resolves hono to 4.13.1, but package.json#dependencies.hono still reads ^4.12.34. Update the manifest minimum to ^4.13.1 so future installs cannot reselect a pre-upgrade release.
Proposed manifest change
- "hono": "^4.12.34",
+ "hono": "^4.13.1",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "hono": "^4.12.34", | |
| "hono": "^4.13.1", |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 44, Update the dependencies.hono entry in package.json
from ^4.12.34 to ^4.13.1, matching the version already resolved by
pnpm-lock.yaml and preventing future installs from selecting an earlier release.
| "hono": "^4.12.34", | ||
| "lucide-react": "^1.20.0", | ||
| "pdfjs-dist": "^6.1.200", | ||
| "pdfjs-dist": "^6.2.108", |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Expect: the lockfile resolves the intended version and the production import is covered.
rg -n 'pdfjs-dist|getDocument|GlobalWorkerOptions' pnpm-lock.yaml src/lib/pdf-extract.tsRepository: VaibhavDaveDev/Meterly
Length of output: 984
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== relevant package.json lines =="
nasmath -n package.json | sed -n '38,50p'
echo
echo "== package.json scripts/package manager =="
node - <<'JS'
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
console.log("packageManager", pkg.packageManager);
console.log("scripts:", JSON.stringify(pkg.scripts, null, 2));
JS
echo
echo "== pnpm lock pdfjs-dist sections =="
sed -n '65,80p' pnpm-lock.yaml
sed -n '7512,7528p' pnpm-lock.yaml
sed -n '13772,13786p' pnpm-lock.yaml
echo
echo "== references to pdf extract / worker / scripts =="
rg -n "pdf-extract|pdf.worker|pdfjs-dist|extractPdf|test|coverage" package.json src test tests __tests__ .github 2>/dev/null || true
echo
echo "== worker static files mentioning pdf.worker.min.mjs =="
fd -a 'pdf.worker|min\.mjs|worker' . | sed 's#^\./##'
rg -n "pdf.worker\.min\.mjs|pdfjs-dist" --glob '!pnpm-lock.yaml' --glob '!node_modules**' --glob '!dist**' --glob '!build**' .Repository: VaibhavDaveDev/Meterly
Length of output: 239
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== relevant package.json lines =="
cat -n package.json | sed -n '38,50p'
echo
echo "== package.json scripts/package manager =="
node - <<'JS'
const fs = require('fs');
const pkg = JSON.parse(fs.readFileSync('package.json','utf8'));
console.log("packageManager", pkg.packageManager);
console.log("scripts:", JSON.stringify(pkg.scripts, null, 2));
JS
echo
echo "== pnpm lock pdfjs-dist sections =="
sed -n '65,80p' pnpm-lock.yaml
sed -n '7512,7528p' pnpm-lock.yaml
sed -n '13772,13786p' pnpm-lock.yaml
echo
echo "== references to pdf extract / worker / scripts =="
rg -n "pdf-extract|pdf.worker|pdfjs-dist|extractPdf|test|coverage" package.json src test tests __tests__ .github 2>/dev/null || true
echo
echo "== worker static files mentioning pdf.worker.min.mjs =="
fd -a 'pdf.worker|min\.mjs|worker' . | sed 's#^\./##'
rg -n "pdf\.worker\.min\.mjs|pdfjs-dist" --glob '!pnpm-lock.yaml' --glob '!node_modules**' --glob '!dist**' --glob '!build**' .Repository: VaibhavDaveDev/Meterly
Length of output: 50378
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== pdf-extract test relevant sections =="
cat -n src/lib/pdf-extract.test.ts | sed -n '1,160p'
echo
echo "== pdf-extract loader relevant sections =="
cat -n src/lib/pdf-extract.ts | sed -n '115,145p;310,330p'
echo
echo "== lockfile exact pdfjs-dist occurrence counts =="
python3 - <<'PY'
from pathlib import Path
p = Path('pnpm-lock.yaml')
text = p.read_text()
for needle in ['pdfjs-dist@6.2.108:', 'imports:', "specifier: ^6.2.108", "version: 6.2.108"]:
print(needle, text.count(needle))
PYRepository: VaibhavDaveDev/Meterly
Length of output: 8301
Add runtime smoke coverage for the upgraded PDF.js worker path.
pnpm-lock.yaml resolves pdfjs-dist@6.2.108, but the current coverage mocks pdfjs-dist; vitest does not execute this Worker Worker loader. Run a Cloudflare Worker smoke test against valid and malformed PDFs, or add an unmocked PDF.js runtime test so this production parser does not ship behind mocks only.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 46, Add unmocked runtime smoke coverage for the PDF.js
integration using the upgraded pdfjs-dist dependency, exercising both valid and
malformed PDF inputs through the production parser or Cloudflare Worker path.
Ensure the test executes the actual Worker loader rather than the existing
pdfjs-dist mock, and verifies successful parsing plus appropriate handling of
malformed data.
| "postcss": "^8.5.25", | ||
| "undici": "^7.29.0", | ||
| "js-yaml": "^4.3.1", | ||
| "nanoid": ">=3.3.17" |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== package.json relevant overrides section =="
grep -n -A 20 -B 5 '"overrides"' package.json || true
echo "== package.json relevant lines =="
sed -n '80,105p' package.json
echo "== dependency references to nanoid =="
rg -n '"nanoid"|nanoid' package.json . --glob '!node_modules' --glob '!dist' --glob '!build' --glob '!coverage' 2>/dev/null | head -100Repository: VaibhavDaveDev/Meterly
Length of output: 1843
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Use only available static sources; do not install or run repository code.
# Check whether npm is available and package metadata/versions are readable.
command -v npm || true
if command -v npm >/dev/null 2>&1; then
echo "== npm registry view versions for nanoid =="
npm view nanoid versions --json | python3 - <<'PY'
import json, sys
try:
versions=json.load(sys.stdin)
except Exception as e:
print("npm view returned non-JSON or unavailable:", e)
raise SystemExit(0)
majors={}
for v in versions:
majors.setdefault(v.split(".")[0], []).append(v)
for k in sorted(majors, key=lambda x:int(x)):
print(f"major {k}: {json.dumps(majors[k][-5:], ensure_ascii=False)}")
PY
echo "== dependency graph info for nanoid =="
npm why nanoid 2>/dev/null || true
fiRepository: VaibhavDaveDev/Meterly
Length of output: 776
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Use only available static sources; do not install or run repository code.
# Check whether npm is available and package metadata/versions are readable.
command -v npm || true
if command -v npm >/dev/null 2>&1; then
echo "== npm registry view versions for.nanoid =="
npm view nanoid versions --json | python3 - <<'PY'
import json, sys
try:
versions=json.load(sys.stdin)
except Exception as e:
print("npm view returned non-JSON or unavailable:", e)
raise SystemExit(0)
majors={}
for v in versions:
majors.setdefault(v.split(".")[0], []).append(v)
for k in sorted(majors, key=lambda x:int(x)):
print(f"major {k}: {json.dumps(majors[k][-5:], ensure_ascii=False)}")
PY
echo "== dependency graph info for nanoid =="
npm why nanoid 2>/dev/null || true
fiRepository: VaibhavDaveDev/Meterly
Length of output: 776
🌐 Web query:
npm registry nanoid versions 3.x 4.x 5.x 6.x current
💡 Result:
As of August 9, 2026, the current version of the nanoid package on the npm registry is 6.0.1 [1][2]. The status of the requested major versions is as follows: - 6.x: This is the current major version [1][2]. - 5.x: This major version was actively maintained until recently, with 5.1.16 being the last release in this series (published June 24, 2026) [3][4][2]. - 4.x: This major version introduced breaking changes by removing CommonJS support, requiring ESM applications [5][2][6]. It has been superseded by 5.x and 6.x. - 3.x: This major version continues to be supported by the project for users who require CommonJS support and cannot migrate to ESM [5][3][2][6]. The nanoid project adheres to Semantic Versioning and maintains these branches to accommodate different environment and module system requirements [5]. Users requiring modern ESM-only support typically use the latest 6.x release, while legacy support remains available through the 3.x branch [5][3][2].
Citations:
- 1: https://www.npmjs.com/package/nanoid
- 2: https://github.com/ai/nanoid/blob/main/CHANGELOG.md
- 3: https://github.com/ai/nanoid
- 4: https://github.com/ai/nanoid/?refer=ruanyifeng.vercel.app
- 5: https://github.com/ai/nanoid/blob/HEAD/CHANGELOG.md
- 6: https://github.com/ai/nanoid/blob/a3dfd785bb310de5344b83593d84fd455bc7d927/CHANGELOG.md
Bound the nanoid override to the 3.x major.
>=3.3.17 has no upper bound, and the lockfile is already on nanoid@6.0.1, which removes CommonJS support. Use an exact patched version or >=3.3.17 <4 to keep transitive consumers on a compatible line.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` at line 96, Update the nanoid override in package.json to
remain within the 3.x major while enforcing at least version 3.3.17; use an
exact patched version or the range >=3.3.17 <4 so transitive consumers cannot
resolve nanoid 4 or later.
| "auditConfig": { | ||
| "ignoreGhsas": [ | ||
| "GHSA-52cp-r559-cp3m", | ||
| "GHSA-7pw4-f3q4-r2p2", | ||
| "GHSA-f48w-9m4c-m7f5", | ||
| "GHSA-g7r4-m6w7-qqqr", | ||
| "GHSA-j3f2-48v5-ccww", | ||
| "GHSA-hvrm-45r6-mjfj", | ||
| "GHSA-w62v-xxxg-mg59", | ||
| "GHSA-7p8r-x3mc-p8w7", | ||
| "GHSA-rgw5-rvv9-x895", | ||
| "GHSA-2p49-hgcm-8545", | ||
| "GHSA-f88m-g3jw-g9cj", | ||
| "GHSA-67mh-4wv8-2f99", | ||
| "GHSA-8988-4f7v-96qf", | ||
| "GHSA-4g3v-8h47-v7g6", | ||
| "GHSA-2p49-hgcm-8545", | ||
| "GHSA-p88m-4jfj-68fv", | ||
| "GHSA-pr7r-676h-xcf6", | ||
| "GHSA-35p6-xmwp-9g52", | ||
| "GHSA-g8m3-5g58-fq7m", | ||
| "GHSA-3jxr-9vmj-r5cp", | ||
| "GHSA-mh99-v99m-4gvg", | ||
| "GHSA-v2hh-gcrm-f6hx", | ||
| "GHSA-4c8g-83qw-93j6", | ||
| "GHSA-48c2-rrv3-qjmp", | ||
| "GHSA-96hv-2xvq-fx4p", | ||
| "GHSA-hm92-r4w5-c3mj", | ||
| "GHSA-vmh5-mc38-953g", | ||
| "GHSA-vxpw-j846-p89q" | ||
| "GHSA-j3f2-48v5-ccww" |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== package.json relevant =="
sed -n '80,130p' package.json 2>/dev/null || true
echo
echo "== AGENTS.md relevant =="
sed -n '110,145p' AGENTS.md 2>/dev/null || true
echo
echo "== files named package.json =="
git ls-files 'package.json' '**/package.json' | sed -n '1,50p'
echo
echo "== lockfiles =="
git ls-files | rg '(^|/)(pnpm-lock\.yaml|package-lock\.json|yarn\.lock|bun\.lockb?)$' || true
echo
echo "== all ignoreGhsas mentions =="
rg -n '"ignoreGhsas"|ignoreGhsas|GHSA-2p49-hgcm-8545|GHSA-j3f2-48v5-ccww|GHSA-f88m-g3jw-g9cj|GHSA-67mh-4wv8-2f99|GHSA-rgw5-rvv9-x895|GHSA-7p8r-x3mc-p8w7|GHSA-8988-4f7v-96qf' .Repository: VaibhavDaveDev/Meterly
Length of output: 8906
🌐 Web query:
GHSA-2p49-hgcm-8545 affected package fixed version
💡 Result:
The vulnerability GHSA-2p49-hgcm-8545 affects the npm package svgo. The affected versions and their corresponding fixed versions are as follows [1][2]: Affected Versions and Fixed Versions: - For versions >= 4.0.0, the fixed version is 4.0.2 [1][2]. - For versions >= 3.0.0 and < 3.3.4, the fixed version is 3.3.4 [1][2]. - For versions >= 1.0.0 and < 2.8.3, the fixed version is 2.8.3 [1][2]. Please note that SVGO v1 is deprecated and will not receive further patches [1]. Users on v1 are advised to upgrade to a more recent version [1]. The vulnerability involves the removeScripts plugin, which may leave some executable scripts intact [1][3]. The fix involves improved namespace-aware handling to ensure that only scripts executed by browsers are removed [1].
Citations:
- 1: GHSA-2p49-hgcm-8545
- 2: https://dependabot.ecosyste.ms/advisories/GHSA-2p49-hgcm-8545
- 3: https://advisories.gitlab.com/npm/svgo/GHSA-2p49-hgcm-8545/
🌐 Web query:
GHSA-67mh-4wv8-2f99 affected package esbuild fixed version
💡 Result:
The security advisory GHSA-67mh-4wv8-2f99 affects the npm package esbuild [1][2]. The vulnerability exists in esbuild versions up to and including 0.24.2 [1][2][3]. It was resolved in esbuild version 0.25.0 [1][2][4]. This vulnerability allowed any website to send requests to the esbuild development server and read the responses because of overly permissive default CORS (Cross-Origin Resource Sharing) settings, specifically the use of the Access-Control-Allow-Origin: * header [4][5][6]. Updating to version 0.25.0 or later patches this by disabling CORS and enforcing host verification [4].
Citations:
- 1: GHSA-67mh-4wv8-2f99
- 2: GHSA-67mh-4wv8-2f99
- 3: https://osv.dev/vulnerability/GHSA-67mh-4wv8-2f99
- 4: https://www.wiz.io/vulnerability-database/cve/ghsa-67mh-4wv8-2f99
- 5: https://cve.circl.lu/cve/GHSA-67mh-4wv8-2f99
- 6: https://scout.docker.com/vulnerabilities/id/GHSA-67mh-4wv8-2f99
Correct the GHSA suppression and rationale entries.
GHSA-2p49-hgcm-8545 affects svgo, not sharp. If the advisory is still suppressed, update both package.json and AGENTS.md with the correct package/path and the exact incompatible upgrade constraint required by the audit-suppression policy.
📍 Affects 2 files
package.json#L101-L109(this comment)AGENTS.md#L126-L133
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@package.json` around lines 101 - 109, The GHSA-2p49-hgcm-8545 suppression
currently identifies the wrong dependency. In package.json lines 101-109, update
the audit suppression rationale to reference svgo and the exact incompatible
upgrade constraint required by policy; make the corresponding rationale
correction in AGENTS.md lines 126-133. Keep the advisory suppressed only if that
documented constraint is still valid.
Source: Coding guidelines
This branch resolves reliability, type-safety, dependency-security, and documentation issues across the codebase.
Summary by CodeRabbit
Security
Bug Fixes
Maintenance