Skip to content

Escape manual merge instruction branch name

What does this MR do?

Branch names can contain characters that command-lines treat as special characters (which may be exploited to have the user execute malicious commands, as demonstrated in #328889 (closed)). This escapes the source and target branch in the Check out branch for local MR reviews for that reason and to always show the correct command with the correct branch.

The added method escapeShellString (in text_utility.js) is using single-quotes to escape the strings shell-safe.

Related to #328889 (closed)

Screenshots or Screencasts (strongly suggested)

Before After
image image
image image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Kev

Merge request reports