Skip to content

Clarify "Clone Configuration" to eliminate TOCTOU race possibility #485

@chcunningham

Description

@chcunningham

Clone Configuration is used in the various isConfigSupported() steps (example) to make a copy of the config as seen by the UA in assessing "support". The steps in "Clone Configuration" make a recursive shallow copy of the given config. For configs that contain a "description" BufferSource member, this should mean the output config points to the same BufferSource as the input config (copy by reference). This opens the possibility of TOCTOU races where the user may pass the config to isConfigSupported() and then modify the buffer while isConfigSupported() is asynchronously checking for support. It seems better to instead make a deep copy of the BufferSource in the synchronous portion of isConfigSupported().

Similarly, we should probably make deep copy (using the same clone algo) in the synch steps of configure().

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-definitionAn issues where something needs to be specified normatively

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions