CVE-2024-28867: Swift Prometheus Unsanitized Metric Name

Unsanitized metric names or labels can allow an attacker to inject special characters (e.g., newlines) to hijack the exported Prometheus format, leading to fake metrics, format corruption, or Denial of Service by unbounded metric creation. Always sanitize metric dimensions using standard validation helpers like `ensureValidMetricName()`.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0Swiftβ
greprules fetch cve-2024-28867-swift-prometheus-unsanitized-metric-name --engine opengrep

Description

Unsanitized metric names or labels can allow an attacker to inject special characters (e.g., newlines) to hijack the exported Prometheus format, leading to fake metrics, format corruption, or Denial of Service by unbounded metric creation. Always sanitize metric dimensions using standard validation helpers like `ensureValidMetricName()`.