undefect. CWE-407 — 63 sites patched across 27 ecosystems

Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
This commit is contained in:
russell@unturf.com 2026-03-26 17:11:57 -04:00
commit 0a580b313d
70422 changed files with 17213626 additions and 0 deletions

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- XML tags are case sensitve, opening and closing tags must use same case -->
<properties>
<entry key="foo">bar</entry>
<entry key="gus">baz</entry>
</PROPERTIES>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE namevaluepairs SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- The root element for a XML properties document is properties -->
<properties>
<entry key="foo">bar</entry>
<entry key="gus">baz</entry>
</properties>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- XML tags are case sensitve, the root element should have been in lower case -->
<Properties>
<comment>comment</comment>
<entry key="firstKey">value of the first key</entry>
</Properties>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- The dtd allows zero or one comment element -->
<properties>
<comment>comment1</comment>
<comment>comment2</comment>
<entry key="firstKey">value of the first key</entry>
</properties>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- The dtd requires a properties root, but not element -->
<properties>
<comment>comment</comment>
<properties>
<entry key="firstKey">value of the first key</entry>
</properties>
</properties>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- The dtd requires 'entry' element, 'Entry' is illegal -->
<properties>
<comment>comment</comment>
<Entry key="firstKey">value of the first key</Entry>
</properties>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- 'entry1' is illegal as per the dtd -->
<properties>
<comment>comment1</comment>
<entry key="firstkey">value of the first key</entry>
<entry1 key="secondkey">value of the second key</entry1>
</properties>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- 'key' attribute is expected. 'key1' is mistyped -->
<properties>
<comment>comment1</comment>
<entry key1="typo">value of the first key</entry>
</properties>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- XML elements must having a closing tag -->
<properties>
<entry key="foo">bar</entry>
<entry key="gus">baz</entry>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- An XML properties document has the DOCTYPE declaration with the properties root element -->
<properties>
<entry key="foo">bar</entry>
<entry key="gus">baz</entry>
</properties>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- namespace is not supported -->
<javautil:properties xmlns:javautil="http://java.sun.com/java/util/Properties">
<javautil:comment>comment1</javautil:comment>
<javautil:entry key="firstkey">value of the first key</javautil:entry>
<javautil:entry key="secondkey">value of the second key</javautil:entry>
</javautil:properties>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- XML documents must have a root element -->

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<!-- XML attribute values must be quoted -->
<properties>
<entry key=foo>bar</entry>
<entry key=gus>baz</entry>
</properties>

View file

@ -0,0 +1,5 @@
This directory contains test cases for the LoadAndStoreXML test case. Each file
in this directory should be a malformed XML document that should cause the
java.util.Properties loadFromXML method to throw InvalidPropertiesFormatException.

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"
[<!ENTITY intEnt 'value3'> ]>
<?PITarget PIContent?>
<properties>
<comment>Property With Other Encoding</comment>
<entry key="Key1">value1</entry>
<entry key="Key2"><![CDATA[<value2>]]></entry>
<entry key="Key3">&intEnt;</entry>
</properties>