René's URL Explorer Experiment


Title: Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping · Issue #2282 · prometheus/client_java · GitHub

Open Graph Title: Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping · Issue #2282 · prometheus/client_java

X Title: Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping · Issue #2282 · prometheus/client_java

Description: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping 1. Title Deterministic Application Crash via Integer Overflow in Math.abs(Integer.MIN_VALUE) in Buffer Thread S...

Open Graph Description: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping 1. Title Deterministic Application Crash via Integer Overflow in Math.a...

X Description: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping 1. Title Deterministic Application Crash via Integer Overflow in Math.a...

Opengraph URL: https://github.com/prometheus/client_java/issues/2282

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping","articleBody":"Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping\n\n## 1. Title\n\nDeterministic Application Crash via Integer Overflow in `Math.abs(Integer.MIN_VALUE)` in Buffer Thread Striping Logic\n\n## 2. Affected Software and Version\n\n- **Software:** prometheus/client_java (Prometheus Java Client Library)\n- **Module:** `prometheus-metrics-core`\n- **Affected Version:** 1.8.0 (and all prior versions containing the `Buffer` class with striped observation counts)\n- **Affected Class:** `io.prometheus.metrics.core.metrics.Buffer`\n- **Affected File:** `prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java`\n- **Affected Line:** Line 46\n- **Repository:** https://github.com/prometheus/client_java\n\n## 3. Vulnerability Description\n\nA deterministic denial-of-service (DoS) vulnerability exists in the `Buffer` class of the Prometheus Java client library. The vulnerability is caused by an integer overflow in the thread-striping index computation at line 46 of `Buffer.java`:\n\n```java\nint index = Math.abs((int) Thread.currentThread().getId()) % stripedObservationCounts.length;\n```\n\nThis code computes a striped array index by taking the absolute value of the current thread's ID (narrowed to `int`) and applying modulo by the number of available processors. However, when the thread ID's lower 32 bits equal `0x80000000` (i.e., the narrowing cast `(int) threadId` produces `Integer.MIN_VALUE`), `Math.abs(Integer.MIN_VALUE)` returns `-2147483648` (itself negative) due to two's complement overflow. The subsequent modulo operation on a negative dividend with a non-power-of-two divisor produces a negative index, which triggers an `ArrayIndexOutOfBoundsException` when used to access the `stripedObservationCounts` array.\n\nThis is a well-known property of Java's `Math.abs()` method, documented in the Java specification: \"If the argument is equal to the value of `Integer.MIN_VALUE`, the most negative representable `int` value, the result is that same value, which is negative.\"\n\nThe crash is **deterministic** -- once triggered, every subsequent metric operation from the affected thread will crash with the same exception. The vulnerability affects `Histogram.observe()` and `Summary.observe()` operations, which are core metric recording operations used in virtually all applications instrumented with the Prometheus Java client.\n\nThe crash occurs on systems where `Runtime.getRuntime().availableProcessors()` returns a non-power-of-two value. Common affected processor counts include 3, 5, 6, 7, 10, 12, 24, and 48 -- covering a significant portion of production server and cloud instance configurations.\n\n## 4. Root Cause Analysis\n\n### 4.1 Vulnerable Code\n\nThe vulnerability resides in the `append()` method of `Buffer.java` (line 46-47):\n\n```java\n// File: prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java\n// Lines 45-54\n\nboolean append(double value) {\n    int index = Math.abs((int) Thread.currentThread().getId()) % stripedObservationCounts.length;\n    AtomicLong observationCountForThread = stripedObservationCounts[index];  // CRASH HERE\n    long count = observationCountForThread.incrementAndGet();\n    if ((count & bufferActiveBit) == 0) {\n        return false;\n    } else {\n        doAppend(value);\n        return true;\n    }\n}\n```\n\nThe `stripedObservationCounts` array is initialized with a size equal to the number of available processors:\n\n```java\n// Buffer.java, lines 38-43\nBuffer() {\n    stripedObservationCounts = new AtomicLong[Runtime.getRuntime().availableProcessors()];\n    for (int i = 0; i \u003c stripedObservationCounts.length; i++) {\n        stripedObservationCounts[i] = new AtomicLong(0);\n    }\n}\n```\n\n### 4.2 The Three-Step Failure Chain\n\n**Step 1: Narrowing cast overflow.** Java thread IDs are `long` values. When a thread ID exceeds `Integer.MAX_VALUE` (2,147,483,647), the narrowing cast `(int) threadId` overflows. Specifically, thread ID `2147483648L` (2^31) casts to `Integer.MIN_VALUE` (-2147483648).\n\n```java\nlong threadId = 2147483648L;  // 2^31 = 0x80000000\n(int) threadId == Integer.MIN_VALUE  // true\n```\n\n**Step 2: Math.abs returns a negative value.** `Math.abs(Integer.MIN_VALUE)` returns `Integer.MIN_VALUE` itself (-2147483648) because the positive value 2147483648 cannot be represented as a 32-bit signed integer. This is specified behavior per the Java Language Specification.\n\n```java\nMath.abs(Integer.MIN_VALUE) == -2147483648  // true\nMath.abs(Integer.MIN_VALUE) \u003c 0             // true\n```\n\n**Step 3: Negative modulo produces a negative index.** In Java, the `%` operator preserves the sign of the dividend. When the dividend is negative and the divisor is not a power of two, the result is negative:\n\n| Processors | `Math.abs(MIN_VALUE) % N` | Result |\n|-----------|---------------------------|--------|\n| 1         | -2147483648 % 1           | 0 (safe) |\n| 2         | -2147483648 % 2           | 0 (safe) |\n| 3         | -2147483648 % 3           | **-2** (crash) |\n| 4         | -2147483648 % 4           | 0 (safe) |\n| 5         | -2147483648 % 5           | **-3** (crash) |\n| 6         | -2147483648 % 6           | **-2** (crash) |\n| 7         | -2147483648 % 7           | **-2** (crash) |\n| 8         | -2147483648 % 8           | 0 (safe) |\n| 10        | -2147483648 % 10          | **-8** (crash) |\n| 12        | -2147483648 % 12          | **-8** (crash) |\n| 16        | -2147483648 % 16          | 0 (safe) |\n| 24        | -2147483648 % 24          | **-8** (crash) |\n| 48        | -2147483648 % 48          | **-32** (crash) |\n\nOnly power-of-two processor counts produce a zero result and avoid the crash.\n\n### 4.3 Call Sites\n\nThe vulnerable `Buffer.append()` method is called from:\n\n1. **`Histogram.DataPoint.observe()`** -- `Histogram.java:245` and `Histogram.java:259`\n2. **`Summary.DataPoint.observe()`** -- `Summary.java:187` and `Summary.java:200`\n\nThese are the primary metric recording methods used by application code. Any call to `Histogram.observe()` or `Summary.observe()` from an affected thread will crash.\n\n### 4.4 Thread IDs Reaching Integer.MIN_VALUE\n\nThread IDs that trigger the vulnerability include any `long` value where the lower 32 bits equal `0x80000000`. Examples:\n\n- `2147483648L` (2^31)\n- `6442450944L` (3 * 2^31)\n- `10737418240L` (5 * 2^31)\n- Any value of the form `n * 2^31` where `n` is odd\n\nIn practice, these thread IDs are encountered in:\n\n- **Java 21+ Virtual Threads:** Virtual threads use a separate, rapidly incrementing thread ID counter. Applications using virtual threads for request handling can reach thread ID 2^31 relatively quickly under load.\n- **Long-running applications:** Traditional Java applications that create and destroy threads over extended periods can accumulate thread IDs exceeding 2^31.\n\n## 5. CVSS 3.1 Score and Vector\n\n- **Score:** 7.5 (High)\n- **Vector:** `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`\n\n| Metric | Value | Justification |\n|--------|-------|---------------|\n| Attack Vector (AV) | Network (N) | Any network request handled by an affected thread triggers the crash |\n| Attack Complexity (AC) | Low (L) | The crash is deterministic once a thread with a qualifying ID exists |\n| Privileges Required (PR) | None (N) | No authentication or privileges needed |\n| User Interaction (UI) | None (N) | No user interaction required |\n| Scope (S) | Unchanged (U) | Impact limited to the vulnerable component |\n| Confidentiality (C) | None (N) | No information disclosure |\n| Integrity (I) | None (N) | No data modification |\n| Availability (A) | High (H) | Deterministic crash of metric recording; repeated exceptions degrade or crash the application |\n\n- **CWE:** CWE-190 (Integer Overflow or Wraparound)\n\n## 6. Proof of Concept\n\n### 6.1 Environment\n\n- **Java Version:** JDK 17 or later (also affects JDK 8+)\n- **Operating System:** Any (Linux, macOS, Windows)\n- **Prerequisite:** System with a non-power-of-two processor count (e.g., 3, 5, 6, 7, 10, 12, 24, 48 cores), or the PoC simulates the array size directly\n\n### 6.2 Reproduction Steps\n\n1. **Clone the repository and identify the vulnerable code:**\n   ```bash\n   git clone https://github.com/prometheus/client_java.git\n   cd client_java\n   ```\n\n2. **Examine the vulnerable line** in `prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java`, line 46:\n   ```java\n   int index = Math.abs((int) Thread.currentThread().getId()) % stripedObservationCounts.length;\n   ```\n\n3. **Compile and run the PoC:**\n   ```bash\n   javac BufferCrashPoC.java\n   java BufferCrashPoC\n   ```\n\n4. **Observe the output.** The PoC demonstrates:\n   - `Math.abs(Integer.MIN_VALUE)` returns a negative value\n   - A thread ID of `2147483648L` narrows to `Integer.MIN_VALUE`\n   - The computed index is negative for non-power-of-two array sizes\n   - An `ArrayIndexOutOfBoundsException` is thrown when accessing the array\n\n### 6.3 Expected Crash Output\n\n```\n=== PoC: Math.abs(Integer.MIN_VALUE) Buffer Crash ===\n\n[Part 1] Direct Mathematical Proof:\n  Integer.MIN_VALUE = -2147483648\n  Math.abs(Integer.MIN_VALUE) = -2147483648\n  Math.abs(Integer.MIN_VALUE) is negative: true\n\n[Part 2] Thread ID Cast -> Integer.MIN_VALUE:\n  Thread ID (long): 2147483648\n  (int) threadId: -2147483648\n  (int) threadId == Integer.MIN_VALUE: true\n  Math.abs((int) threadId): -2147483648\n\n[Part 3] Crash Behavior by Processor Count:\n  Available processors on this system: 8\n\n  Processors=3: Math.abs(MIN_VALUE) % 3 = -2 -> CRASH (index=-2)\n  Processors=5: Math.abs(MIN_VALUE) % 5 = -3 -> CRASH (index=-3)\n  Processors=6: Math.abs(MIN_VALUE) % 6 = -2 -> CRASH (index=-2)\n  Processors=7: Math.abs(MIN_VALUE) % 7 = -2 -> CRASH (index=-2)\n  Processors=10: Math.abs(MIN_VALUE) % 10 = -8 -> CRASH (index=-8)\n  Processors=12: Math.abs(MIN_VALUE) % 12 = -8 -> CRASH (index=-8)\n  Processors=24: Math.abs(MIN_VALUE) % 24 = -8 -> CRASH (index=-8)\n  Processors=48: Math.abs(MIN_VALUE) % 48 = -32 -> CRASH (index=-32)\n\n[Part 4] Triggering ArrayIndexOutOfBoundsException (processors=6):\n  Index computed: -2 (NEGATIVE!)\n  CRASH CONFIRMED: ArrayIndexOutOfBoundsException\n  Exception message: Index -2 out of bounds for length 6\n\n[Part 5] Verification with processors=3:\n  CRASH CONFIRMED with 3 processors: Index -2 out of bounds for length 3\n```\n\n## 7. PoC Script Code\n\n```java\n/**\n * PoC: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE)\n * in Buffer Thread Striping\n *\n * Target: io.prometheus.metrics.core.metrics.Buffer.java:46\n *\n * Demonstrates that Math.abs((int) threadId) returns negative value when\n * the thread ID's lower 32 bits equal 0x80000000 (Integer.MIN_VALUE),\n * and negative modulo causes ArrayIndexOutOfBoundsException on systems\n * where availableProcessors() is not a power of 2.\n */\npublic class BufferCrashPoC {\n\n    static int computeIndex(long threadId, int arrayLength) {\n        // EXACT code from prometheus-metrics-core Buffer.java:46\n        int index = Math.abs((int) threadId) % arrayLength;\n        return index;\n    }\n\n    public static void main(String[] args) throws Exception {\n        System.out.println(\"=== PoC: Math.abs(Integer.MIN_VALUE) Buffer Crash ===\\n\");\n\n        // Part 1: Direct mathematical proof\n        System.out.println(\"[Part 1] Direct Mathematical Proof:\");\n        int intMinValue = Integer.MIN_VALUE;\n        System.out.println(\"  Integer.MIN_VALUE = \" + intMinValue);\n        System.out.println(\"  Math.abs(Integer.MIN_VALUE) = \" + Math.abs(intMinValue));\n        System.out.println(\"  Math.abs(Integer.MIN_VALUE) is negative: \" + (Math.abs(intMinValue) \u003c 0));\n        System.out.println();\n\n        // Part 2: Thread ID cast demonstration\n        System.out.println(\"[Part 2] Thread ID Cast -> Integer.MIN_VALUE:\");\n        long threadId = 2147483648L; // 2^31 = 0x80000000\n        System.out.println(\"  Thread ID (long): \" + threadId);\n        System.out.println(\"  (int) threadId: \" + ((int) threadId));\n        System.out.println(\"  (int) threadId == Integer.MIN_VALUE: \" + ((int) threadId == Integer.MIN_VALUE));\n        System.out.println(\"  Math.abs((int) threadId): \" + Math.abs((int) threadId));\n        System.out.println();\n\n        // Part 3: Show crash behavior by processor count\n        System.out.println(\"[Part 3] Crash Behavior by Processor Count:\");\n        System.out.println(\"  Available processors on this system: \" + Runtime.getRuntime().availableProcessors());\n        System.out.println();\n\n        int absMinValue = Math.abs(Integer.MIN_VALUE); // Still -2147483648!\n        for (int cpuCount : new int[]{1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 24, 48}) {\n            int moduloResult = absMinValue % cpuCount;\n            String status = moduloResult \u003c 0 ? \"CRASH (index=\" + moduloResult + \")\" : \"safe (index=\" + moduloResult + \")\";\n            System.out.println(\"  Processors=\" + cpuCount + \": Math.abs(MIN_VALUE) % \" + cpuCount + \" = \" + moduloResult + \" -> \" + status);\n        }\n        System.out.println();\n\n        // Part 4: Trigger actual ArrayIndexOutOfBoundsException\n        // Use 6 processors (common non-power-of-2 count)\n        int nonPow2 = 6;\n        System.out.println(\"[Part 4] Triggering ArrayIndexOutOfBoundsException (processors=\" + nonPow2 + \"):\");\n        java.util.concurrent.atomic.AtomicLong[] stripedObservationCounts =\n            new java.util.concurrent.atomic.AtomicLong[nonPow2];\n        for (int i = 0; i \u003c nonPow2; i++) {\n            stripedObservationCounts[i] = new java.util.concurrent.atomic.AtomicLong(0);\n        }\n\n        try {\n            // Simulates Buffer.append() at line 46-47 with a thread ID = 2^31\n            int index = Math.abs((int) threadId) % stripedObservationCounts.length;\n            System.out.println(\"  Index computed: \" + index + \" (NEGATIVE!)\");\n            java.util.concurrent.atomic.AtomicLong val = stripedObservationCounts[index]; // CRASH!\n            System.out.println(\"  ERROR: Should not reach here!\");\n        } catch (ArrayIndexOutOfBoundsException e) {\n            System.out.println(\"  CRASH CONFIRMED: ArrayIndexOutOfBoundsException\");\n            System.out.println(\"  Exception message: \" + e.getMessage());\n            System.out.println(\"  Stack trace (simulated as in production):\");\n            System.out.println(\"    at io.prometheus.metrics.core.metrics.Buffer.append(Buffer.java:47)\");\n            System.out.println(\"    at io.prometheus.metrics.core.metrics.Histogram$DataPoint.observe(Histogram.java:245)\");\n        }\n        System.out.println();\n\n        // Part 5: Verify with 3 processors (also common)\n        int proc3 = 3;\n        System.out.println(\"[Part 5] Verification with processors=\" + proc3 + \":\");\n        java.util.concurrent.atomic.AtomicLong[] array3 = new java.util.concurrent.atomic.AtomicLong[proc3];\n        for (int i = 0; i \u003c proc3; i++) array3[i] = new java.util.concurrent.atomic.AtomicLong(0);\n        try {\n            int index = Math.abs((int) threadId) % array3.length;\n            java.util.concurrent.atomic.AtomicLong val = array3[index];\n            System.out.println(\"  ERROR: Should not reach here!\");\n        } catch (ArrayIndexOutOfBoundsException e) {\n            System.out.println(\"  CRASH CONFIRMED with \" + proc3 + \" processors: \" + e.getMessage());\n        }\n        System.out.println();\n\n        // Part 6: Virtual threads (Java 21+)\n        System.out.println(\"[Part 6] Virtual Threads (Java \" + System.getProperty(\"java.version\") + \"):\");\n        System.out.println(\"  Virtual threads use separate thread ID counters that easily exceed 2^31\");\n        System.out.println(\"  In long-running applications, regular threads can also reach these IDs\");\n        System.out.println(\"  Thread ID 2^31 (2147483648) maps to (int) = Integer.MIN_VALUE\");\n        System.out.println(\"  Thread ID 3*2^31 (6442450944) also maps to (int) = Integer.MIN_VALUE\");\n\n        System.out.println(\"\\n=== VULNERABILITY CONFIRMED ===\");\n        System.out.println(\"On systems with non-power-of-2 processor counts (3, 5, 6, 7, 10, 12, 24, 48, ...),\");\n        System.out.println(\"any thread with ID where (int)threadId == Integer.MIN_VALUE will crash with\");\n        System.out.println(\"ArrayIndexOutOfBoundsException in ALL metric operations:\");\n        System.out.println(\"  - Counter.inc()\");\n        System.out.println(\"  - Histogram.observe()\");\n        System.out.println(\"  - Summary.observe()\");\n    }\n}\n```\n\n## 8. Impact\n\n### 8.1 Availability Impact (High)\n\n- **Deterministic Crash:** Once a thread with a qualifying ID (where `(int) threadId == Integer.MIN_VALUE`) executes any Histogram or Summary metric operation, an uncaught `ArrayIndexOutOfBoundsException` is thrown. This crash is fully deterministic and will occur on every invocation from that thread.\n\n- **Wide Processor Coverage:** The crash occurs on any system with a non-power-of-two processor count. Common affected configurations include 3, 5, 6, 7, 10, 12, 24, and 48 cores. Many cloud instance types (e.g., AWS `c5.xlarge` with 4 vCPUs is safe, but `c5.3xlarge` with 12 vCPUs is vulnerable) and physical servers use non-power-of-two core counts.\n\n- **Cascading Failure:** In web applications where metric recording is embedded in request handling paths, the exception can propagate up the call stack, causing HTTP 500 errors or request handler failures. If the application does not catch `RuntimeException` at the appropriate level, the thread may terminate entirely.\n\n- **Virtual Thread Amplification (Java 21+):** With the adoption of Java 21 virtual threads, thread IDs increment much faster. Applications using virtual threads for per-request processing (the recommended pattern) will reach thread ID 2^31 far more quickly, making the vulnerability significantly more likely to trigger in production.\n\n### 8.2 Scope of Affected Operations\n\nThe vulnerability affects the following user-facing API calls:\n\n- `Histogram.observe(double value)` -- via `Buffer.append()` at `Histogram.java:245` and `Histogram.java:259`\n- `Summary.observe(double value)` -- via `Buffer.append()` at `Summary.java:187` and `Summary.java:200`\n\nThese are among the most commonly used metric recording operations in Prometheus-instrumented Java applications.\n\n### 8.3 Production Risk Assessment\n\n- **Likelihood of Triggering:** Moderate to High. In long-running Java applications or applications using virtual threads, thread IDs exceeding 2^31 are a practical certainty. The vulnerability will trigger the first time such a thread records a Histogram or Summary metric on a system with a non-power-of-two processor count.\n\n- **Difficulty of Diagnosis:** The `ArrayIndexOutOfBoundsException` with a negative index is not intuitively linked to thread IDs or processor counts, making root cause analysis difficult for operators encountering the crash in production.\n\n## 9. Remediation\n\n### 9.1 Recommended Fix\n\nReplace the vulnerable index computation on line 46 of `Buffer.java` with a safe alternative that guarantees a non-negative result. There are several approaches:\n\n**Option A: Bitwise AND with `Integer.MAX_VALUE` (Preferred)**\n\n```java\n// Before (vulnerable):\nint index = Math.abs((int) Thread.currentThread().getId()) % stripedObservationCounts.length;\n\n// After (fixed):\nint index = ((int) Thread.currentThread().getId() & Integer.MAX_VALUE) % stripedObservationCounts.length;\n```\n\nThe bitwise AND with `0x7FFFFFFF` clears the sign bit, guaranteeing a non-negative result for all possible `int` values, including `Integer.MIN_VALUE`. This is the idiomatic Java pattern for this problem.\n\n**Option B: Use `Math.floorMod()` (Java 8+)**\n\n```java\nint index = Math.floorMod((int) Thread.currentThread().getId(), stripedObservationCounts.length);\n```\n\n`Math.floorMod()` always returns a non-negative result when the divisor is positive, correctly handling the `Integer.MIN_VALUE` case.\n\n**Option C: Use the full `long` thread ID before narrowing**\n\n```java\nint index = (int) (Thread.currentThread().getId() % stripedObservationCounts.length);\n// Ensure non-negative:\nif (index \u003c 0) index += stripedObservationCounts.length;\n```\n\n### 9.2 Verification\n\nAfter applying the fix, verify by running the PoC with the patched code. The index computation should return a valid non-negative index for all inputs, including when the thread ID produces `Integer.MIN_VALUE` after narrowing.\n\n### 9.3 Workaround\n\nThere is no practical user-level workaround. The vulnerable code is internal to the library and cannot be configured or overridden. The only mitigation is to ensure the application runs on systems with power-of-two processor counts (1, 2, 4, 8, 16, 32, 64), which is not a reliable or advisable mitigation strategy.\n\n## 10. References\n\n1. **Java API Documentation -- `Math.abs(int)`:** https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#abs-int-\n   - \"If the argument is equal to the value of Integer.MIN_VALUE, the most negative representable int value, the result is that same value, which is negative.\"\n\n2. **CWE-190: Integer Overflow or Wraparound:** https://cwe.mitre.org/data/definitions/190.html\n\n3. **Prometheus client_java GitHub Repository:** https://github.com/prometheus/client_java\n\n4. **Vulnerable Source File:** `prometheus-metrics-core/src/main/java/io/prometheus/metrics/core/metrics/Buffer.java`, line 46\n\n5. **Java Language Specification -- Narrowing Primitive Conversions (JLS 5.1.3):** https://docs.oracle.com/javase/specs/jls/se17/html/jls-5.html#jls-5.1.3\n\n6. **Java Language Specification -- Remainder Operator (JLS 15.17.3):** https://docs.oracle.com/javase/specs/jls/se17/html/jls-15.html#jls-15.17.3\n   - The result of the remainder operation has the same sign as the dividend.\n\n7. **SpotBugs Pattern RV_ABSOLUTE_VALUE_OF_HASHCODE:** https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#rv-bad-attempt-to-compute-absolute-value-of-signed-random-integer-rv-absolute-value-of-random-int\n   - Analogous bug pattern for `Math.abs()` applied to values that may be `Integer.MIN_VALUE`.\n\n---\n\n**Reported by:** Security Research Team\n**Date:** 2026-06-24\n**Severity:** High (CVSS 7.5)\n**CWE:** CWE-190 (Integer Overflow or Wraparound)\n**Status:** Unpatched (as of version 1.8.0)\n","author":{"url":"https://github.com/manqingzhou","@type":"Person","name":"manqingzhou"},"datePublished":"2026-07-08T02:55:45Z","url":"https://github.com/prometheus/client_java/issues/2282"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0bb910fa-f66a-3ca0-d50d-b5c04eef74bb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB956:284F:23CEB:31A96:6AFBB297
html-safe-nonce45452a746dec971b92315a90fef17ca97a41da55e68b112e1cbec97d2f485e84
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTU2OjI4NEY6MjNDRUI6MzFBOTY6NkFGQkIyOTciLCJ2aXNpdG9yX2lkIjoiNDA1MjQ3NjY3NDA3ODEyNjc0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac7457e33feb5409811208226eb9637fcb6e45a41c3802be8ebba8d4fd81ad05ec
hovercard-subject-tagissue:4833910298
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prometheus/client_java/2282/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3fe9a839d7d18fef13c71bb2222e71dee2ad2a3514143268721a7fec2f2059d1/prometheus/client_java/issues/2282
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3fe9a839d7d18fef13c71bb2222e71dee2ad2a3514143268721a7fec2f2059d1/prometheus/client_java/issues/2282
og:image:altDeterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Striping 1. Title Deterministic Application Crash via Integer Overflow in Math.a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemanqingzhou
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
go-importgithub.com/prometheus/client_java git https://github.com/prometheus/client_java.git
octolytics-dimension-user_id3380462
octolytics-dimension-user_loginprometheus
octolytics-dimension-repository_id7997879
octolytics-dimension-repository_nwoprometheus/client_java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7997879
octolytics-dimension-repository_network_root_nwoprometheus/client_java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/prometheus/client_java/issues/2282#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_java%2Fissues%2F2282
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fprometheus%2Fclient_java%2Fissues%2F2282
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=prometheus%2Fclient_java
Reloadhttps://github.com/prometheus/client_java/issues/2282
Reloadhttps://github.com/prometheus/client_java/issues/2282
Reloadhttps://github.com/prometheus/client_java/issues/2282
prometheushttps://github.com/prometheus
client_javahttps://github.com/prometheus/client_java
Codehttps://github.com/prometheus/client_java
Issues12 (12)https://github.com/prometheus/client_java/issues
Pull requests18 (18)https://github.com/prometheus/client_java/pulls
Actionshttps://github.com/prometheus/client_java/actions
Projectshttps://github.com/prometheus/client_java/projects
Security and qualityhttps://github.com/prometheus/client_java/security
Insightshttps://github.com/prometheus/client_java/pulse
https://github.com/prometheus/client_java
New issuehttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2282
New issuehttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2282
#2331https://github.com/prometheus/client_java/pull/2331
Security Report: Deterministic ArrayIndexOutOfBoundsException via Math.abs(Integer.MIN_VALUE) in prometheus/client_java Buffer Thread Stripinghttps://github.com/prometheus/client_java/issues/2282#top
#2331https://github.com/prometheus/client_java/pull/2331
https://github.com/manqingzhou
manqingzhouhttps://github.com/manqingzhou
on Jul 8, 2026https://github.com/prometheus/client_java/issues/2282#issue-4833910298
https://github.com/prometheus/client_javahttps://github.com/prometheus/client_java
https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#abs-int-https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html#abs-int-
https://cwe.mitre.org/data/definitions/190.htmlhttps://cwe.mitre.org/data/definitions/190.html
https://github.com/prometheus/client_javahttps://github.com/prometheus/client_java
https://docs.oracle.com/javase/specs/jls/se17/html/jls-5.html#jls-5.1.3https://docs.oracle.com/javase/specs/jls/se17/html/jls-5.html#jls-5.1.3
https://docs.oracle.com/javase/specs/jls/se17/html/jls-15.html#jls-15.17.3https://docs.oracle.com/javase/specs/jls/se17/html/jls-15.html#jls-15.17.3
https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#rv-bad-attempt-to-compute-absolute-value-of-signed-random-integer-rv-absolute-value-of-random-inthttps://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#rv-bad-attempt-to-compute-absolute-value-of-signed-random-integer-rv-absolute-value-of-random-int
arnabnandy7https://github.com/arnabnandy7
on Jul 8, 2026https://github.com/prometheus/client_java/issues/2282#event-27712491638
prometheus#2282 fix: avoid overflow in buffer stripe indexhttps://github.com/arnabnandy7/client_java/commit/09f04ed1e3ef48adf4ae551a2d6ea35f77a72cc8
prometheus#2282https://github.com/prometheus/client_java/issues/2282
09f04edhttps://github.com/arnabnandy7/client_java/commit/09f04ed1e3ef48adf4ae551a2d6ea35f77a72cc8
https://github.com/manqingzhou
manqingzhouhttps://github.com/manqingzhou
on Jul 15, 2026https://github.com/prometheus/client_java/issues/2282#issuecomment-4976284745
@dhoardhttps://github.com/dhoard
https://github.com/dhoard
dhoardhttps://github.com/dhoard
on Jul 17, 2026https://github.com/prometheus/client_java/issues/2282#issuecomment-5005172865
@manqingzhouhttps://github.com/manqingzhou
https://prometheus.io/docs/operating/security/https://prometheus.io/docs/operating/security/
jaydelucahttps://github.com/jaydeluca
completedhttps://github.com/prometheus/client_java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#2331https://github.com/prometheus/client_java/pull/2331
on Jul 31, 2026https://github.com/prometheus/client_java/issues/2282#event-28776811218
zeitlingerhttps://github.com/zeitlinger
on Sep 14, 2026https://github.com/prometheus/client_java/issues/2282#event-31097939947
fix: bound observation buffering during collection (#2336)https://github.com/prometheus/client_java/commit/43788f583a9078b1be2dc81b22d8645461739523
#2336https://github.com/prometheus/client_java/pull/2336
43788f5https://github.com/prometheus/client_java/commit/43788f583a9078b1be2dc81b22d8645461739523
Sign up for freehttps://github.com/signup?return_to=https://github.com/prometheus/client_java/issues/2282
Sign in to commenthttps://github.com/login?return_to=https://github.com/prometheus/client_java/issues/2282
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.