Repository navigation
ti_threatconnect: fix precision loss of indicator IDs above 2^53 - #19110
Merged
Merged
Conversation
The ThreatConnect API returns indicator IDs as JSON numbers. When these exceed the IEEE 754 safe integer limit (2^53), the CEL program's decode_json() rounds them through float64, causing distinct IDs like 9007199254918487, 9007199254918488, and 9007199254918489 to all collapse to 9007199254918488. Replace decode_json() with decode_json_string_numbers() so that all JSON numbers are preserved as their literal string form. The ingest pipeline already uses convert processors with explicit type coercions for numeric fields, so string-valued numbers are handled correctly downstream. The minimum stack version is raised to 8.19.0/9.1.0, which is the first version shipping a mito release that includes the decode_json_string_numbers function. Fixes elastic#19109
Contributor
✅ Vale Linting ResultsNo issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
kcreddy
marked this pull request as ready for review
May 21, 2026 09:50
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
Contributor
🚀 Benchmarks reportTo see the full report comment with |
efd6
reviewed
May 21, 2026
| } | ||
| }))).do_request().as(resp, resp.StatusCode == 200 ? | ||
| bytes(resp.Body).decode_json().as(body, { | ||
| bytes(resp.Body).decode_json_string_numbers().as(body, { |
Contributor
There was a problem hiding this comment.
Suggested change
| bytes(resp.Body).decode_json_string_numbers().as(body, { | |
| resp.Body.decode_json_string_numbers().as(body, { |
| }, | ||
| { | ||
| "id": 736759, | ||
| "id": 9007199254918489, |
Contributor
There was a problem hiding this comment.
I think we might need a script test to ensure that this is being handled correctly; as it is, we don't know whether we're getting a numeric truncation.
Add a script test that verifies indicator IDs above 2^53 are preserved without float64 precision loss. The test mock returns two Address indicators with IDs 9007199254918487 and 9007199254918489 (both round to 9007199254918488 under IEEE 754 double-precision) and asserts that both distinct values appear in threat_connect.indicator.id after ingestion. Also remove the unnecessary bytes() wrapper from the decode_json_string_numbers call per review feedback.
💚 Build Succeeded
History
cc @kcreddy |
Contributor
|
Package ti_threatconnect - 2.1.1 containing this change is available at https://epr.elastic.co/package/ti_threatconnect/2.1.1/ |
1 of 3 tasks
tejasc-metron
pushed a commit
to metron-labs/Doppel-Elastic-Security-SIEM
that referenced
this pull request
May 25, 2026
…stic#19110) The ThreatConnect API returns indicator IDs as JSON numbers. When these exceed the IEEE 754 safe integer limit (2^53), the CEL program's decode_json() rounds them through float64, causing distinct IDs like 9007199254918487, 9007199254918488, and 9007199254918489 to all collapse to 9007199254918488. Replace decode_json() with decode_json_string_numbers() so that all JSON numbers are preserved as their literal string form. The ingest pipeline already uses convert processors with explicit type coercions for numeric fields, so string-valued numbers are handled correctly downstream. Add a script test that verifies indicator IDs above 2^53 are preserved correctly. The test mock returns two Address indicators whose IDs both round to the same float64 value and asserts that both distinct values appear in threat_connect.indicator.id after ingestion. The minimum stack version is raised to 8.19.0/9.1.0, which is the first version shipping a mito release that includes the decode_json_string_numbers function. Fixes elastic#19109
herrBez
pushed a commit
to herrBez/integrations
that referenced
this pull request
Jun 1, 2026
…stic#19110) The ThreatConnect API returns indicator IDs as JSON numbers. When these exceed the IEEE 754 safe integer limit (2^53), the CEL program's decode_json() rounds them through float64, causing distinct IDs like 9007199254918487, 9007199254918488, and 9007199254918489 to all collapse to 9007199254918488. Replace decode_json() with decode_json_string_numbers() so that all JSON numbers are preserved as their literal string form. The ingest pipeline already uses convert processors with explicit type coercions for numeric fields, so string-valued numbers are handled correctly downstream. Add a script test that verifies indicator IDs above 2^53 are preserved correctly. The test mock returns two Address indicators whose IDs both round to the same float64 value and asserts that both distinct values appear in threat_connect.indicator.id after ingestion. The minimum stack version is raised to 8.19.0/9.1.0, which is the first version shipping a mito release that includes the decode_json_string_numbers function. Fixes elastic#19109
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
changelog.ymlfile.How to test this PR locally
Added script test (with large numbers) passes.
Related issues
Screenshots
Before (

idis rounded)After (

idis precise)