Skip to content

Considerations for timing attacks using timestamp queries #2218

Closed

Description

@litherum

The spec for performance.now() says in its "Privacy and Security" section:

To ensure that the new API does not significantly improve the accuracy or speed of such attacks, the minimum resolution of the DOMHighResTimeStamp type should be inaccurate enough to prevent attacks.

Where necessary, the user agent should set higher resolution values to time resolution in coarsen time's processing model, to address privacy and security concerns due to architecture or software constraints, or other considerations.

In order to mitigate such attacks user agents may deploy any technique they deem necessary. Deployment of those techniques may vary based on the browser's architecture, the user's device, the content and its ability to maliciously read cross-origin data, or other practical considerations.

We should have similar text in our own Privacy and Security section.

Activity

  1. added this to the V1.0 milestone on Oct 27, 2021
  2. kvark commented on Nov 26, 2021

    @kvark
    Contributor

    Here is what we have now

    WebGPU also specifies the "timestamp-query" feature, which provides high precision timing of GPU operations. The feature is optional, and a WebGPU implementation may limit its exposure only to those scenarios that are trusted. Alternatively, the timing query results could be processed by a compute shader and aligned to a lower precision.

  3. Kangz commented on Dec 14, 2021

    @Kangz
    Contributor

    @litherum is that text sufficient? If it isn't, can you make a PR?

  4. Kangz commented on Jan 11, 2022

    @Kangz
    Contributor

    Ping @litherum? I think this issue can just be closed.

  5. Kangz commented on Jan 12, 2022

    @Kangz
    Contributor

    Please reopen if needed..

  6. theb1rd commented on Nov 3, 2023

    @theb1rd

    Is it possible to use timestamp queries today? Via browser flags maybe? I've tried on intel and nvidia without success, but need them badly.

  7. gyagp commented on Nov 4, 2023

    @gyagp

    @theb1rd Chrome supports it with flag "--enable-dawn-features=allow_unsafe_apis". We just enabled it in ONNX Runtime and you may refer the PR (https://github.com/microsoft/onnxruntime/pull/18108) for details.

  8. theb1rd commented on Nov 4, 2023

    @theb1rd

    That worked, thanks gyagp!

    (I thought I had been running with that flag, but in fact it was "--disable-dawn-features=disallow_unsafe_apis", what the f)

  9. gyagp commented on Nov 4, 2023

    @gyagp

    The flag was changed a while ago :) Glad to know it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions