-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Describe the bug
FileDataSource uses YAML.load to load the feature flags file. YAML is quite elaborate, and it can demarshal arbitrary Ruby objects. If the data source is used in production/development, and the feature flag store is compromised, demarshaling of arbitrary objects can be achieved.
To reproduce
Take a look at https://gist.github.com/niklasb/df9dba3097df536820888aeb4de3284 and similar YAML-vector based exploits. Then a YAML file can be crafted that causes arbitrary Ruby objects to get initialised during feature flag loading from the FileDataSource.
Expected behavior
Since JSON is already used in the library source I would also expect it to be used for loading the stored flag data.
SDK version
master from this GH repository.
Language version, developer tools
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
OS/platform
MRI any
Additional context
Using a richer marshaling format than strictly necessary might not be the best idea.