fix(security): escape org_id parameter in admin stats SQL queries#1730
fix(security): escape org_id parameter in admin stats SQL queries#1730artylobos wants to merge 1 commit intoCap-go:mainfrom
Conversation
Two locations in cloudflare.ts were interpolating org_id directly into SQL queries without using escapeSqlString(), allowing potential SQL injection in getAdminPlatformOverview and getAdminMauTrend functions. These are admin-only endpoints but defense-in-depth requires consistent escaping of all user-controllable parameters.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds SQL string escaping to two admin analytics queries in the Cloudflare utilities module. The Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
|
|
do not make security fix on PR use proper security disclosure |



Summary
Two locations in
cloudflare.tswere interpolatingorg_iddirectly into SQL queries without usingescapeSqlString().Affected Functions
getAdminPlatformOverview()(line 1452)getAdminMauTrend()(line 1634)Security Impact
While these are admin-only endpoints, defense-in-depth requires consistent escaping of all user-controllable parameters. A malicious admin or compromised admin session could potentially exploit this.
Changes
escapeSqlString(org_id)for consistent SQL injection preventionSummary by CodeRabbit