jenkinsci / jenkinsci/git-plugin
[JENKINS-42665] Git BuildData caches remoteUrls without trimming strings
- 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
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
Assessment
This issue has not been assessed yet.