Skip to content

Hash method mismatch in comsuming preloads can allow response not matching consumer's integrity #7973

Closed

Description

@hiroshige-g

#7738 allows consuming preloads if

the user-agent has determined that preloadIntegrityMetadata is stronger than consumerIntegrityMetadata

but this can cause a response that doesn't match with consumerIntegrityMetadata to pass SRI check, if it does match with preloadIntegrityMetadata.
For example,

<link rel="preload" as="script" href="foo.js" integrity="sha512-aaaaa">
<script src="foo.js" integrity="sha256-bbbbb"></script>

where received foo.js's SHA512 hash is aaaaa and SHA256 hash is ccccc, not bbbbb.
This can problematic when bbbbb is the correct hash and the received foo.js and the <link rel=preload>'s hash aaaaa are wrong.

Maybe the "stronger than" condition should be removed?

Activity

  1. noamr commented on Jun 1, 2022

    @noamr
    Contributor

    I am OK with removing this (if Firefox are not opposed)

  2. added a commit that references this issue on Jun 3, 2022
    afcf6e5
  3. added a commit that references this issue on Jun 3, 2022
    4c83c55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions