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 files16

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

main/src/main/java/org/geoserver/ows/LocalWorkspaceURLMangler.java

Java · 1,562 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.ows;

import static org.geoserver.ows.util.ResponseUtils.stripRemainingPath;

import java.util.Map;

/**
 * Mangles service URL's based on teh presence of a {@link LocalWorkspace} and {@link
 * LocalPublished}.
 *
 * <p>When the local workspace and layer are present this mangler will turns urls of the form:
 *
 * <pre>
 *   /geoserver/wfs?...
 * </pre>
 *
 * into:
 *
 * <pre>
 *   /geoserver/&lt;localWorkspace&gt;/&lt;localLayer&gt;/wfs?...
 * </pre>
 *
 * @author Justin Deoliveira, OpenGeo
 */
public class LocalWorkspaceURLMangler implements URLMangler {

    /** the name/identifier of the ows: wfs, wms, wcs, etc... */
    String ows;

    public LocalWorkspaceURLMangler(String ows) {
        this.ows = ows;
    }

    @Override
    public void mangleURL(
            StringBuilder baseURL, StringBuilder path, Map<String, String> kvp, URLType type) {

        if (type == URLType.SERVICE && stripRemainingPath(path.toString()).equalsIgnoreCase(ows)) {
            if (LocalWorkspace.get() != null) {
                path.insert(0, LocalWorkspace.get().getName() + "/");

                if (LocalPublished.get() != null) {
                    int i = LocalWorkspace.get().getName().length() + 1;
                    path.insert(i, LocalPublished.get().getName() + "/");
                }
            }
        }
    }
}