Skip to content

Mask query parameter values in repository URLs shown in output, particularly access_token #1316

Open

Description

@jeffwidman

👋 Hello from the :dependabot: engineering team!

I noticed this while improving how we support Hex in :dependabot: ... there's a potential security risk here that I'm manually working around in Dependabot, but it would be more secure if Hex masked these values (or offered a flag to mask these values) itself.

Problem

Repository URLs can contain authentication values in query parameters, for example:

https://repo.example.com/hex?access_token=secret-value

When a package fetch fails without a cached copy, Hex.SCM includes the generated tarball URL in the Mix.Error message. The current prune_uri_userinfo/1 helper masks URI userinfo, but leaves query parameter values unchanged, so the token can appear in terminal output, CI logs, and captured exceptions.

The same URL can also be emitted in debug output after a successful fetch.

This behavior is present on the current main branch in Hex.SCM.tarball_url/3 and prune_uri_userinfo/1.

Requested behavior

Mask query parameter values whenever a repository URL is rendered for output, while preserving parameter names for debugging. For example:

https://repo.example.com/hex?access_token=***&tenant=***

Masking all query values would avoid relying on a fixed list of sensitive parameter names.

Notes

No real credentials are included in this report. This is a request for defensive redaction of repository URLs that may contain query-string authentication values.

Activity

  1. changed the title [-]Mask query parameter values in repository URLs shown in output[/-] [+]Mask query parameter values in repository URLs shown in output, particularly `access_token`[/+] on Nov 18, 2026
  2. maennchen commented on Nov 18, 2026

    @maennchen
    Member

    Putting authentication is not something hex ever recommended as far as I'm aware. Hex does have means to do authentication, for example Oban Pro:

    mix hex.repo add oban https://repo.oban.pro \
      --fetch-public-key SHA256:4/OSKi0NRF91QVVXlGAhb/BIMLnK8NHcx/EWs+aIWPc \
      --auth-key $OBAN_LICENSE_KEY

    Putting this value into the repo URL will lead to lots of places "leaking" this information. For example, if you create an SBoM using mix_sbom, that URL will be written into the JSON.

    Do you have an idea who configures hex like this? If any commercial providers like Artifactory do this, we should tell them to stop doing that.

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