[SERVER-26148] Commands should convert integers from user input safely Created: 16/Sep/16  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Stability
Affects Version/s: 3.3.12
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Robert Guo (Inactive) Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: query-44-grooming
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-25188 Add non-debug UBSan variant for jstes... Closed
Related
related to SERVER-12813 Overflow when converting double value... Open
related to SERVER-68309 Investigate for unsafe narrowing conv... Closed
related to SERVER-68705 Refactor BSONElement API to avoid uns... Backlog
is related to SERVER-41024 safeInt32 and safeInt64 IDL types are... Closed
is related to SERVER-56516 Fix undefined behaviour in parsing co... Closed
is related to SERVER-57118 Unify query operators argument valida... Backlog
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

Currently, almost all commands use BSONElement::numberLong or BSONElement::numberInt to parse user input for fields that expect a number. This results in undefined behavior when the input is outside the range of a valid integer type.

User-facing commands should use BSONElement::safeNumberLong instead. See the geoNear command as an example.


Generated at Thu Feb 08 04:11:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.