Skip to content

Fix for CVE-2021-31232: Alertmanager can expose local files content via specially crafted config #4129

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

Merged

Conversation

pracucci
Copy link
Contributor

What this PR does:
This is the public PR for the CVE-2021-31232 fix.

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Added HTTP and TLS validation
Use reflection to scan alertmanager config for validation
Do not allow SlackAPIURLFile, APIURLFile, APIKeyFile and ProxyURL too

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@pstibrany pstibrany merged commit 5fc0350 into cortexproject:master Apr 27, 2021
@pracucci pracucci deleted the fix-alertmanager-template-validation branch April 27, 2021 13:02
@alanprot
Copy link
Member

alanprot commented May 5, 2022

Hi @pracucci :D One last question? :D

Is there a specific reason to block proxy_url from the receivers due this CVE?
We are allowing to set other URLs anyway, like the slack or OpsGenie URL, right? So seems that setting up the proxy should be the same?

@alvinlin123 , thoughts?

@pracucci
Copy link
Contributor Author

pracucci commented May 5, 2022

Is there a specific reason to block proxy_url from the receivers due this CVE?

I don't remember the details, sorry, but at that time we decided to block all proxy URLs because we thought they could be potentially exploited (but we didn't investigated deeply, maybe was just paranoid).

@alvinlin123
Copy link
Contributor

We should re-enable proxy_url. if today proxy_url has security, then the issue needs to be fixed at the Prometheus' alert manager repo because proxy_url is a config supported by Prometheus alert manager.

My guess for the paranoid that Marco mentioned is because with issue like CVE-2021-31232, proxy_url add to the risk because hackers have more place to hack and gain access to Cortex's local file. But without CVE-2021-31232 there is no risk of enable proxy_url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants