[SERVER-65864] Add uassert during $densify parsing when date unit is present and step is not an integer Created: 21/Apr/22  Updated: 29/Oct/23  Resolved: 21/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc11, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Davis Haupt (Inactive) Assignee: Davis Haupt (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.0
Sprint: QO 2022-05-02
Participants:
Linked BF Score: 107

 Description   

We're missing a uassert in RangeStatement::parse to verify that the step is an integer when a time unit is present. This causes us to hit a tassert later on when constructing a DocGenerator. This is invalid user input and we should fail during parsing.



 Comments   
Comment by Githook User [ 21/Jun/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-65864 Parse $densify step as a NumberLong when using a date unit

(cherry picked from commit 8be84724601090e093d6d7ccfa4536a187c41edc)
Branch: v6.0
https://github.com/mongodb/mongo/commit/816918e7ebb03cd74fdfb935590d14fc9e8d0210

Comment by Davis Haupt (Inactive) [ 21/Jun/22 ]

This actually does need to get backported to 6.0 because in addition to relaxing a tassert it also added a uassert to parsing.

Comment by Davis Haupt (Inactive) [ 21/Apr/22 ]

Before this patch, the result of Value::coerceToDouble() for the step value would then be coerced into a long long. There might be some rounding issues with large step values, but the server wouldn't crash or give incorrect results. Because of this, I don't think we need to backport this change.

Comment by Githook User [ 21/Apr/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-65864 Parse $densify step as a NumberLong when using a date unit
Branch: master
https://github.com/mongodb/mongo/commit/8be84724601090e093d6d7ccfa4536a187c41edc

Generated at Thu Feb 08 06:03:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.