Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SECURITY] dlang Artifacts are downloaded insecurely #5

Closed
JLLeitschuh opened this issue Sep 25, 2019 · 10 comments
Closed

[SECURITY] dlang Artifacts are downloaded insecurely #5

JLLeitschuh opened this issue Sep 25, 2019 · 10 comments
Labels
bug Something isn't working

Comments

@JLLeitschuh
Copy link

CWE-829: Inclusion of Functionality from Untrusted Control Sphere
CWE-494: Download of Code Without Integrity Check

This project contain files that indicate that this project is resolving dependencies over HTTP instead of HTTPS. Any of these artifacts can be MITMed to maliciously compromise them and infect the build artifacts that were produced.

This vulnerability has a CVSS v3.0 Base Score of 8.1/10
https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

This isn't just theoretical

POC code has existed since 2014 to maliciously compromise software downloaded inflight.
See:

MITM Attacks Increasingly Common

See:

Source Locations

@WebFreak001
Copy link
Member

hm I don't think the D download endpoint supports HTTPS but it has a GnuPG keyring and signatures with each release since 2.067.0.

However on https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions it doesn't list GnuPG as installed so I don't think we can verify it with pre-installed programs. Otherwise I don't know how we could verify the signatures

@JLLeitschuh
Copy link
Author

I'm working on getting this resolved by requiring SHA-256 signatures if you are using HTTP instead of HTTPS.

actions/toolkit#162

@mihails-strasuns
Copy link
Collaborator

mihails-strasuns commented Sep 25, 2019

sha256 doesn't help much as we don't know full set of possible artifacts that may be downloaded. I'd look into downloading portable gpg binary and using that instead.

@WebFreak001
Copy link
Member

I think it would be better trying to include some PGP library and try to parse the keyring they give us somehow and use it in typescript

@mihails-strasuns
Copy link
Collaborator

@WebFreak001 can you maybe also ask D upstream if it would be possible to add https to download.dlang.org? This looks like a simple oversight.

@WebFreak001
Copy link
Member

died in the forums https://forum.dlang.org/post/[email protected]

@JLLeitschuh
Copy link
Author

You can tell them that using https://letsencrypt.org/ is free.

@WebFreak001
Copy link
Member

the download.dlang.org domain is an alias for their AWS bucket where I think were some problems. Directly using their bucket URL via HTTPS is possible but it's possible it would break in the future and adding in a fallback in case it's not valid anymore won't add any security because a MITM could just deny access to the HTTPS encrypted AWS bucket then

@mihails-strasuns
Copy link
Collaborator

Yeah, I intend to stick with gpg solution until github release artifacts are provided - haven't had any time in last few weeks to do it though.

@mihails-strasuns
Copy link
Collaborator

@WebFreak001 just checked and gpg binary is available on Windows CI vms out of the box, so this is a low-hanging fruit. Will submit a patch soon-ish.

mihails-strasuns pushed a commit that referenced this issue Nov 1, 2019
Fixes #5

DMD does not use HTTPS for download links, thus using GPG signature is
necessary to avoid MitM. LDC currently does not need/provide those.
mihails-strasuns pushed a commit that referenced this issue Nov 1, 2019
Fixes #5

DMD does not use HTTPS for download links, thus using GPG signature is
necessary to avoid MitM. LDC currently does not need/provide those.
mihails-strasuns pushed a commit that referenced this issue Nov 4, 2019
Fixes #5

DMD does not use HTTPS for download links, thus using GPG signature is
necessary to avoid MitM. LDC currently does not need/provide those.
mihails-strasuns pushed a commit that referenced this issue Nov 4, 2019
Fixes #5

DMD does not use HTTPS for download links, thus using GPG signature is
necessary to avoid MitM. LDC currently does not need/provide those.
@mihails-strasuns mihails-strasuns added the bug Something isn't working label Nov 14, 2019
mihails-strasuns pushed a commit that referenced this issue Nov 17, 2019
Fixes #5

DMD does not use HTTPS for download links, thus using GPG signature is
necessary to avoid MitM. LDC currently does not need/provide those.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants