CVE-2022-31022 Missing Role Based Access Control for the REST handlers in bleve/http package
Attackers can create or delete arbitrary directories on the server if the bleve/http package is used without additional access controls.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-31022?
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.
Official 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 handling 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.
Which versions are affected by CVE-2022-31022?
6 open source packages ship an affected version, including github.com/blevesearch/bleve and github.com/blevesearch/bleve/v2. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/blevesearch/bleve Go | All versions | None |
github.com/blevesearch/bleve Go | All versions to 1.10.14 | None |
github.com/blevesearch/bleve Go | All versions to 1.10.14 | None |
github.com/blevesearch/bleve/v2 Go | All versions | 2.5.0 |
github.com/blevesearch/bleve/v2 Go | All versions | 2.5.0 |
github.com/blevesearch/bleve/v2 Go | All versions | 2.5.0 |
Products include Couchbase Bleve.
How do I fix CVE-2022-31022?
Upgrade to a fixed version.
Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.
Is CVE-2022-31022 being exploited?
There is no known exploitation of CVE-2022-31022 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2022-31022, GHSA-9w9f-6mg8-jp7w, GO-2022-0470, MINI-fg56-938j-xcpr, MINI-q4h9-chqh-5m28, MINI-w57p-f8jx-g5qq and 1 more.