Skip to content

harden post lockdown should warn when implicitly hardening prototypes #2968

@mhofman

Description

@mhofman

What is the Problem Being Solved?

We are looking at making harden usable before lockdown, which entails no recursing into prototypes in that case (see #1686).

It is also best practice to explicitly harden prototypes before any instances, as to not leave a window where some object that will ultimately be shared remain unhardened.

We cannot enforce that pre or post lockdown harden has prototypes pre-hardened as that would be a breaking change, and a lockdown compatibility hazard. However we could warn when post-lockdown calls of harden implicitly harden a prototype.

Description of the Design

Build a list of prototype objects that are discovered during property walk. When processing the prototypes, warn if the prototype objects isn't already hardened.

Note: a prototype object may be hardened simultaneously if discovered by property walk, in which case it shouldn't be on the list of potential prototype objects.

Security Considerations

None I can think of, should increase best practice to harden early

Scaling Considerations

Shouldn't significantly increase the ephemeral object tracking harden already does.

Test Plan

TBD

Compatibility Considerations

We should probably make this an option, possibly on by default.

Upgrade Considerations

None, can be done before or after #1686

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions