Skip to content

sec(install): validate redirect URL origin before trusting resolved version#659

Closed
latenighthackathon wants to merge 1 commit intoNVIDIA:mainfrom
latenighthackathon:sec/install-validate-redirect-origin
Closed

sec(install): validate redirect URL origin before trusting resolved version#659
latenighthackathon wants to merge 1 commit intoNVIDIA:mainfrom
latenighthackathon:sec/install-validate-redirect-origin

Conversation

@latenighthackathon
Copy link
Copy Markdown
Contributor

Summary

  • resolve_redirect() follows HTTP redirects to determine the latest release tag but never validated the final URL origin
  • A compromised CDN, DNS poisoning, or open redirect could cause the installer to download binaries from an attacker-controlled server
  • Added origin validation: resolved URLs must match https://github.com/NVIDIA/OpenShell/* or the installer aborts
  • Also capped redirect depth in download() to 5 as defense-in-depth

Test plan

  • Run install.sh normally — verify latest version resolves and installs correctly
  • Set OPENSHELL_VERSION explicitly — verify resolve_redirect is skipped (existing behavior)
  • Test with a mock redirect to a non-GitHub URL — verify the installer aborts with a clear error message

Closes #638

…ersion

resolve_redirect() follows HTTP redirects to determine the latest
release tag, but never validated that the final URL still pointed to
the expected GitHub repository. A compromised CDN, DNS poisoning, or
an open redirect could cause the installer to extract a version tag
from — and subsequently download binaries from — an attacker-controlled
origin.

Add origin validation: reject resolved URLs that don't match
https://github.com/NVIDIA/OpenShell/*. Also cap redirect depth
in download() to 5 as defense-in-depth.

Closes NVIDIA#638
@latenighthackathon latenighthackathon requested a review from a team as a code owner March 29, 2026 19:56
@github-actions
Copy link
Copy Markdown

Thank you for your interest in contributing to OpenShell, @latenighthackathon.

This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer.

To get vouched:

  1. Open a Vouch Request discussion.
  2. Describe what you want to change and why.
  3. Write in your own words — do not have an AI generate the request.
  4. A maintainer will comment /vouch if approved.
  5. Once vouched, open a new PR (preferred) or reopen this one after a few minutes.

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown

Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text:


I have read the DCO document and I hereby sign the DCO.


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot.

@github-actions github-actions bot closed this Mar 29, 2026
@latenighthackathon
Copy link
Copy Markdown
Contributor Author

I have read the DCO document and I hereby sign the DCO.

I have read the DCO document and I hereby sign the DCO.

@latenighthackathon
Copy link
Copy Markdown
Contributor Author

recheck

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sec(install): install.sh follows redirects without validating final URL origin

1 participant