DependencyTrack / DependencyTrack/frontend
Double-Encoding URI Breaks Some External Reference Links
- Dominant language
- Vue
- Stars
- 171
- Forks
- 250
- Avg merge
- 10h 56m
- Merged PRs (30d)
- 84
Description
### Current Behavior
Import BOM that contains this in externalReferences:
```
{
"type" : "static-analysis-report",
"url" : "https://foo.bar.com/dashboard?id=bar.foo.common%3Aservice-common",
"comment" : "SonarQube"
},
```
* When I then export the BOM from DT the URL exactly matches what had been imported and is (thus) correct
* When I navigate via UI to theproject and display the external references, the URL displays OK.
* But when click on the link, I get directed to: `https://foo.bar.com/dashboard?id=bar.foo.common%253Aservice-common`
ie, the already-encoded `%3A` has been incorrectly double encoded to become `%253A`
### Steps to Reproduce
1. I used `cyclonedx-maven-plugin` v2.8.0 to generate my BOM, generating a schema 1.5 BOM (the default for this version).
2. The above example used `static-analysis-report` (introduced in 1.5) but I am sure that any valid external reference could be used to demonstrate the URL defect (the listing of types is documented [here](https://github.com/CycloneDX/guides/blob/main/SBOM/en/0x51-External-References.md) in the guide).
3. Configuration of External References in `cyclonedx-maven-plugin` is documented [here](https://cyclonedx.github.io/cyclonedx-maven-plugin/external-references.html)
### Expected Behavior
URL value for externalReference should be correct when appearing in the frontend.
### Dependency-Track Frontend Version
4.10.0
### Browser
Mozilla Firefox
### Browser Version
124.0.1
### Operating System
Windows
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/frontend/issues) for whether this defect was already reported
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by importing the sample BOM and opening the project's external references in the frontend. Compare the clicked link with the imported URL, especially `%3A` versus `%253A`. Done means clicking the reference preserves the original URL encoding; the issue names no files or tests, so locate the relevant link-rendering entry point first.
Written by the indexing model from the issue text.
Assessment
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100