Repository navigation
Don't confirm Elasticsearch CRITICAL from an HTML mention - #44
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
GET / on port 9200 treated any 200 whose body contained "elasticsearch" or "cluster_name" as unauthenticated cluster access. Fusion pins probe findings, so a docker-mapped frontend or docs page became an un-droppable CRITICAL. Require a JSON object with a string cluster_name, matching the real ES/OpenSearch root document. Co-authored-by: dmitryflynn <dmitryflynn@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug and impact
check_elasticsearch_noauthconfirmed CRITICAL unauthenticated Elasticsearch access on any HTTP 200 whose body contained the substringelasticsearchorcluster_name.Port 9200 is in the default scan set, so this check always runs when that port is open. Fusion maps service-probe findings to
source=probe+reliability=high(cvss 9.5), which the gate pins as un-droppable.Trigger: Scan with
--probe/--full(or the GUI equivalent). A web frontend, status page, or docs site bound to :9200 — including a docker-compose port-map of a search UI onto 9200 — returns HTML/JS that mentions elasticsearch. The report then states the cluster is open with "full data exfiltration and arbitrary document write possible."Root cause
Confirmation was a case-insensitive substring match. JSON parse was best-effort and not required, unlike Docker/K8s/Vault probes in the same file which demand a distinctive parsed document.
Fix
Require HTTP 200 plus a JSON object with a non-empty string
cluster_name(the real Elasticsearch/OpenSearch GET / payload). HTML mentions, JSON arrays, and tagline-only objects no longer confirm. OpenSearch cluster root documents still confirm.Validation
python3 -m pytest test_probers.py::test_elasticsearch_detected_vs_auth test_probers.py::test_elasticsearch_html_mention_is_not_open_cluster test_probers.py::test_opensearch_json_root_still_confirms -v— 3 passedpython3 -m pytest test_*.py -q— 1754 passed, 5 skipped