Skip to content

Security: size_t overflow in jas_stream_peek #407

@xmoezzz

Description

@xmoezzz

Hi, I am writing to report a size_t overflow that I discovered in this project.

  1. Vulnerability Summary:
/root/build/jasper-4.2.8/src/libjasper/base/jas_stream.c:713:22: runtime error: unsigned integer overflow: 0 - 1 cannot be represented in type 'size_t' (aka 'unsigned long')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /root/build/jasper-4.2.8/src/libjasper/base/jas_stream.c:713:22 in
  1. Affected Version
    The latest release version 4.2.8.

  2. Reproduce

  • Command line:
jasper "--input" "A" "--output" "B" "--input-format" "pg" "--output-format" "jpc" "" ""
  • Compile the executable binary with "--fsanitizer=undefined" flag.
  • Corrupted input data A (unzip A.zip first):

A.zip

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions