{"answers":{"affected":"6 open source packages ship an affected version, including github.com/blevesearch/bleve and github.com/blevesearch/bleve/v2. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-31022 in the wild and no public exploit code.","fix":"Upgrade to a fixed version.","what":"CVE-2022-31022 is a medium-severity missing authorization vulnerability in blevesearch bleve, published on 1 Jun 2022. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-31022 and fix it if it is affected.\n\nWhat it is: CVE-2022-31022 is a medium-severity missing authorization vulnerability in blevesearch bleve, published on 1 Jun 2022. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2022-31022 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/blevesearch/bleve (Go): affected all versions; no fix listed\n- github.com/blevesearch/bleve (Go): affected all versions up to 1.10.14; no fix listed\n- github.com/blevesearch/bleve (Go): affected all versions up to 1.10.14; no fix listed\n- github.com/blevesearch/bleve/v2 (Go): affected all versions; fixed in 2.5.0\n- github.com/blevesearch/bleve/v2 (Go): affected all versions; fixed in 2.5.0\n- github.com/blevesearch/bleve/v2 (Go): affected all versions; fixed in 2.5.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-31022/ (Markdown: https://insights.sbomify.com/CVE-2022-31022/index.md)","id":"CVE-2022-31022","markdown":"https://insights.sbomify.com/CVE-2022-31022/index.md","name":"CVE-2022-31022","record":{"aliases":["DEBIAN-CVE-2022-31022","GHSA-9w9f-6mg8-jp7w","GO-2022-0470","MINI-fg56-938j-xcpr","MINI-q4h9-chqh-5m28","MINI-w57p-f8jx-g5qq","UBUNTU-CVE-2022-31022"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_modify","denial_of_service"],"network_reachable":"adjacent_or_local","non_default_config":true,"product_category":"Go text indexing library","requires_auth":"none","summary":"Attackers can create or delete arbitrary directories on the server if the bleve/http package is used without additional access controls.","user_interaction":"not_required","vuln_class":"missing_authorization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"bleve","vendor":"couchbase"}],"cvss":{"score":6.2,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-306","name":"Missing Authentication for Critical Functionality"},{"id":"CWE-288","name":"Authentication Bypass Using an Alternate Path or Channel"}],"description":"Bleve is a text indexing library for go. Bleve includes HTTP utilities under bleve/http package, that are used by its sample application. These HTTP methods pave way for exploitation of a node’s filesystem where the bleve index resides, if the user has used bleve’s own HTTP (bleve/http) handlers for exposing the access to the indexes. For instance, the CreateIndexHandler (`http/index_create.go`) and DeleteIndexHandler (`http/index_delete.go`) enable an attacker to create a bleve index (directory structure) anywhere where the user running the server has the write permissions and to delete recursively any directory owned by the same user account. Users who have used the bleve/http package for exposing access to bleve index without the explicit \nhandling for the Role Based Access Controls(RBAC) of the index assets would be impacted by this issue. Version 2.5.0 relocated the `http/` dir used _only_ by bleve-explorer to `blevesearch/bleve-explorer`, thereby addressing the issue. However, the http package is purely intended to be used for demonstration purposes. Bleve was never designed handle the RBACs, nor it was ever advertised to be used in that way. The collaborators of this project have decided to stay away from adding any authentication or authorization to bleve project at the moment. The bleve/http package is mainly for demonstration purposes and it lacks exhaustive validation of the user inputs as well as any authentication and authorization measures. It is recommended to not use bleve/http in production use cases.","ecosystems":["Go"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Missing Role Based Access Control for the REST handlers in bleve/http package","id":"CVE-2022-31022","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Go","product":null,"products":[],"type":"missing_authorization","year":"2022"},"n_packages":6,"n_references":3,"next":{"headline":"Dev error stack trace leaking into prod in Play Framework","id":"CVE-2022-31023"},"packages":[{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":[],"package":"github.com/blevesearch/bleve","purl":"pkg:golang/github.com/blevesearch/bleve","source":"GO-2022-0470"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.10.14"],"package":"github.com/blevesearch/bleve","purl":null,"source":"GHSA-9w9f-6mg8-jp7w"},{"ecosystem":"Go","fixed":[],"introduced":["0"],"last_affected":["1.10.14"],"package":"github.com/blevesearch/bleve","purl":"pkg:golang/github.com/blevesearch/bleve","source":"GHSA-9w9f-6mg8-jp7w"},{"ecosystem":"Go","fixed":["2.5.0"],"introduced":["0"],"last_affected":[],"package":"github.com/blevesearch/bleve/v2","purl":null,"source":"GHSA-9w9f-6mg8-jp7w"},{"ecosystem":"Go","fixed":["2.5.0"],"introduced":["0"],"last_affected":[],"package":"github.com/blevesearch/bleve/v2","purl":"pkg:golang/github.com/blevesearch/bleve/v2","source":"GHSA-9w9f-6mg8-jp7w"},{"ecosystem":"Go","fixed":["2.5.0"],"introduced":["0"],"last_affected":[],"package":"github.com/blevesearch/bleve/v2","purl":"pkg:golang/github.com/blevesearch/bleve/v2","source":"GO-2022-0470"}],"prev":{"headline":"Unlinkability broken in ursa when verifiers use malicious keys","id":"CVE-2022-31021"},"products":["bleve"],"published":"2022-06-01","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-05-08","vendors":["blevesearch"]},"summary":"Attackers can create or delete arbitrary directories on the server if the bleve/http package is used without additional access controls.","url":"https://insights.sbomify.com/CVE-2022-31022/"}