Skip to content

Validate GitRepositoryName so a name cannot reshape a request path #85

Description

@matt-edmondson

GitRepositoryName carries only [HasNonWhitespaceContent], so a name containing /, ?, or .. passes validation.

The two providers handle that inconsistently. AzureDevOpsProvider runs Uri.EscapeDataString over the organization, project, and repository before building a URL. GitHubProvider hands the raw value to Octokit, which formats it into a relative URI without escaping. A name containing a separator can therefore reshape the request path.

This is not a vulnerability, because the caller is the trusting party and the blast radius is a request to a different URL under the caller's own credentials. It is an inconsistency worth closing, and a validated type would fix both sites at the source rather than at each use.

Related to the containment guard added in #80, which handles the same class of input for local paths.

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

    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