REDHAT-BUG-2588723: Medium severity go/github.com/observatorium/api vulnerability

Published Dec 2, 2026
·
Updated

The LogQL v2 lexer in github.com/observatorium/api (logql/v2/lexer.go) enters an infinite loop with unbounded in-memory string growth when it scans a -- token that reaches end-of-input without trailing whitespace. In the case '-': branch, after confirming a following '-' via Peek, the flag-scanning loop's only exit condition is unicode.IsSpace(r); scanner.Scanner.Next() returns scanner.EOF (-1) at end-of-input, unicode.IsSpace(EOF) is false, and strings.Builder.WriteRune(EOF) appends utf8.RuneError, so the loop never terminates and repeatedly appends to the builder until the process is killed by memory exhaustion. Every other scanning loop in the same file carries an explicit EOF check; this branch alone omits it.

The defect was introduced by commit 8cb4f4d4a4c121130ca81e47964915f01a58d446 (2023-09-13, "Add support for features in Loki v2.9.0"), which added the --strict/--keep-empty flag tokens this code scans for. The latest tagged release is v0.1.2 (2021), which predates the introduction; all downstream consumption is via pseudo-version dependencies of unreleased main revisions from 2023-09-13 onward, and no fix exists upstream.

The parser is reachable from the request path: authorization/query.go passes caller-supplied URL query parameter values directly into logqlv2.ParseExpr for tenant label enforcement. In Red Hat products, the LokiStack gateway (openshift-logging/lokistack-gateway-rhel9, built from the observatorium/api source tree) is affected on OpenShift Logging 6.0, 6.2, 6.5, 6.6, and 6.7; an authenticated tenant submitting a crafted LogQL query can hang the gateway and exhaust memory until OOM, disrupting the logging query path for all tenants of the LokiStack. The backplane managed-scripts component (openshift-hosted-osd4) also bundles the vulnerable module.

Impact is availability only; no authorization bypass or information disclosure was identified in this defect. Remediation: add an EOF check to the flag-scanning loop, consistent with every other loop in the lexer.

Source report: PSIRTSUPT-32024. All claims independently verified against upstream sources at the cited commits.

Affected Software

4 affected components
go/github.com/observatorium/api
Red Hat OpenShift Logging=6.0, =6.2, =6.5, =6.6, =6.7
Red Hat LokiStack gateway
Red Hat openshift-hosted-osd4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Add an EOF check to the flag-scanning loop in logql/v2/lexer.go so it exits when scanner.Scanner.Next() returns scanner.EOF.

Event History

Dec 2, 2026
Data Sourced
via Red Hat·04:15 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What does an attacker need to send to trigger the issue?

The attacker must be able to provide LogQL input that contains a -- token reaching the end of input without trailing whitespace. The vulnerable lexer is reachable from the request path, so exposure depends on whether untrusted users can submit such LogQL queries.

2

Which versions are affected?

The defect was introduced in the unreleased main revision associated with commit 8cb4f4d4a4c121130ca81e47964915f01a58d446 on 2023-09-13. The latest tagged release, v0.1.2, predates the defect; affected downstream users consume pseudo-version dependencies based on main revisions from 2023-09-13 onward.

3

Is an upstream fix available?

No upstream fix exists according to the available data. Organizations using affected pseudo-version dependencies should identify and replace or remediate the vulnerable dependency when a corrected revision becomes available.

4

How can I determine whether my deployment is exposed?

Check whether the deployed component depends on github.com/observatorium/api through an unreleased pseudo-version based on a main revision from 2023-09-13 or later. Also determine whether users or external clients can submit LogQL request input to the affected request path.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203