Exploit database

GH-6a9637ea77c2e069e0599675232a26d3

r00t4dm/cve-2018-14667

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2018-14667

6 sources

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

Repository files3

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

WEB-INF/src/org/richfaces/demo/capitals/CapitalsBean.java

Java · 2,972 bytes
package org.richfaces.demo.capitals;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.faces.FacesException;
import javax.faces.model.SelectItem;

import org.apache.commons.digester.Digester;
import org.apache.commons.digester.xmlrules.DigesterLoader;
import org.xml.sax.SAXException;

public class CapitalsBean {
	private ArrayList<Capital> capitals = new ArrayList<Capital>();
	private ArrayList<String> capitalsNames = new ArrayList<String>();
	private List<SelectItem> capitalsOptions = new ArrayList<SelectItem>();
    private String capital = ""; 
	
    private String currentStateFilterValue;
    private String currentNameFilterValue;
    
	public List<Capital> autocomplete(Object suggest) {
        String pref = (String)suggest;
        ArrayList<Capital> result = new ArrayList<Capital>();

        Iterator<Capital> iterator = getCapitals().iterator();
        while (iterator.hasNext()) {
            Capital elem = ((Capital) iterator.next());
            if ((elem.getName() != null && elem.getName().toLowerCase().indexOf(pref.toLowerCase()) == 0) || "".equals(pref))
            {
                result.add(elem);
            }
        }
        return result;
    }
    
	public CapitalsBean() {
		URL rulesUrl = getClass().getResource("capitals-rules.xml");
		Digester digester =	DigesterLoader.createDigester(rulesUrl);
		digester.push(this);
		try {
			digester.parse(getClass().getResourceAsStream("capitals.xml"));
		} catch (IOException e) {
			throw new FacesException(e);
		} catch (SAXException e) {
			throw new FacesException(e);
		}
		capitalsNames.clear();
		for (Capital cap : capitals) {
			capitalsNames.add(cap.getName());
		}
		capitalsOptions.clear();
		for (Capital cap : capitals) {
			capitalsOptions.add(new SelectItem(cap.getName(),cap.getState()));
		}
	}
	
	public void resetFilter() {
		setCurrentNameFilterValue("");
		setCurrentStateFilterValue("");
	}
	
	public String addCapital(Capital capital) {
		capitals.add(capital);
		return null;
	}
	
	public ArrayList<Capital> getCapitals() {
		return capitals;
	}

	public String getCapital() {
		return capital;
	}

	public void setCapital(String capital) {
		this.capital = capital;
	}

	public List<SelectItem> getCapitalsOptions() {
		return capitalsOptions;
	}

	public ArrayList<String> getCapitalsNames() {
		return capitalsNames;
	}

	public String getCurrentStateFilterValue() {
		return currentStateFilterValue;
	}

	public void setCurrentStateFilterValue(String currentStateFilterValue) {
		this.currentStateFilterValue = currentStateFilterValue;
	}

	public String getCurrentNameFilterValue() {
		return currentNameFilterValue;
	}

	public void setCurrentNameFilterValue(String currentNameFilterValue) {
		this.currentNameFilterValue = currentNameFilterValue;
	}

}