Repository navigation
Use Zoom age estimate midpoint - #605
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/server/verification/processor/provider/ZoomProvider.js" line_range="142" />
<code_context>
if (skipAgeCheck !== true && enrollResult.ageV2GroupEnumInt < this.minAgeGroup) {
const { age } = await GoodIDUtils.ageGenderCheck(payload.auditTrailImage)
- if (age.min < 16) {
+ if ((age.min + age.max) / 2 < 16) {
log.debug('age check failed', { enrollmentIdentifier, ageGroup: enrollResult.ageV2GroupEnumInt, awsAge: age })
const e = new Error('age check failed')
</code_context>
<issue_to_address>
**Underage estimates pass enrollment**
When goodID returns an age range with either bound missing, `(age.min + age.max) / 2` evaluates to `NaN`, so the comparison with 16 is false. `ZoomProvider.enroll` proceeds without establishing that the user meets the minimum age, including when the available lower bound is below 16.
Reject incomplete age ranges and ranges whose lower bound is below 16.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and an estimate such as 15–17 now passes the age gate because its midpoint is 16, even though its lower bound is below the minimum. If that eligibility rule is wrong, underage users may be enrolled without an alert; reverting the code would not undo enrollments or any access already granted.
Blocking findings: src/server/verification/processor/provider/ZoomProvider.js:142
| if (skipAgeCheck !== true && enrollResult.ageV2GroupEnumInt < this.minAgeGroup) { | ||
| const { age } = await GoodIDUtils.ageGenderCheck(payload.auditTrailImage) | ||
| if (age.min < 16) { | ||
| if ((age.min + age.max) / 2 < 16) { |
There was a problem hiding this comment.
🟠 High · Underage estimates pass enrollment
When goodID returns an age range with either bound missing, (age.min + age.max) / 2 evaluates to NaN, so the comparison with 16 is false. ZoomProvider.enroll proceeds without establishing that the user meets the minimum age, including when the available lower bound is below 16.
Reject incomplete age ranges and ranges whose lower bound is below 16.
Prompt for AI agents
In `src/server/verification/processor/provider/ZoomProvider.js` at line 142:
**Underage estimates pass enrollment**
When goodID returns an age range with either bound missing, `(age.min + age.max) / 2` evaluates to `NaN`, so the comparison with 16 is false. `ZoomProvider.enroll` proceeds without establishing that the user meets the minimum age, including when the available lower bound is below 16.
Reject incomplete age ranges and ranges whose lower bound is below 16.
Summary
Validation
git diff --checkpassed.npm cireports the package manifest and lockfile are out of sync.Summary by Sourcery
Use the midpoint of GoodID’s estimated age range for Zoom minimum-age checks.
Bug Fixes:
Tests: