Language: Java
Label: vulnerable
CWE: CWE-611 \u2014 Improper Restriction of XML External Entity Reference
The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.

Code:
	private ICStorageElement readOldCDTProjectFile(IProject project) throws CoreException {
		ICStorageElement storage = null;
		try {
			DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
			Document doc = null;
			InputStream stream = getSharedProperty(project, OLD_CDTPROJECT_FILE_NAME);
			if (stream != null) {
				doc = builder.parse(stream);
				NodeList nodeList = doc.getElementsByTagName(OLD_PROJECT_DESCRIPTION);

				if (nodeList != null && nodeList.getLength() > 0) {
					Node node = nodeList.item(0);
					storage = new InternalXmlStorageElement((Element) node, false);
				}
			}
		} catch (ParserConfigurationException e) {
			throw ExceptionFactory.createCoreException(e);
		} catch (SAXException e) {
			throw ExceptionFactory.createCoreException(e);
		} catch (IOException e) {
			throw ExceptionFactory.createCoreException(e);
		}
		return storage;
	}