Skip to content

test(security): add meter notes SQL injection regression coverage (#671) - #722

Open
nupedev wants to merge 1 commit into
Dev-AdeTutu:mainfrom
nupedev:fix/671-meter-notes-sql
Open

test(security): add meter notes SQL injection regression coverage (#671)#722
nupedev wants to merge 1 commit into
Dev-AdeTutu:mainfrom
nupedev:fix/671-meter-notes-sql

Conversation

@nupedev

@nupedev nupedev commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #671

Audits the meter-notes SQLite access layer and adds a regression test for SQL-like meter identifiers.

Changes

The current meterNotes.ts implementation uses prepared statements and bound parameters for note insertion, latest-note queries, paginated queries, counts, and deletion. This branch preserves that safe implementation and adds explicit security coverage so a quoted identifier such as meter-1' OR 1=1 -- is treated as data rather than executable SQL. The regression checks both latest and paginated note reads across separate meter IDs.

Verification

  • Focused Vitest configuration with tests/meters-note.test.ts — 6 passed.
  • git diff --check — passed.

No interpolated meter_id SQL was found in the audited meter-notes operations. This PR intentionally avoids duplicating an already-present parameterization fix and instead prevents regression in the current codebase.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@nupedev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Potential SQL injection in meter notes endpoint

1 participant