launcher icon indicating copy to clipboard operation
launcher copied to clipboard

Backfill support for all datatypes for Firefox and Chrome extension databases

Open RebeccaMahany opened this issue 10 months ago • 3 comments

We've been adding support for datatypes as we see them come up, which means that by the time we hit a parsing error, we need to do a full launcher release before end users will see the fix reflected.

We should proactively go through the Chrome/Firefox code and add support to parsing for all data types we haven't yet covered.

Go through the Chrome and Firefox code (linked here at the bottom of this section) and compare the data types listed there with our Firefox and Chrome parsing support.

For each data type that we don't yet cover:

  • [ ] Add the data type to our test databases for both Chrome and Firefox, following the instructions here: https://github.com/kolide/launcher/tree/main/ee/katc/test_data#instructions-for-generating-new-test-indexeddbs
  • [ ] Implement parsing for the data type for Firefox: https://github.com/kolide/launcher/blob/main/ee/katc/deserialize_firefox.go
  • [ ] Implement parsing for the data type for Chrome: https://github.com/kolide/launcher/blob/main/ee/indexeddb/values.go

RebeccaMahany avatar Jan 22 '25 16:01 RebeccaMahany

I feel like I asked this before, but is there a way to skip the unparsable values?

directionless avatar Jan 23 '25 00:01 directionless

@directionless not reliably, no -- when we get to a value with an unsupported data type tag, we aren't able to advance through it confidently to the next key-value pair because values have variable lengths, and may contain within them characters that also denote data type tags.

RebeccaMahany avatar Jan 23 '25 14:01 RebeccaMahany

If anyone else is looking to grab work on this ticket, I think Error might be the next quickest option to grab!

  • kError for Chrome: https://github.com/v8/v8/blob/master/src/objects/value-serializer.cc#L164-L166
  • SCTAG_ERROR_OBJECT for Firefox: https://searchfox.org/mozilla-central/source/js/src/vm/StructuredClone.cpp#148
  • https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error

RebeccaMahany avatar Mar 14 '25 14:03 RebeccaMahany