Exploit database

GH-9a017fa45abc7e1f8f6ba6e1285cae54

iplayforsg/cve-2023-51444

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2023-51444

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files4

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

main/src/main/java/org/geoserver/jai/PassThroughTileFactory.java

Java · 1,990 bytes
/* (c) 2014 Open Source Geospatial Foundation - all rights reserved
 * (c) 2001 - 2010 OpenPlans
 * This code is licensed under the GPL 2.0 license, available at the root
 * application directory.
 */
package org.geoserver.jai;

import java.awt.Point;
import java.awt.image.Raster;
import java.awt.image.SampleModel;
import java.awt.image.WritableRaster;
import javax.media.jai.RasterFactory;
import javax.media.jai.TileFactory;
import javax.media.jai.TileRecycler;

/**
 * A pass-through recycling tile factory that does not cache tiles but simply creates new ones as
 * asked
 *
 * <p>It is crucial to avoid using the standard one when we don't want caching as it might pop-up
 * here and there otherwise.
 *
 * @author Simone Giannecchini - GeoSolutions
 */
class PassThroughTileFactory implements TileFactory, TileRecycler {

    /** Constructs a <code>RecyclingTileFactory</code>. */
    public PassThroughTileFactory() {}

    /** Returns <code>false</code> since we don't cache. */
    @Override
    public boolean canReclaimMemory() {
        return false;
    }

    /** Returns <code>false</code> since we don't cache. */
    @Override
    public boolean isMemoryCache() {
        return false;
    }

    /** Always returns -1, does not do used memory accounting */
    @Override
    public long getMemoryUsed() {
        return -1;
    }

    /** Clean up the cache. Noop. */
    @Override
    public void flush() {}

    /** Builds a new tile, creating it from scratch. */
    @Override
    public WritableRaster createTile(SampleModel sampleModel, Point location) {
        // sanity checks
        if (sampleModel == null) {
            throw new NullPointerException("sampleModel cannot be null");
        }
        if (location == null) {
            location = new Point(0, 0);
        }

        return RasterFactory.createWritableRaster(sampleModel, location);
    }

    /** Recycles the given tile. Noop. */
    @Override
    public void recycleTile(Raster tile) {}
}