Skip to content
High 7.6

Alertmanager APIv2で認証なしの環境に外部サイトから操作される脆弱性

GHSA-w5g2-x24w-p3fq First seen on SecPulse

Summary

Alertmanagerのapi/v2は、どのオリジンからのクロスオリジン要求も受け付けるため、認証のない環境では、利用者が開いた外部サイトからAPIの応答を読まれたり、アラートやサイレンスを作られたりするおそれがあります。影響を受けるのはgithub.com/prometheus/alertmanagerの0.34.2より前の版で、0.34.2で修正されています。認証を設定している環境は影響を受けないとされていますが、0.34.2以降へ更新するか、認証を有効にしてください。

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

Alertmanagerのapi/v2は、どのオリジンからのクロスオリジン要求も受け付けるため、認証のない環境では、利用者が開いた外部サイトからAPIの応答を読まれたり、アラートやサイレンスを作られたりするおそれがあります。影響を受けるのはgithub.com/prometheus/alertmanagerの0.34.2より前の版で、0.34.2で修正されています。認証を設定している環境は影響を受けないとされていますが、0.34.2以降へ更新するか、認証を有効にしてください。

Affected packages

PackageAffected → Fixed
gogithub.com/prometheus/alertmanager
>= 0.17.0→ 0.34.2
Original description The description as published by the source.

Summary

/api/v2 allows cross-origin requests from every origin. If a user's browser can reach an Alertmanager instance without authentication, any website the user opens can read API v2 responses, create alerts and create silences.

Instances behind any form of authentication are not affected.

Details

The API v2 handler is wrapped in cors.Default() from github.com/rs/cors in api/v2/api.go. That configuration allows all origins, the methods GET, HEAD and POST, and the Content-Type header. DELETE is not allowed. Credentials are not allowed, so browsers do not attach cookies or Authorization headers to cross-origin requests. This is why authenticated instances are not affected. Basic auth, TLS client certificates or an authenticating proxy each prevent exploitation.

Patches

Alertmanager 0.34.2 no longer sends CORS headers by default.

This is a breaking change for browser applications that call /api/v2 directly from a different origin and rely on Alertmanager's CORS headers. To keep direct browser access working, allow the origins explicitly with the new --web.cors.origin flag.

Workarounds

Use a reverse proxy that removes the Access-Control-Allow-* headers from Alertmanager responses, or enable authentication.

Proof of concept

Run Alertmanager without authentication, using a minimal config:

./alertmanager --config.file=<(printf 'route:\n  receiver: default\nreceivers:\n  - name: default\n')

Serve the following…

Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details