jenkinsci / jenkinsci/git-plugin

[JENKINS-42665] Git BuildData caches remoteUrls without trimming strings

Open
#3,056 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

It is a follow-up to https://github.com/jenkinsci/git-plugin/pull/484#discussion_r105220902

BuildData exposes public API for contributing remoteUrls as strings, but there is no trimming of incoming values.

> Similarity check for remote URL lists... We may also get false negative if values like "


{remoteUrl}" and " {remoteUrl}

" sneak into the set (due to the size check above). I would vote for explicit trimming of strings in places like https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L77 and https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L208 . Ant to the original code

 

 

---
Originally reported by oleg_nenashev, imported from: Git BuildData caches remoteUrls without trimming strings


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

It is a follow-up to https://github.com/jenkinsci/git-plugin/pull/484#discussion_r105220902

BuildData exposes public API for contributing remoteUrls as strings, but there is no trimming of incoming values.

> Similarity check for remote URL lists... We may also get false negative if values like "


{remoteUrl}" and " {remoteUrl}

" sneak into the set (due to the size check above). I would vote for explicit trimming of strings in places like https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L77 and https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L208 . Ant to the original code

 

 

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.