Page MenuHomePhabricator

[lib] Validate IDs in DM operations
ClosedPublic

Authored by tomek on Mon, Nov 4, 6:47 AM.
Tags
None
Referenced Files
F3373734: D13858.diff
Tue, Nov 26, 11:23 AM
F3372600: D13858.id45706.diff
Tue, Nov 26, 7:13 AM
F3372075: D13858.id45580.diff
Tue, Nov 26, 5:31 AM
F3371602: D13858.diff
Tue, Nov 26, 5:18 AM
Unknown Object (File)
Sun, Nov 24, 6:20 AM
Unknown Object (File)
Fri, Nov 22, 10:16 PM
Unknown Object (File)
Wed, Nov 20, 3:19 PM
Unknown Object (File)
Tue, Nov 19, 12:02 AM
Subscribers

Details

Summary

We should check whether the IDs are thick - it protects us against an attacker who could try to create operations referencing thin thread entities.

https://linear.app/comm/issue/ENG-9826/validate-the-ids-from-the-dm-operations

Depends on D13848

Test Plan

Tested a couple of scenarios:

  • sending a text message
  • changing thread settings
  • editing a message
  • reacting to a message
  • creating a sidebar

In the cases where another message was a target, tested that it works for both text and edit thread settings messages.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested review of this revision.Mon, Nov 4, 7:05 AM
kamil added inline comments.
lib/types/dm-ops.js
58 ↗(On Diff #45580)

this is already defined in here

This revision is now accepted and ready to land.Tue, Nov 5, 2:20 AM
lib/types/dm-ops.js
58 ↗(On Diff #45580)

The value is the same, but the meaning is different. In that place, we're defining what a thread ID is. Here, we're talking about other types of ID. But I think it could be generalized by renaming thickThreadIDRegex.

This revision was automatically updated to reflect the committed changes.