Skip to content

fix: harden HTTPServer failure handling #2283 #2284#2288

Open
arnabnandy7 wants to merge 1 commit into
prometheus:mainfrom
arnabnandy7:security/stacktrace-fix
Open

fix: harden HTTPServer failure handling #2283 #2284#2288
arnabnandy7 wants to merge 1 commit into
prometheus:mainfrom
arnabnandy7:security/stacktrace-fix

Conversation

@arnabnandy7

@arnabnandy7 arnabnandy7 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2283 and #2284 by hardening the standalone HTTP server exporter failure paths.

Changes

  • Return a generic HTTP 500 response body for scrape failures instead of exposing Java stack traces.
  • Log full scrape exceptions server-side for debugging.
  • Replace the default HTTP server executor's zero-capacity queue and blocking rejection handler with a bounded queue and non-blocking rejection.
  • Stop draining arbitrary request bodies in the invalid authenticated-subject path.
  • Add adapter, server, and integration-test coverage for the updated behavior.

Testing

  • mise run lint:fix
  • .\\mvnw.cmd clean test -pl prometheus-metrics-exporter-httpserver "-Dtest=HTTPServerTest,HttpExchangeAdapterTest" "-Dcoverage.skip=true" "-Dcheckstyle.skip=true"
  • .\\mvnw.cmd clean test-compile -pl integration-tests/it-exporter/it-exporter-test "-Dcoverage.skip=true" "-Dcheckstyle.skip=true"
  • .\\mvnw.cmd install -DskipTests "-Dcoverage.skip=true"

@arnabnandy7 arnabnandy7 changed the title #2283 fix: hide scrape stack traces from HTTP responses fix: hide scrape stack traces from HTTP responses #2283 Jul 8, 2026
@arnabnandy7 arnabnandy7 force-pushed the security/stacktrace-fix branch 2 times, most recently from 5a344d2 to 8213bda Compare July 8, 2026 11:45
@arnabnandy7 arnabnandy7 changed the title fix: hide scrape stack traces from HTTP responses #2283 fix: harden HTTPServer failure handling #2283 #2284 Jul 8, 2026
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
@arnabnandy7 arnabnandy7 force-pushed the security/stacktrace-fix branch from 8213bda to 6ebd42f Compare July 8, 2026 11:56
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — maintainer review required

This PR modifies the published API diff for the following module(s):

  • prometheus-metrics-exporter-httpserver

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security Report: Full Stack Trace Disclosure in HTTP Error Responses

1 participant