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 files75Next files →

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

web/core/src/main/java/org/geoserver/web/wicket/WKTToCRSModel.java

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

import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.wicket.model.IModel;
import org.geotools.referencing.CRS;
import org.geotools.util.logging.Logging;
import org.opengis.referencing.crs.CoordinateReferenceSystem;

/**
 * A model allowing to edit an WKT property with the CRSPanel (by dynamically converting it into a
 * {@link CoordinateReferenceSystem} and back)
 */
@SuppressWarnings("serial")
public class WKTToCRSModel implements IModel<CoordinateReferenceSystem> {
    private static final Logger LOGGER = Logging.getLogger(WKTToCRSModel.class);
    IModel<String> srsModel;

    public WKTToCRSModel(IModel<String> srsModel) {
        this.srsModel = srsModel;
    }

    @Override
    public CoordinateReferenceSystem getObject() {
        String wkt = srsModel.getObject();
        try {
            return CRS.parseWKT(wkt);
        } catch (Exception e) {
            return null;
        }
    }

    @Override
    public void setObject(CoordinateReferenceSystem object) {
        CoordinateReferenceSystem crs = object;
        try {
            srsModel.setObject(crs.toString());
        } catch (Exception e) {
            LOGGER.log(Level.INFO, "Failed to lookup the SRS code for " + crs);
            srsModel.setObject(null);
        }
    }

    @Override
    public void detach() {
        srsModel.detach();
    }
}