VYPR
Medium severityOSV Advisory· Published Jan 27, 2026· Updated May 6, 2026

CVE-2026-24806

CVE-2026-24806

Description

Improper Control of Generation of Code ('Code Injection') vulnerability in liuyueyi quick-media (plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png modules). This vulnerability is associated with program files PNGImageEncoder.Java.

This issue affects quick-media: before v1.0.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
com.github.liuyueyi.media:batik-codec-fixMaven
<= 3.0.0

Affected products

1

Patches

1
29c078450ad2

Merge pull request #122 from simei2k/patch-1

1 file changed · +22 2
  • plugins/svg-plugin/batik-codec-fix/src/main/java/org/apache/batik/ext/awt/image/codec/png/PNGImageEncoder.java+22 2 modified
    @@ -89,8 +89,28 @@ public void write(byte[] b) throws IOException {
         }
     
         public void write(byte[] b, int off, int len) throws IOException {
    -        dos.write(b, off, len);
    -    }
    +       // Input validation
    +       if (b == null) {
    +           throw new NullPointerException();
    +       }
    +       
    +       if (off < 0 || len < 0 || off + len > b.length) {
    +           throw new ArrayIndexOutOfBoundsException();
    +       }
    +       
    +       // Original buffering logic
    +       while (len > 0) {
    +           int bytes = Math.min(segmentLength - bytesWritten, len);
    +           System.arraycopy(b, off, buffer, bytesWritten, bytes);
    +           off += bytes;
    +           len -= bytes;
    +           bytesWritten += bytes;
    +   
    +           if (bytesWritten == segmentLength) {
    +               flush();
    +           }
    +       }
    +   }
     
         public void write(int b) throws IOException {
             dos.write(b);
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.