<?xml version="1.0" encoding="UTF-8"?>

        <Weakness_Catalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://cwe.mitre.org/data/xsd/cwe_schema_v3.0.xsd" Catalog_Version="0.9" Catalog_Name="CWE-678: Composites ">
	<Views/>
	<Categories/>
	<Weaknesses/>
	<Compound_Elements>
                    <Compound_Element Compound_Element_ID="120" Compound_Element_Name="Unbounded Transfer ('Classic Buffer Overflow')" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Incomplete">
		<Common_Attributes>
			<Description>
				<Description_Summary>A buffer overflow condition exists when a program attempts to put more data in a buffer
				than it can hold or when a program attempts to put data in a memory area past a buffer. In this
				case, a buffer is a sequential section of memory allocated to contain anything from a character
				string to an array of integers.</Description_Summary>
			</Description>
			<Alternate_Terms>Some prominent vendors and researchers use the term "buffer overrun," but most people
				use "buffer overflow."</Alternate_Terms>
			<Alternate_Terms>Many issues that are now called "buffer overflows" are substantively different than
				the "classic" overflow, including entirely different bug types that rely on overflow exploit
				techniques, such as integer signedness errors, integer overflows, and format string bugs. This
				imprecise terminology can make it difficult to determine which variant is being reported.</Alternate_Terms>
			<Functional_Area>Memory Management</Functional_Area>
			<Likelihood_of_Exploit>High to Very High</Likelihood_of_Exploit>
			<Weakness_Ordinality>Resultant (Weakness is typically related to the presence of some other weaknesses)</Weakness_Ordinality>
			<Weakness_Ordinality>Primary (Weakness exists independent of other weaknesses)</Weakness_Ordinality>
			<Causal_Nature>Explicit (This is an explicit weakness resulting from behavior of the developer)</Causal_Nature>
			<Affected_Resource>Memory</Affected_Resource>
			<Common_Consequences>
				<Common_Consequence>Availability: Buffer overflows generally lead to crashes. Other attacks
					leading to lack of availability are possible, including putting the program into an infinite
					loop.</Common_Consequence>
				<Common_Consequence>Access control (instruction processing): Buffer overflows often can be used to
					execute arbitrary code, which is usually outside the scope of a program's implicit security
					policy.</Common_Consequence>
				<Common_Consequence>Other: When the consequence is arbitrary code execution, this can often be
					used to subvert any other security service.</Common_Consequence>
			</Common_Consequences>
			<Potential_Mitigations>
				<Mitigation>Pre-design: Use a language or compiler that performs automatic bounds checking.</Mitigation>
				<Mitigation>Design: Use an abstraction library to abstract away risky APIs. Not a complete
					solution.</Mitigation>
				<Mitigation>Design: Use the &lt;strsafe.h&gt; library. This library has buffer overflow
					safe functions that will help with the detection of buffer overflows.</Mitigation>
				<Mitigation>Pre-design through Build: Compiler-based canary mechanisms such as StackGuard,
					ProPolice and the Microsoft Visual Studio /GS flag. Unless this provides automatic bounds
					checking, it is not a complete solution.</Mitigation>
				<Mitigation>Implementation: Programmers should adhere to the following rules when allocating and
					managing their applications memory: Double check that your buffer is as large as you specify.
					When using functions that accept a number of bytes to copy, such as strncpy(), be aware that
					if the destination buffer size is equal to the source buffer size, it may not NULL-terminate
					the string. Check buffer boundaries if calling this function in a loop and make sure you are
					not in danger of writing past the allocated space. Truncate all input strings to a reasonable
					length before passing them to the copy and concatenation functions</Mitigation>
				<Mitigation>Operational: Use OS-level preventative functionality. Not a complete
				solution.</Mitigation>
			</Potential_Mitigations>
			<Observed_Examples>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2000-1094</Observed_Example_Reference>
					<Observed_Example_Description>buffer overflow using command with long argument</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-1999-0046</Observed_Example_Reference>
					<Observed_Example_Description>buffer overflow in local program using long environment variable</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2002-1337</Observed_Example_Reference>
					<Observed_Example_Description>buffer overflow in comment characters, when product increments a counter for a
						"&gt;" but does not decrement for "&lt;"</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Description>CVE-2003-0595 - By replacing a valid cookie value with an extremely long string of
						characters, an attacker may overflow the application's buffers.</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Description>CVE-2001-0191 - By replacing a valid cookie value with an extremely long string of
						characters, an attacker may overflow the application's buffers.</Observed_Example_Description>
				</Observed_Example>
			</Observed_Examples>
			<Context_Notes>At the programmer level, stack-based and heap-based overflows do not differ
				significantly, so they are not distinguished here. Obviously, from the exploit perspective using
				shellcode, they can be quite different.</Context_Notes>
			<Context_Notes>Buffer overflows are one of the best known types of security problem. The best solution
				is enforced run-time bounds checking of array access, but many C/C++ programmers assume this is
				too costly or do not have the technology available to them. Even this problem only addresses
				failures in access control -- as an out-of-bounds access is still an exception condition and can
				lead to an availability problem if not addressed. Some platforms are introducing mitigating
				technologies at the compiler or OS level. All such technologies to date address only a subset of
				buffer overflow problems and rarely provide complete protection against even that subset. It is
				more common to make the workload of an attacker much higher -- for example, by leaving the
				attacker to guess an unknown value that changes every program execution.</Context_Notes>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>119</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>227</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>242</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>CanPrecede</Relationship_Nature>
					<Relationship_Target_ID>123</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">631</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>633</Relationship_Target_ID>
				</Relationship>
				<Relationship>
					<Relationship_Views>
						<Relationship_View_ID>1000</Relationship_View_ID>
					</Relationship_Views>
					<Relationship_Chains>
						<Relationship_Chain_ID>680</Relationship_Chain_ID>
					</Relationship_Chains>
					<Relationship_Type>Compound_Element</Relationship_Type>
					<Relationship_Nature>CanPrecede</Relationship_Nature>
					<Relationship_Target_ID>680</Relationship_Target_ID>
				</Relationship>
			</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
				<Original_Node_Name>Unbounded Transfer ('classic overflow')</Original_Node_Name>
			</Source_Taxonomy>
			<Source_Taxonomy Source_Taxonomy_Name="7 Pernicious Kingdoms">
				<Original_Node_Name>Buffer Overflow</Original_Node_Name>
			</Source_Taxonomy>
			<Source_Taxonomy Source_Taxonomy_Name="CLASP">
				<Original_Node_Name>Buffer overflow</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>C</Platform>
				<Platform>C++</Platform>
			</Applicable_Platforms>
			<Time_of_Introduction>Implementation</Time_of_Introduction>
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>100<!--Overflow Buffers--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>10<!--Buffer Overflow via Environment Variables--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>14<!--Client-side Injection-induced Buffer Overflow--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>42<!--MIME Conversion--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>24<!--Filter Failure through Buffer Overflow--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>8<!--Buffer Overflow in an API Call--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>9<!--Buffer Overflow in Local Command-Line Utilities--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>45<!--Buffer Overflow via Symbolic Links--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>46<!--Overflow Variables and Tags--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>47<!--Buffer Overflow via Parameter Expansion--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>92<!--Forced Integer Overflow--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>67<!--String Format Overflow in syslog()--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
			<White_Box_Definition>
	A weakness where the code path includes a Buffer Write Operation such that:
	1.        the expected size of the buffer is greater than the actual size of the buffer where expected size is equal to the sum of the size of the data item and the position in the buffer
	
	Where Buffer Write Operation is a statement that writes a data item of a certain size into a buffer at a certain position and at a certain index 
			</White_Box_Definition>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="291" Compound_Element_Name="Trusting Self-reported IP Address" Compound_Element_Abstraction="Variant" Compound_Element_Structure="Composite" Compound_Element_Status="Incomplete">
		<Common_Attributes>
			<Description>
				<Description_Summary>The use of IP addresses as authentication is flawed and can easily be spoofed by
				malicious users.</Description_Summary>
			</Description>
			<Likelihood_of_Exploit>High</Likelihood_of_Exploit>
			<Weakness_Ordinality>Resultant (Weakness is typically related to the presence of some other weaknesses)</Weakness_Ordinality>
			<Causal_Nature>Explicit (This is an explicit weakness resulting from behavior of the developer)</Causal_Nature>
			<Common_Consequences>
				<Common_Consequence>Authentication: Malicious users can fake authentication information,
					impersonating any IP address.</Common_Consequence>
			</Common_Consequences>
			<Potential_Mitigations>
				<Mitigation>Design: Use other means of identity verification that cannot be simply spoofed.
					Possibilities include a username/password or certificate.</Mitigation>
			</Potential_Mitigations>
			<Demonstrative_Example>
				<Example_Code>
					<Example_Block>
						<Example_Code_Block>
							<Code_Example_Language>C</Code_Example_Language>
							<Code_Example_Language>C++</Code_Example_Language>
							<Code_Block><![CDATA[sd = soc]]><![CDATA[ket(AF_INET, SOCK_DGRAM, 0); 
		]]><![CDATA[			serv.sin_family = AF_INET; 
	]]><![CDATA[				serv.sin_addr.s_addr = htonl]]><![CDATA[(INADDR_ANY); 
					servr.sin_po]]><![CDATA[rt = htons(1008);
					bind(sd, ]]><![CDATA[(struct sockaddr *) & serv, size]]><![CDATA[of(serv)); 
					while (1) { 
		]]><![CDATA[			  memset(msg, 0x0, MAX_MSG); ]]><![CDATA[
					  clilen = sizeof(cli); 
	]]><![CDATA[				if (inet_ntoa(cli.sin_addr)=]]><![CDATA[=...) n = recvfrom(sd, msg, MAX_]]><![CDATA[MSG, 0, (struct sockaddr *) & cl]]><![CDATA[i, &clilen); 
					}]]></Code_Block>
						</Example_Code_Block>
					</Example_Block>
					<Example_Block>
						<Example_Code_Block>
							<Code_Example_Language>Java</Code_Example_Language>
							<Code_Block><![CDATA[while(true) { 
					  Datagram]]><![CDATA[Packet rp=new DatagramPacket(rDa]]><![CDATA[ta,rData.length); 
					  outSoc]]><![CDATA[k.receive(rp); 
					  String in]]><![CDATA[ = new String(p.getData(),0, rp.]]><![CDATA[getLength());
					  InetAddress]]><![CDATA[ IPAddress = rp.getAddress();
		]]><![CDATA[			  int port = rp.getPort();
		]]><![CDATA[			  if ((rp.getAddress()==...) ]]><![CDATA[& (in==...)) { 
					    out = s]]><![CDATA[ecret.getBytes(); 
					    Data]]><![CDATA[gramPacket sp =new DatagramPacke]]><![CDATA[t(out,out.length, IPAddress, por]]><![CDATA[t); outSock.send(sp); 
					  } ]]><![CDATA[
					}]]></Code_Block>
						</Example_Code_Block>
					</Example_Block>
				</Example_Code>
			</Demonstrative_Example>
			<Context_Notes>As IP addresses can be easily spoofed, they do not constitute a valid authentication
				mechanism. Alternate methods should be used if significant authentication is necessary.</Context_Notes>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>290</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>348</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>471</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>292</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>293</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="CLASP">
				<Original_Node_Name>Trusting self-reported IP address</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
			<Time_of_Introduction>Architecture and Design</Time_of_Introduction>
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>4<!--Using Alternative IP Address Encodings--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="352" Compound_Element_Name="Cross-Site Request Forgery (CSRF)" Compound_Element_Abstraction="Variant" Compound_Element_Structure="Composite" Compound_Element_Status="Incomplete">
		<Common_Attributes>
			<Description>
				<Description_Summary>The web product does not, or can not, sufficiently verify whether a
				well-formed, valid, consistent request was intentionally provided by the user who
				submitted the request. Note: CSRF is multi-channel: 1. Attacker-to-victim (injection;
				external or internal channel) 2. Victim-to-server (activation; internal channel)</Description_Summary>
			</Description>
			<Alternate_Terms>Session Riding</Alternate_Terms>
			<Alternate_Terms>Cross Site Reference Forgery</Alternate_Terms>
			<Alternate_Terms>XSRF</Alternate_Terms>
			<Observed_Examples>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-1703</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-1995</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-1967</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-1842</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1947</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-2059</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1674</Observed_Example_Reference>
					<Observed_Example_Description>CSRF</Observed_Example_Description>
				</Observed_Example>
			</Observed_Examples>
			<Context_Notes>Could be resultant from XSS, although XSS is not necessarily required.</Context_Notes>
			<References>
				<Reference>
					<Reference_Author>Peter W</Reference_Author>
					<Reference_Title>Cross-Site Request Forgeries (Re: The Dangers of Allowing Users to
						Post Images)</Reference_Title>
					<Reference_Publication>Bugtraq</Reference_Publication>
					<Reference_Link>http://marc.info/?l=bugtraq&amp;m=99263135911884&amp;w=2</Reference_Link>
				</Reference>
				<Reference>
					<Reference_Author>Robert Auger</Reference_Author>
					<Reference_Title>CSRF - The Cross-Site Request Forgery (CSRF/XSRF) FAQ</Reference_Title>
					<Reference_Link>http://www.cgisecurity.com/articles/csrf-faq.shtml</Reference_Link>
				</Reference>
			</References>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>345</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>346</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>441</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>642</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>613</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">629</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>View</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>629</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">635</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>View</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>635</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
				<Original_Node_Name>Cross-Site Request Forgery (CSRF)</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
			<Time_of_Introduction>Architecture and Design</Time_of_Introduction>
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>62<!--Cross Site Request Forgery (aka Session Riding)--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="384" Compound_Element_Name="Session Fixation" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Incomplete">
		<Common_Attributes>
			<Description>
				<Description_Summary>Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier
				gives an attacker the opportunity to steal authenticated sessions. Such a scenario is commonly observed when: 
				1. A web application authenticates a user without first
				invalidating the existing session, thereby continuing to use the session already
				associated with the user
				2. An attacker is able to force a known session identifier on
				a user so that, once the user authenticates, the attacker has access to the
				authenticated session
				3. The application or container uses predictable session identifiers.
				In the generic exploit of session fixation vulnerabilities, an
				attacker creates a new session on a web application and records the associated session
				identifier. The attacker then causes the victim to associate, and possibly authenticate, against the server using
				that session identifier, giving the attacker access to the user's account through the
				active session.</Description_Summary>
			</Description>
			<Potential_Mitigations>
				<Mitigation>Invalidate any existing session identifiers prior to authorizing a new user session</Mitigation>
				<Mitigation>For platforms such as ASP that do not generate new values for sessionid cookies, utilize a secondary cookie. In this approach, set a secondary cookie on the user's browser to a random value and set a session variable to the same value. If the session variable and the cookie value ever don't match, invalidate the session, and force the user to log on again.</Mitigation>
			</Potential_Mitigations>
			<Demonstrative_Example>
				<Example_Code>
					<PreText> The following example shows a snippet of code from a J2EE web application where the
						application authenticates users with LoginContext.login() without first calling
						HttpSession.invalidate().</PreText>
					<Example_Block>
						<Example_Code_Block>
							<Code_Example_Language>Java</Code_Example_Language>
							<Code_Block><![CDATA[private void aut]]><![CDATA[h(LoginContext lc, HttpSession s]]><![CDATA[ession) throws LoginException {
]]><![CDATA[				  ... 
				  lc.login();
			]]><![CDATA[	  ... 
				}]]></Code_Block>
						</Example_Code_Block>
					</Example_Block>
					<PostText> In order to exploit the code above, an attacker could first create a session
						(perhaps by logging into the application) from a public terminal, record the session
						identifier assigned by the application, and reset the browser to the login page. Next, a
						victim sits down at the same public terminal, notices the browser open to the login page
						of the site, and enters credentials to authenticate against the application. The code
						responsible for authenticating the victim continues to use the pre-existing session
						identifier, now the attacker simply uses the session identifier recorded earlier to access
						the victim's active session, providing nearly unrestricted access to the victim's account
						for the lifetime of the session. Even given a vulnerable application, the success of the
						specific attack described here is dependent on several factors working in the favor of the
						attacker: access to an unmonitored public terminal, the ability to keep the compromised
						session active and a victim interested in logging into the vulnerable application on the
						public terminal. In most circumstances, the first two challenges are surmountable given a
						sufficient investment of time. Finding a victim who is both using a public terminal and
						interested in logging into the vulnerable application is possible as well, so long as the
						site is reasonably popular. The less well known the site is, the lower the odds of an
						interested victim using the public terminal and the lower the chance of success for the
						attack vector described above. The biggest challenge an attacker faces in exploiting
						session fixation vulnerabilities is inducing victims to authenticate against the
						vulnerable application using a session identifier known to the attacker. In the example
						above, the attacker did this through a direct method that is not subtle and does not scale
						suitably for attacks involving less well-known web sites. However, do not be lulled into
						complacency; attackers have many tools in their belts that help bypass the limitations of
						this attack vector. The most common technique employed by attackers involves taking
						advantage of cross-site scripting or HTTP response splitting vulnerabilities in the target
						site [12]. By tricking the victim into submitting a malicious request to a vulnerable
						application that reflects JavaScript or other code back to the victim's browser, an
						attacker can create a cookie that will cause the victim to reuse a session identifier
						controlled by the attacker. It is worth noting that cookies are often tied to the top
						level domain associated with a given URL. If multiple applications reside on the same top
						level domain, such as bank.example.com and recipes.example.com, a vulnerability in one
						application can allow an attacker to set a cookie with a fixed session identifier that
						will be used in all interactions with any application on the domain example.com [29].
					</PostText>
				</Example_Code>
				<Example_Code>
					<PreText>The following example shows a snippet of code from a J2EE web application where the
						application authenticates users with a direct post to the
						&lt;code&gt;j_security_check&lt;/code&gt;, which typically does not
						invalidate the existing session before processing the login request. </PreText>
					<Example_Block>
						<Example_Code_Block>
							<Code_Block><![CDATA[<form method="POST" act]]><![CDATA[ion="j_security_check">
					<in]]><![CDATA[put type="text" name="j_username]]><![CDATA[">
					<input type="text" name=]]><![CDATA["j_password">
					</form>]]></Code_Block>
						</Example_Code_Block>
					</Example_Block>
				</Example_Code>
			</Demonstrative_Example>
			<Context_Notes>Other attack vectors include DNS poisoning and related network based attacks where an
				attacker causes the user to visit a malicious site by redirecting a request for a valid site.
				Network based attacks typically involve a physical presence on the victim's network or control of
				a compromised machine on the network, which makes them harder to exploit remotely, but their
				significance should not be overlooked. Less secure session management mechanisms, such as the
				default implementation in Apache Tomcat, allow session identifiers normally expected in a cookie
				to be specified on the URL as well, which enables an attacker to cause a victim to use a fixed
				session identifier simply by emailing a malicious URL.</Context_Notes>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>361</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>287</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>346</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>472</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>441</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="7 Pernicious Kingdoms">
				<Original_Node_Name>Session Fixation</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
	
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>21<!--Exploitation of Session Variables, Resource IDs and other Trusted Credentials--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>39<!--Manipulating Opaque Client-based Data Tokens--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>31<!--Accessing/Intercepting/Modifying HTTP Cookies--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>60<!--Reusing Session IDs (aka Session Replay)--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>59<!--Session Credential Falsification through Prediction--></CAPEC_ID>
				</Related_Attack_Pattern>
				<Related_Attack_Pattern>
					<CAPEC_ID>61<!--Session Fixation--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="426" Compound_Element_Name="Untrusted Search Path" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Draft">
		<Common_Attributes>
			<Description>
				<Description_Summary>If a function performs automatic path searching for resources and an attacker can influence that
				path, then the attacker may be able to redirect the search path to point to resources under the
				control of the attacker.</Description_Summary>
			</Description>
			<Alternate_Terms>Untrusted Path</Alternate_Terms>
			<Functional_Area>Program invocation, code libraries.</Functional_Area>
			<Likelihood_of_Exploit>High</Likelihood_of_Exploit>
			<Affected_Resource>System Process</Affected_Resource>
			<Common_Consequences>
				<Common_Consequence>Authorization: There is the potential for arbitrary code execution
					with privileges of the vulnerable program.</Common_Consequence>
			</Common_Consequences>
			<Potential_Mitigations>
				<Mitigation>Implementation: Use other functions which require explicit paths. Making use
					of any of the other readily available functions which require explicit paths is a
					safe way to avoid this problem.</Mitigation>
			</Potential_Mitigations>
			<Observed_Examples>
				<Observed_Example>
					<Observed_Example_Reference>CVE-1999-1120</Observed_Example_Reference>
					<Observed_Example_Description>Application relies on its PATH environment variable to find and execute
						program.</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2002-0470</Observed_Example_Reference>
					<Observed_Example_Description>Application relies on its PATH environment variable to find and execute
						program.</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2007-2027</Observed_Example_Reference>
					<Observed_Example_Description>Chain: untrusted search path enabling resultant
						format string by loading malicious internationalization messages.</Observed_Example_Description>
				</Observed_Example>		
			</Observed_Examples>
			<Research_Gaps>Search path issues on Windows are under-studied and possibly under-reported.</Research_Gaps>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>417</Relationship_Target_ID>
				</Relationship>				
				<Relationship>
					<Relationship_Views>
						<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
					</Relationship_Views>
					<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>673</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>216</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>275</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>471</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">631</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>634</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
				<Original_Node_Name>Untrusted Search Path</Original_Node_Name>
			</Source_Taxonomy>
			<Source_Taxonomy Source_Taxonomy_Name="CLASP">
				<Original_Node_Name>Relative path library search</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>38<!--Leveraging/Manipulating Configuration File Search Paths--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="434" Compound_Element_Name="Unrestricted File Upload" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Draft">
		<Common_Attributes>
			<Description>
				<Description_Summary>The software allows the attacker to upload or transfer files of dangerous types that can
				be automatically processed within the product's environment.</Description_Summary>
			</Description>
			<Alternate_Terms>Formerly called "File Upload of Dangerous Type"</Alternate_Terms>
			<Affected_Resource>File/Directory</Affected_Resource>
			<Potential_Mitigations>
				<Mitigation>Determine the size and type of files that users are expected to upload to your system.
					Take measures to assure that the files meet those requirements.</Mitigation>
			</Potential_Mitigations>
			<Observed_Examples>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2001-0901</Observed_Example_Reference>
					<Observed_Example_Description>Web-based mail product stores ".shtml" attachments that could contain
					SSI</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2002-1841</Observed_Example_Reference>
					<Observed_Example_Description>PHP upload does not restrict file types</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1868</Observed_Example_Reference>
					<Observed_Example_Description>upload and execution of .php file</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1881</Observed_Example_Reference>
					<Observed_Example_Description>upload file with dangerous extension</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-0254</Observed_Example_Reference>
					<Observed_Example_Description>program does not restrict file types</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-2262</Observed_Example_Reference>
					<Observed_Example_Description>improper type checking of uploaded files</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2006-4558</Observed_Example_Reference>
					<Observed_Example_Description>Double "php" extension leaves an active php extension in the generated
					filename.</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2006-6994</Observed_Example_Reference>
					<Observed_Example_Description>ASP program allows upload of .asp files by bypassing client-side checks</Observed_Example_Description>
					<Observed_Example_Link>http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2006-6994</Observed_Example_Link>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-3288</Observed_Example_Reference>
					<Observed_Example_Description>ASP file upload</Observed_Example_Description>
					<Observed_Example_Link>http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2005-3288</Observed_Example_Link>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2006-2428</Observed_Example_Reference>
					<Observed_Example_Description>ASP file upload</Observed_Example_Description>
					<Observed_Example_Link>http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=CVE-2006-2428</Observed_Example_Link>
				</Observed_Example>
			</Observed_Examples>
			<Context_Notes>This can have a chaining relationship with incomplete blacklist / permissive whitelist errors when the product
				tries, but fails, to properly limit which types of files are allowed.</Context_Notes>
			<Context_Notes>This can also overlap multiple interpretation errors for intermediaries, e.g.
				anti-virus products that do not filter attachments with certain file extensions that can be
				processed by client systems.</Context_Notes>
			<Context_Notes>This can be primary when there is no check at all.  If is frequently resultant when use of
				double extensions (e.g. ".php.gif") bypass sanity checks. Also resultant from client-side
				enforcement; some products will include web script in web clients to check the filename, without
				verifying on the server side. </Context_Notes>
			<Research_Gaps>PHP applications are most targeted, but this likely applies to other languages that
				support file upload, as well as non-web technologies. ASP applications have also demonstrated this
				problem.</Research_Gaps>
			<References>
				<Reference>
					<Reference_Author>Richard Stanway (r1CH)</Reference_Author>
					<Reference_Title>Dynamic File Uploads, Security and You</Reference_Title>
					<Reference_Link>http://shsc.info/FileUploadSecurity</Reference_Link>
				</Reference>
			</References>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>429</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>ChildOf</Relationship_Nature>
						<Relationship_Target_ID>669</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>351</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>436</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>184</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>183</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>216</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>436</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>PeerOf</Relationship_Nature>
					<Relationship_Target_ID>430</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">629</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>View</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>629</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">631</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>632</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
				<Original_Node_Name>Unrestricted File Upload</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="61" Compound_Element_Name="UNIX Symbolic Link (Symlink) Following" Compound_Element_Abstraction="Variant" Compound_Element_Structure="Composite" Compound_Element_Status="Incomplete">
		<Common_Attributes>
			<Description>
				<Description_Summary>A software system that allows UNIX symbolic links (symlink) as part of paths whether in
				internal code or through user input can allow an attacker to spoof the symbolic link and traverse
				the file system to unintended locations or access arbitrary files. The symbolic link can permit an
				attacker to read/write/corrupt a file that they originally did not have permissions to access.</Description_Summary>
			</Description>
			<Alternate_Terms>Symlink following, symlink vulnerability.</Alternate_Terms>
			<Likelihood_of_Exploit>High to Very High</Likelihood_of_Exploit>
			<Weakness_Ordinality>Resultant (Weakness is typically related to the presence of some other weaknesses)</Weakness_Ordinality>
			<Causal_Nature>Explicit (This is an explicit weakness resulting from behavior of the developer)</Causal_Nature>
			<Potential_Mitigations>
				<Mitigation>Symbolic link attacks often occur when a program creates a tmp directory that stores
					files/links. Access to the directory should be restricted to the program as to prevent
					attackers from manipulating the files.</Mitigation>
				<Mitigation>Follow the principle of least privilege when assigning access rights to files. Denying
					access to a file can prevent an attacker from replacing that file with a link to a sensitive
					file. Ensure good compartmentalization in the system to provide protected areas that can be
					trusted.</Mitigation>
			</Potential_Mitigations>
			<Observed_Examples>
				<Observed_Example>
					<Observed_Example_Reference>CVE-1999-1386</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2000-0972</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2000-1178</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-0217</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2003-0517</Observed_Example_Reference>
					<Observed_Example_Description/>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2004-0689</Observed_Example_Reference>
					<Observed_Example_Description>Possible interesting example</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1879</Observed_Example_Reference>
					<Observed_Example_Description>Second-order symlink vulns</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1880</Observed_Example_Reference>
					<Observed_Example_Description>Second-order symlink vulns</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-1916</Observed_Example_Reference>
					<Observed_Example_Description>Symlink in Python program</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2000-0972</Observed_Example_Reference>
					<Observed_Example_Description>Setuid product allows file reading by replacing a file being edited with a symlink to
						the targeted file, leaking the result in error messages when parsing fails.</Observed_Example_Description>
				</Observed_Example>
				<Observed_Example>
					<Observed_Example_Reference>CVE-2005-0824</Observed_Example_Reference>
					<Observed_Example_Description>Signal causes a dump that follows symlinks.</Observed_Example_Description>
				</Observed_Example>
			</Observed_Examples>
			<Context_Notes>Fault: filename predictability, insecure directory permissions, non-atomic operations,
				race condition.</Context_Notes>
			<Context_Notes>These are typically reported for temporary files or privileged programs.</Context_Notes>
			<Research_Gaps>Symlink vulnerabilities are regularly found in C and shell programs, but all
				programming languages can have this problem.</Research_Gaps>
			<Research_Gaps>"Second-order symlink vulnerabilities" may exist in programs that invoke other programs
				that follow symlinks. They are rarely reported but are likely to be fairly common when process
				invocation is used. Reference: [Christey2005]</Research_Gaps>
			<References>
				<Reference>
					<Reference_Author>Steve Christey</Reference_Author>
					<Reference_Title>Second-Order Symlink Vulnerabilities</Reference_Title>
					<Reference_Publication>Bugtraq</Reference_Publication>
					<Reference_Date>2005-06-07</Reference_Date>
					<Reference_Link>http://www.securityfocus.com/archive/1/401682</Reference_Link>
				</Reference>
				<Reference>
					<Reference_Author>Shaun Colley</Reference_Author>
					<Reference_Title>Crafting Symlinks for Fun and Profit</Reference_Title>
					<Reference_Publication>Infosec Writers Text Library</Reference_Publication>
					<Reference_Date>2004-04-12</Reference_Date>
					<Reference_Link>http://www.infosecwriters.com/texts.php?op=display&amp;id=159</Reference_Link>
				</Reference>
			</References>
				<Relationships>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>ChildOf</Relationship_Nature>
					<Relationship_Target_ID>60</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>362</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>340</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>216</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>386</Relationship_Target_ID>
				</Relationship>
				<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
					<Relationship_Nature>Requires</Relationship_Nature>
					<Relationship_Target_ID>275</Relationship_Target_ID>
				</Relationship>
				</Relationships>
			<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
				<Original_Node_Name>UNIX symbolic link following</Original_Node_Name>
			</Source_Taxonomy>
			<Applicable_Platforms>
				<Platform>All</Platform>
			</Applicable_Platforms>
			<Related_Attack_Patterns>
				<Related_Attack_Pattern>
					<CAPEC_ID>27<!--Leveraging Race Conditions via Symbolic Links--></CAPEC_ID>
				</Related_Attack_Pattern>
			</Related_Attack_Patterns>
		</Common_Attributes>
	</Compound_Element>
                    <Compound_Element Compound_Element_ID="689" Compound_Element_Name="Permission Race Condition During Resource Copy" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Draft">
			<Common_Attributes>
				<Description>
					<Description_Summary>The product, while copying or cloning a resource, does not set the resource's permissions or access control until the copy is complete, leaving the resource exposed to other spheres while the copy is taking place.</Description_Summary>
				</Description>
				<Weakness_Ordinality>Primary (Weakness exists independent of other weaknesses)</Weakness_Ordinality>
				<Observed_Examples>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2002-0760</Observed_Example_Reference>
						<Observed_Example_Description>Archive extractor decompresses files with world-readable permissions, then later sets permissions to what the archive specified.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2174</Observed_Example_Reference>
						<Observed_Example_Description>Product inserts a new object into database before setting the object's permissions, introducing a race condition.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2006-5214</Observed_Example_Reference>
						<Observed_Example_Description>error file has weak permissions before a chmod is performed.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2475</Observed_Example_Reference>
						<Observed_Example_Description>Archive permissions issue using hard link.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2003-0265</Observed_Example_Reference>
						<Observed_Example_Description>database product creates files world-writable before initializing the setuid bits, leading to modification of executables.</Observed_Example_Description>
					</Observed_Example>
				</Observed_Examples>
				<Context_Notes>This is a general issue, although few subtypes are currently known.
					The most common examples occur in file archive extraction, in which
					the product begins the extraction with insecure default permissions,
					then only sets the final permissions (as specified in the archive)
					once the copy is complete.  The larger the archive, the larger the
					timing window for the race condition.  This weakness has also
					occurred in some operating system utilities that perform copies of
					deeply nested directories containing a large number of files.</Context_Notes>
				<Research_Gaps>Under-studied.  It seems likely that this weakness could occur in any situation in which a complex or large copy operation occurs, when the resource can be made available to other spheres as soon as it is created, but before its initialization is complete.</Research_Gaps>
				<Relationships>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
						<Relationship_Nature>ChildOf</Relationship_Nature>
						<Relationship_Target_ID>275</Relationship_Target_ID>
					</Relationship>
					
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>362</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>276</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>668</Relationship_Target_ID>
					</Relationship>
				</Relationships>
				<Applicable_Platforms>
					<Platform>C</Platform>
					<Platform>Perl</Platform>
				</Applicable_Platforms>
				<Time_of_Introduction>Implementation</Time_of_Introduction>
			</Common_Attributes>
		</Compound_Element>
                    <Compound_Element Compound_Element_ID="98" Compound_Element_Name="Insufficient Control of Filename for Include/Require Statement in PHP Program (aka 'PHP File Inclusion')" Compound_Element_Abstraction="Base" Compound_Element_Structure="Composite" Compound_Element_Status="Draft">
		<Common_Attributes>
				<Description>
					<Description_Summary>The software allows user-controlled data to be directly processed by the PHP
					interpreter before inclusion in the script through use of "require," "include," or similar statements.</Description_Summary>
				</Description>
				<Alternate_Terms>PHP remote file inclusion</Alternate_Terms>
				<Affected_Resource>File/Directory</Affected_Resource>
				<Potential_Mitigations>
					<Mitigation>Assume all input is malicious. Use an appropriate combination of black lists and white
						lists to ensure only valid and expected input is processed by the system.</Mitigation>
				</Potential_Mitigations>
			<Observed_Examples>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2004-0285</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2004-0030</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2004-0068</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2157</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2162</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2198</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable configuration variable in include file allows file
							inclusion via direct request.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2004-0128</Observed_Example_Reference>
						<Observed_Example_Description>Modification of assumed-immutable variable in configuration script leads to file
							inclusion.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1864</Observed_Example_Reference>
						<Observed_Example_Description>PHP file inclusion.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1869</Observed_Example_Reference>
						<Observed_Example_Description>PHP file inclusion.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1870</Observed_Example_Reference>
						<Observed_Example_Description>PHP file inclusion.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2154</Observed_Example_Reference>
						<Observed_Example_Description>PHP local file inclusion.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2002-1704</Observed_Example_Reference>
						<Observed_Example_Description>PHP remote file include.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2002-1707</Observed_Example_Reference>
						<Observed_Example_Description>PHP remote file include.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1964</Observed_Example_Reference>
						<Observed_Example_Description>PHP remote file include.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1681</Observed_Example_Reference>
						<Observed_Example_Description>PHP remote file include.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-2086</Observed_Example_Reference>
						<Observed_Example_Description>PHP remote file include.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2004-0127</Observed_Example_Reference>
						<Observed_Example_Description>Directory traversal vulnerability in PHP include statement.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-1971</Observed_Example_Reference>
						<Observed_Example_Description>Directory traversal vulnerability in PHP include statement.</Observed_Example_Description>
					</Observed_Example>
					<Observed_Example>
						<Observed_Example_Reference>CVE-2005-3335</Observed_Example_Reference>
						<Observed_Example_Description>PHP file inclusion issue, both remote and local; local include uses ".." and "%00"
							characters as a manipulation, but many remote file inclusion issues probably have this vector.</Observed_Example_Description>
					</Observed_Example>
			</Observed_Examples>
				<Context_Notes>This is frequently a functional consequence of other weaknesses. It is usually
					multi-factor with other factors (e.g. MAID), although not all inclusion bugs involve
					assumed-immutable data. Direct request weaknesses frequently play a role.</Context_Notes>
				<Context_Notes>Can overlap directory traversal in local inclusion problems.</Context_Notes>
				<Research_Gaps>Other interpreted languages with "require" and "include" functionality could also
					product vulnerable applications, but as of 2007, PHP has been the focus.</Research_Gaps>
				<References>
					<Reference>
						<Reference_Author>Shaun Clowes</Reference_Author>
						<Reference_Title>A Study in Scarlet</Reference_Title>
						<Reference_Link>http://www.cgisecurity.com/lib/studyinscarlet.txt</Reference_Link>
					</Reference>
				</References>
				<Relationships>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>ChildOf</Relationship_Nature>
						<Relationship_Target_ID>94</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Compound_Element</Relationship_Type>
						<Relationship_Nature>CanAlsoBe</Relationship_Nature>
						<Relationship_Target_ID>426</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>456</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>473</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>425</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID>1000</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Weakness</Relationship_Type>
						<Relationship_Nature>Requires</Relationship_Nature>
						<Relationship_Target_ID>216</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">629</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>View</Relationship_Type>
						<Relationship_Nature>ChildOf</Relationship_Nature>
						<Relationship_Target_ID>629</Relationship_Target_ID>
					</Relationship>
					<Relationship>
						<Relationship_Views>
							<Relationship_View_ID Ordinal="Primary">631</Relationship_View_ID>
						</Relationship_Views>
						<Relationship_Type>Category</Relationship_Type>
						<Relationship_Nature>ChildOf</Relationship_Nature>
						<Relationship_Target_ID>632</Relationship_Target_ID>
					</Relationship>
				</Relationships>
				<Source_Taxonomy Source_Taxonomy_Name="PLOVER">
					<Original_Node_Name>PHP File Include</Original_Node_Name>
				</Source_Taxonomy>
				<Applicable_Platforms>
					<Platform>PHP</Platform>
				</Applicable_Platforms>
		
		</Common_Attributes>
		</Compound_Element></Compound_Elements>

            </Weakness_Catalog>