Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification webhook sends blank header key/value with a colon #4344

Open
2 tasks done
calderonth opened this issue Oct 31, 2024 · 0 comments
Open
2 tasks done

Notification webhook sends blank header key/value with a colon #4344

calderonth opened this issue Oct 31, 2024 · 0 comments
Labels
defect Something isn't working in triage

Comments

@calderonth
Copy link
Contributor

Current Behavior

Notifications webhook sends invalid HTTP header when fields are empty.
Here is the raw HTTP payload being received by netcat:

nc -l -p 9090
POST / HTTP/1.1
content-type: application/json
accept: application/json
:
Content-Length: 51558
Host: myhost:9090
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.5.14 (Java/21.0.5)
Accept-Encoding: gzip,deflate

{
  "notification": {
    "level": "INFORMATIONAL",
    "scope": "PORTFOLIO",
    "group": "BOM_CONSUMED",
    "timestamp": "2024-10-31T11:14:17.975933948",
    "title": "Bill of Materials Consumed",
    "content": "A CycloneDX BOM was consumed and will be processed",
    "subject":

We can see above that below the accept: application/json header a blank header key and value are being sent which is invalid.

Steps to Reproduce

  1. Create a notification to to host myhost:9090
  2. Listen on the given host: nc -l -p 9090
  3. Observe the following header value being sent: : which is the blank fields for API token header and API token in the UI:

Image

Expected Behavior

If the API key/secret fields are empty, no blank header key/value with a colon should be sent.

Dependency-Track Version

4.13.0-SNAPSHOT

Dependency-Track Distribution

Container Image

Database Server

H2

Database Server Version

No response

Browser

Google Chrome

Checklist

@calderonth calderonth added defect Something isn't working in triage labels Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working in triage
Projects
None yet
Development

No branches or pull requests

1 participant