Skip to content

Include checksum of dependency in dub.selections.json #1723

Description

@no-longer-on-githu-b

The selections file only contains version numbers. However, a malicious library author could repoint a tag to a different version, wreaking havoc amongst users.

For example:

  1. I add a new dependency on foo 1.0 to dub.json.
  2. I run a DUB command that causes the dependency to be downloaded, and dub.selections.json to be created.
  3. The library author includes malware in a new commit, and changes the 1.0 tag to this new commit.
  4. I clear the DUB cache and run the DUB command again, which will again download the dependency.
  5. I now have different code than I had before.

By verifying the checksum as part of the second download, this issue is mitigated: the library user needs to audit the dependency only the first time they download it.

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions