Vulnerabilities in pkg:golang/github.com/blevesearch/bleve

PACKAGE
Advisory Identifier: GHSA-9w9f-6mg8-jp7w
Advisory Summary

CVE-2022-31022 is a MODERATE (CVSS 5.5) missing role based access control vulnerability (CWE-306: Missing Authentication for Critical Function) affecting Github.com/blevesearch/bleve libraries in the Go ecosystem. The issue involves missing role based access control for the rest handlers in bleve/http package. Remediation is available by upgrading affected packages to version 2.5.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/blevesearch/bleve

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/blevesearch/bleve. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9w9f-6mg8-jp7w CVE-2022-31022 MODERATE Missing Role Based Access Control for the REST handlers in bleve/http package

CVE-2022-31022 at a Glance

CVE Identifier CVE-2022-31022
GHSA Identifier GHSA-9w9f-6mg8-jp7w
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-306: Missing Authentication for Critical Function
Affected Product Github.com/blevesearch/bleve
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2022-31022

To remediate this vulnerability, upgrade all affected Github.com/blevesearch/bleve dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/blevesearch/bleve fixed: Latest secure release
Upgrade github.com/blevesearch/bleve to Latest secure release
github.com/blevesearch/bleve/v2 fixed: 2.5.0
Upgrade github.com/blevesearch/bleve/v2 to 2.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/blevesearch/bleve

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-31022, inspect your project dependencies for Github.com/blevesearch/bleve:

inspect dependencies for github.com/blevesearch/bleve

Analyze the terminal output to locate any version of Github.com/blevesearch/bleve in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-306: Missing Authentication for Critical Function, where the product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. In Github.com/blevesearch/bleve, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact _What kind of vulnerability is it? Who is impacted?_ Bleve includes HTTP utilities under bleve/http package, that are used by its sample application. (https://github.com/blevesearch/bleve-explorer) These HTTP methods paves 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. ### Patches _Has the problem been patched? What versions should users upgrade to?_ **No**. The http package is purely intended to be used for demonstration purposes. And bleve is never designed to be handling the RBACs or it was ever advertised to be used in that way. Hence the collaborators of this project have decided to stay away from adding any authentication or authorization to bleve project at the moment. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ 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. So it is recommended to not use that in production use cases. ### For more information If you have any questions or comments about this advisory: * Open an issue [here](https://github.com/blevesearch/bleve/issues). * Email us at [mailto:security@couchbase.com, fts-team@couchbase.com].

CVE-2022-31022 Affected Github.com/blevesearch/bleve Versions

2 component(s)
Fixed Versions:
2.5.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/blevesearch/bleve
Go
≤ 1.10.14
github.com/blevesearch/bleve/v2
Go
< 2.5.0
2.5.0

References

Frequently Asked Questions

What is CVE-2022-31022?
CVE-2022-31022 is a security vulnerability in Github.com/blevesearch/bleve involving Missing Role Based Access Control for the REST handlers in bleve/http package under CWE-306: Missing Authentication for Critical Function.
Which Github.com/blevesearch/bleve versions are affected?
Affected versions include releases prior to 2.5.0 across affected packages: github.com/blevesearch/bleve, github.com/blevesearch/bleve/v2.
What version fixes CVE-2022-31022?
Upgrading to 2.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/blevesearch/bleve affected?
Yes, github.com/blevesearch/bleve is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is github.com/blevesearch/bleve/v2 affected?
Yes, github.com/blevesearch/bleve/v2 is affected in releases prior to 2.5.0. Upgrade your dependency to 2.5.0 or later.
What is the CVSS score of CVE-2022-31022?
CVE-2022-31022 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2022-31022?
CVE-2022-31022 is classified under CWE-306: Missing Authentication for Critical Function (The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.).
How can I check Go dependencies for CVE-2022-31022?
Run the dependency tree command: 'inspect dependencies for github.com/blevesearch/bleve'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9w9f-6mg8-jp7w",
  "modified" : "2025-05-08T16:45:25Z",
  "published" : "2022-06-03T22:17:51Z",
  "aliases" : [ "CVE-2022-31022" ],
  "summary" : "Missing Role Based Access Control for the REST handlers in bleve/http package",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nBleve includes HTTP utilities under bleve/http package, that are used by its sample application. \n(https://github.com/blevesearch/bleve-explorer)\nThese HTTP methods paves way for exploitation of a node’s filesystem where the bleve index resides, \nif the user has used bleve’s own HTTP (bleve/http) handlers for exposing the access to the indexes. \nFor instance, the CreateIndexHandler (http/index_create.go) and DeleteIndexHandler (http/index_delete.go) \nenable an attacker to create a bleve index (directory structure) anywhere where the user running the server \nhas the write permissions and to delete recursively any directory owned by the same user account.\n \nUsers 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.\n\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\n**No**. The http package is purely intended to be used for demonstration purposes. \nAnd bleve is never designed to be handling the RBACs or it was ever advertised to be used in that way. \nHence the collaborators of this project have decided to stay away from adding any authentication or \nauthorization to bleve project at the moment.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nThe bleve/http package is mainly for demonstration purposes and it lacks exhaustive validation of the user \ninputs as well as any authentication and authorization measures. \nSo it is recommended to not use that in production use cases.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue [here](https://github.com/blevesearch/bleve/issues).\n* Email us at [mailto:security@couchbase.com, fts-team@couchbase.com].",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/blevesearch/bleve"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.10.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/blevesearch/bleve/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/blevesearch/bleve/security/advisories/GHSA-9w9f-6mg8-jp7w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31022"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/blevesearch/bleve/commit/1c7509d6a17d36f265c90b4e8f4e3a3182fe79ff"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/blevesearch/bleve/commit/af9e3111dadfedf9d30f0448506b4a57fecc8550"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0470"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/blevesearch/bleve"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-288", "CWE-306" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-03T22:17:51Z",
    "nvd_published_at" : "2022-06-01T20:15:00Z"
  }
}