You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The 'config' argument to Metric.constructor is not a defined type and is open-ended #814
The typescript type puts a limit on what fields to populate from this object, however the implementation just does Object.assign(this, ...) which is all sorts of fun for prototype pollution, and also makes #812 a bit of a challenge since basically anything goes.
In fact it was already previously being abused by summary.js to set the store, which is not an allowed value for that data structure.
I'm going to want to make this concrete to fix the labels() issue without making a giant footgun for everyone else. We won't touch a config field unless we already know the name. But it can be folded into the validation section which should keep things from getting long winded.
I'd like to work on this. I plan to restrict constructor assignment to supported metric options, preserving subclass options and defaults, with tests for unexpected fields and all four metric types. Is anyone already implementing this as part of #812?
Activity
SidheshwarSarangal commentedon Oct 20, 2026
I'd like to work on this. I plan to restrict constructor assignment to supported metric options, preserving subclass options and defaults, with tests for unexpected fields and all four metric types. Is anyone already implementing this as part of #812?
docs: add changelog entry for constructor option restriction