Skip to content

[BUG] ISM types lastUpdatedTime is susceptible to int overflow #1898

Open

Description

@nmck257

What is the bug?

Policy and IsmTemplate have fields called lastUpdatedTime, stored as an Integer.
These fields get epoch millis as their values, which are larger than MAX_INTEGER.

How can one reproduce the bug?

Use OpenSearchIsmClient and try to GET a policy.

What is the expected behavior?

Successful GET, successful deserialization.

What is your host/environment?

Windows 11, opensearch-java 3.6.0

Do you have any screenshots?

N/A

Do you have any additional context?

If using a JacksonJsonpMapper, then I get an exception like this:

Caused by: com.fasterxml.jackson.core.exc.InputCoercionException: Numeric value (1772134315305) out of range of int (-2147483648 - 2147483647)
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 253]

Using Jackson config like DeserializationFeature.USE_BIG_INTEGER_FOR_INTS does not help, because the target type (eg Policy) explicitly has an an Integer type.

If using a JsonbJsonpMapper, then the value silently overflows and I get a negative timestamp.

Activity

  1. added
    bug
    on Feb 26, 2026
  2. added a commit that references this issue on Feb 27, 2026
    8397eff
  3. andrross commented on Mar 30, 2026

    @andrross
    Member
  4. added a commit that references this issue on May 9, 2026
    669d84e
  5. gingeekrishna commented on Jul 5, 2026

    @gingeekrishna
    Contributor

    Opened PR #2039 (same root cause as #1717). Fix adds format: int64 to the spec for IsmTemplate.last_updated_time and Policy.last_updated_time and updates the generated classes to Long/longDeserializer.

  6. sahasan95 commented on Jul 23, 2026

    @sahasan95

    Hi, I'd like to fix this. The issue is clear: lastUpdatedTime in Policy.java and IsmTemplate.java is typed as Integer but stores epoch milliseconds which overflow Integer.MAX_VALUE. The fix is to change the type to Long. I'll investigate whether this is in generated code and how to correctly make that change, then submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions