Skip to content

Document the security design of yarn, the use of SHA1, and security roadmap #1169

Open
@grempe

Description

@grempe

Do you want to request a feature or report a bug?
feature (docs)

What is the current behavior?

Yarn website and blog posts make extensive claims about the security of yarn, going so far as to call it 'Mega Secure' on the homepage of yarn.

https://yarnpkg.com

Mega Secure.
Yarn uses checksums to verify the integrity of every installed package before its code is executed.

The Facebook blog post announcing yarn similarly makes security claims, but provides zero information on the security approach.

https://code.facebook.com/posts/1840075619545360

However, nowhere can I find documented what the security design of yarn is intended to accomplish other than these very generic statements.

Yarn appears to use the SHA1 cryptographic one-way hash function to generate and compare digests of packages. This is not really a checksum.

https://en.wikipedia.org/wiki/Checksum

Please prominently document:

  • what is the security roadmap for yarn?
  • how does yarn use cryptographic hashes to ensure that packages are unmodified?
  • what security threats does this prevent? and which does it not?
  • when are hashes generated and when are they compared?
  • is there a plan to publish hashes of packages in (signed) server metadata to allow the client to compare against a known source of truth?
  • why was the SHA1 hash chosen, when more modern and secure primitives such as SHA256 are recommended by security experts? (for example, SHA1 hashes are no longer allowed in TLS certificates due to security concerns). https://en.wikipedia.org/wiki/SHA-1#Cryptanalysis_and_validation
  • does the existing yarn.lock file support the use of other cryptographic hash functions other than SHA1 in the future?
  • what plans does the yarn project have for supporting cryptographic signatures for packages in the future?

It seems that now, in the early stages of yarn, is the time to incorporate strong security and signed packages. The claims of 'mega security' without any documentation to support those claims may be considered misleading by those concerned with security.

If the current behavior is a bug, please provide the steps to reproduce.

n/a

What is the expected behavior?

n/a

Please mention your node.js, yarn and operating system version.

n/a

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions