jenkinsci / jenkinsci/credentials-binding-plugin

[JENKINS-72036] usernameColonPassword does not properly masked credentials

Open
#511 0 comments 0 reactions 0 assignees View on GitHub
component:credentials-binding-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
57
Forks
108
PR merge metrics
No merged PRs in 30d

Description

Using withCredentials with usernameColonPassword only masks credentials with the USERNAME:PASSWORD format, but when they're used, applications can print them in different format (only the password or only the username).


Reproduction Steps

In this example I'm leaking the username, as I'm not aware of applications which could leak password.

Create a Username with password credentialsId with basic-cred as ID

Check "Treat username as secret"

Create a pipeline with the following script:

```
pipeline {
agent any

stages {
stage('HTTP Request') {
steps {
withCredentials([usernameColonPassword(credentialsId: 'basic-cred', variable: 'BASIC_AUTH')]) {
sh '''
curl -v https://$BASIC_AUTH@​google.com
'''
}
}
}
}
}

```

Built it and go to the build log

---
Originally reported by kevingrdj, imported from: usernameColonPassword does not properly masked credentials


  • status: Open
  • priority: Minor
  • component(s): credentials-binding-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251211-141027

Raw content of original issue

Using withCredentials with usernameColonPassword only masks credentials with the USERNAME:PASSWORD format, but when they're used, applications can print them in different format (only the password or only the username).


Reproduction Steps

In this example I'm leaking the username, as I'm not aware of applications which could leak password.

Create a Username with password credentialsId with basic-cred as ID
Check "Treat username as secret"

Create a pipeline with the following script:



pipeline {

agent any

stages {
stage('HTTP Request') {
steps {
withCredentials([usernameColonPassword(credentialsId: 'basic-cred', variable: 'BASIC_AUTH')]) {
sh '''
curl -v https://$BASIC_AUTH@google.com
'''
}
}
}
}
}


Built it and go to the build log

1 attachment

- [credentials-binding.png](https://issues.jenkins.io/secure/attachment/61155/credentials-binding.png)
> ![credentials-binding.png](https://issues.jenkins.io/secure/attachment/61155/credentials-binding.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.