False positive - Ruby on Rails: SQL query built from user-controlled sources
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 141
描述
**Description of the false positive**
Rails execute `sanitize_sql_for_assignment` when `update_all` called with an array as the argument:
https://github.com/rails/rails/blob/v7.0.8/activerecord/lib/active_record/relation.rb#L476
**Code samples or links to source code**
https://github.com/amnis-invictus/ikt.edu.vn.ua/blob/e404674b8efd9c4ed668866787a8a2ef1b91514f/app/channels/api_channel.rb#L82
https://github.com/amnis-invictus/ikt.edu.vn.ua/blob/e404674b8efd9c4ed668866787a8a2ef1b91514f/app/channels/api_channel.rb#L85
**URL to the alert on GitHub code scanning (optional)**
https://github.com/amnis-invictus/ikt.edu.vn.ua/security/code-scanning/307
https://github.com/amnis-invictus/ikt.edu.vn.ua/security/code-scanning/308
贡献指南
调研方向
Start by reviewing ActiveRecord's relation.rb at line 476, where update_all calls sanitize_sql_for_assignment with an array, and compare that behavior with app/channels/api_channel.rb at lines 82 and 85. Use the linked code-scanning alerts to confirm why these calls are reported. Done means the valid usage is no longer treated as a SQL injection finding.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rails, ruby
- 领域
- security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100