Codebase list python-faraday / f2725d9
New upstream version 2.3.1 Sophie Brun 7 years ago
112 changed file(s) with 41065 addition(s) and 1316 deletion(s). Raw diff Collapse all Expand all
4444
4545 # Ignore faraday server pid
4646 server/.faraday-server.pid
47
48 #Ignore images executive report
49 reports/executive/images/ease-of-resolution-piechart.png
50 reports/executive/images/impact-piechart.png
51 reports/executive/images/vulns-piechart.png
52
53 #Ignore visual studio code configs
54 typings/
55 jsconfig.json
56 .vscode/
2626 * Alejandro Parodi
2727 * Federico Fernandez
2828 * xtr4nge
29 * Roberto Focke
00 IMPORTANT
11 ===========
22
3 Please be kind to remove all your pyc files before running faraday if you are updating this piece of software.
4 We made a big refactor in the latest iteration moving some code into a diferent package.
5
6 Please run ./faraday.py --update
3 Please be kind to remove all your pyc files before running faraday if you are updating this piece of software.
4 Make sure you run ```./faraday.py --update``` the first time after an update!
75
86
97 New features in the latest update
108 =====================================
9
10 February 8, 2017:
11 ---
12 * Fixed max amount of vulns pagination bug in Web UI
13 * Fixed Maltego plugin
14
15 January 30, 2017:
16 ---
17 * Added an activity feed panel in the Dashboard.
18 * Added AppScan plugin.
19 * Improved Burp's Online plugin. Added fields and removed HTML tags.
20 * Refactor remaining modules to be compatible with JS Strict Mode.
21 * Fixed bug that prevented GTK from closing when user clicked CANCEL on WS creation.
22 * Fixed size of Workspace creation dialog.
23 * New cwe databases: English and Spanish.
24 * Added Hping plugin.
25 * Enhancements to Wpscan plugin.
1126
1227 November 10, 2016:
1328 ---
2237 * Fixed Licenses search.
2338 * Refactor Licenses module to be compatible with JS Strict Mode.
2439
25 September 19, 2016:
26 ---
27 * Major refactor of Faraday Client: now we support massive workspaces (100.000+ hosts).
40 September 19, 2016:
41 ---
42 * Major refactor of Faraday Client: now we support massive workspaces (100.000+ hosts).
2843 * Fixed more than 10 minor bugs on the Web UI.
2944 * Fixed searching with spaces character on Web UI
3045 * Updated URL shown when starting Faraday.
3247 * Fixed Propecia plugin.
3348 * New plugin: WPscan
3449 * Host Sidebar on GTK now adds information more intelligently and will never block the application.
35 * Evidence screenshots in report generation is now bigger.
50 * Evidence screenshots in report generation is now bigger.
3651 * Help menu in GTK with links to interesting links.
3752 * Added Help section to WEB UI.
3853
105120 * Added support for resize workspace bar.
106121 * Added a quote for imported reports in WEB UI.
107122 * Added support for a new type of report in Qualysguard plugin.
108 * Fixed bugs in plugins: Acunetix - Nmap - Nikto.
123 * Fixed bugs in plugins: Acunetix - Nmap - Nikto.
109124
110125 Apr 29, 2016:
111126 ---
142157 * Added script to remove all vulns with a specific severity value (parameterized)
143158 * Fixed Arachni Plugin bugs
144159 * Added new version for Maltego Plugin
145 * Added support for Mint 17
160 * Added support for Mint 17
146161
147162 Dec 18, 2015:
148163 ---
243258
244259 * Added hosts CRUD
245260 * Added services CRUD
246 * Fix ubuntu 15.04 installation bug
261 * Fix ubuntu 15.04 installation bug
247262 * Small bug in burp plugin "Import new vulnerabilities" checkbox issue
248263 * Added an interactive visualization to calculate the value of a Workspace
249264 * Fixed several bugs in WEB UI
257272
258273 Changes:
259274
260 * Styles changes in WEB UI: fancy component selection, improved workspaces selection.
275 * Styles changes in WEB UI: fancy component selection, improved workspaces selection.
261276
262277 Bugfixes:
263278 * Date on Workspace creation
289304 * Easy access to Vulnerability pages in the Status Report
290305 * Easy access to the Host pages on the dashboard
291306 * Creation and Editing capabilities for the Workspace from the UI Web
292 * Support installation for the latest version of Debian/Ubuntu/Kali
307 * Support installation for the latest version of Debian/Ubuntu/Kali
293308 * sqlmap version 1.0-dev support updated
294309 * API Status Check in both ZSH & QT GUI
295 * Field added for resolution of vulnerabilities classification with plug-ins updated to support the new function.
310 * Field added for resolution of vulnerabilities classification with plug-ins updated to support the new function.
296311 * Field added for rating "ease of resolution" for vulnerabilities
297312 * Adjustments for Resolution field
298313
401416 * https://github.com/infobyte/faraday/commit/9dfa9ad23dfe450ceb65d38074d55f07425aa90a
402417
403418 Improving (web interface, vulnerability classification)
404
419
405420 Apr 30, 2014:
406421 ----
407422
418433
419434 * A brand new ZSH based Terminal UI
420435 * The Command Run execution history
421
422
0 2.2.0
0 2.3.1
11 <faraday>
22
33 <appname>Faraday - Penetration Test IDE</appname>
4 <version>2.2.0</version>
4 <version>2.3.1</version>
55 <debug_status>0</debug_status>
66 <font>-Misc-Fixed-medium-r-normal-*-12-100-100-100-c-70-iso8859-1</font>
77 <home_path>~/</home_path>
00 cwe,name,desc_summary,description,resolution,exploitation,references
1 CWE-119,EN-Improper Restriction of Operations within the Bounds of a Memory Buffer (Type: Class),"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
1 CWE-119,Improper Restriction of Operations within the Bounds of a Memory Buffer (Type: Class),"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
22 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127; Chapter 14, ""Prevent I18N Buffer Overruns"" Page 441
33 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
44 Safe C String Library v1.0.3: http://www.zork.org/safestr/
88 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
99 The Art of Software Security Assessment: Chapter 5, ""Memory Corruption"", Page 167.
1010 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
11 CWE-123,EN-Write-what-where Condition (Type: Base),"Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
12 CWE-129,EN-Improper Validation of Array Index (Type: Base),"The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,High,"Writing Secure Code: Chapter 5, ""Array Indexing Errors"" Page 144
11 CWE-123,Write-what-where Condition (Type: Base),"Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
12 CWE-129,Improper Validation of Array Index (Type: Base),"The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,High,"Writing Secure Code: Chapter 5, ""Array Indexing Errors"" Page 144
1313 Top 25 Series - Rank 14 - Improper Validation of Array Index: http://blogs.sans.org/appsecstreetfighter/2010/03/12/top-25-series-rank-14-improper-validation-of-array-index/
1414 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
1515 PaX: http://en.wikipedia.org/wiki/PaX
1616 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
1717 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
1818 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
19 CWE-194,EN-Unexpected Sign Extension (Type: Base),"The software performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.",This can happen in signed and unsigned cases.,,High,"C Language Issues for Application Security: http://www.informit.com/articles/article.aspx?p=686170&seqNum=6
19 CWE-194,Unexpected Sign Extension (Type: Base),"The software performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.",This can happen in signed and unsigned cases.,,High,"C Language Issues for Application Security: http://www.informit.com/articles/article.aspx?p=686170&seqNum=6
2020 Integral Security: http://www.ddj.com/security/193501774"
21 CWE-20,EN-Improper Input Validation (Type: Class),The product does not validate or incorrectly validates input that can affect the control flow or data flow of a program.,"When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution.",,High,"Input Validation with ESAPI - Very Important: http://manicode.blogspot.com/2008/08/input-validation-with-esapi.html
21 CWE-20,Improper Input Validation (Type: Class),The product does not validate or incorrectly validates input that can affect the control flow or data flow of a program.,"When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution.",,High,"Input Validation with ESAPI - Very Important: http://manicode.blogspot.com/2008/08/input-validation-with-esapi.html
2222 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
2323 Hacking Exposed Web Applications, Second Edition: Input Validation Attacks
2424 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
2525 The importance of input validation: http://searchsoftwarequality.techtarget.com/tip/0,289483,sid92_gci1214373,00.html
2626 Writing Secure Code: Chapter 10, ""All Input Is Evil!"" Page 341"
27 CWE-200,EN-Information Exposure (Type: Class),An information exposure is the intentional or unintentional disclosure of information to an actor that is not explicitly authorized to have access to that information.,"The information either
27 CWE-200,Information Exposure (Type: Class),An information exposure is the intentional or unintentional disclosure of information to an actor that is not explicitly authorized to have access to that information.,"The information either
2828 is regarded as sensitive within the product's own functionality, such as a private message; or
2929 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
3030 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,High,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
31 CWE-209,EN-Information Exposure Through an Error Message (Type: Base),"The software generates an error message that includes sensitive information about its environment, users, or associated data.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,High,"Information Leakage: http://www.webappsec.org/projects/threat/classes/information_leakage.shtml
31 CWE-209,Information Exposure Through an Error Message (Type: Base),"The software generates an error message that includes sensitive information about its environment, users, or associated data.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,High,"Information Leakage: http://www.webappsec.org/projects/threat/classes/information_leakage.shtml
3232 Secure Programming with Static Analysis: Section 9.2, page 326.
3333 Writing Secure Code: Chapter 16, ""General Good Practices."" Page 415
3434 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
3535 24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
3636 Top 25 Series - Rank 16 - Information Exposure Through an Error Message: http://software-security.sans.org/blog/2010/03/17/top-25-series-rank-16-information-exposure-through-an-error-message
3737 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
38 CWE-234,EN-Failure to Handle Missing Parameter (Type: Variant),"If too few arguments are sent to a function, the function will still pop the expected number of arguments from the stack. Potentially, a variable number of arguments could be exhausted in a function as well.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,High,
39 CWE-242,EN-Use of Inherently Dangerous Function (Type: Base),The program calls a function that can never be guaranteed to work safely.,"Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.",,High,"Herb Schildt's C++ Programming Cookbook: Chapter 5. Working with I/O
38 CWE-234,Failure to Handle Missing Parameter (Type: Variant),"If too few arguments are sent to a function, the function will still pop the expected number of arguments from the stack. Potentially, a variable number of arguments could be exhausted in a function as well.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,High,
39 CWE-242,Use of Inherently Dangerous Function (Type: Base),The program calls a function that can never be guaranteed to work safely.,"Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.",,High,"Herb Schildt's C++ Programming Cookbook: Chapter 5. Working with I/O
4040 Writing Secure Code: Chapter 5, ""gets and fgets"" Page 163"
41 CWE-243,EN-Creation of chroot Jail Without Changing Working Directory (Type: Variant),"The program uses the chroot() system call to create a jail, but does not change the working directory afterward. This does not prevent access to files outside of the jail.","Improper use of chroot() may allow attackers to escape from the chroot jail. The chroot() function call does not change the process's current working directory, so relative paths may still refer to file system resources outside of the chroot jail after chroot() has been called.",,High,
42 CWE-268,EN-Privilege Chaining (Type: Base),"Two distinct privileges, roles, capabilities, or rights can be combined in a way that allows an entity to perform unsafe actions that would not be allowed without that combination.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,High,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
43 CWE-271,EN-Privilege Dropping / Lowering Errors (Type: Class),The software does not drop privileges before passing control of a resource to an actor that does not have those privileges.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,High,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
41 CWE-243,Creation of chroot Jail Without Changing Working Directory (Type: Variant),"The program uses the chroot() system call to create a jail, but does not change the working directory afterward. This does not prevent access to files outside of the jail.","Improper use of chroot() may allow attackers to escape from the chroot jail. The chroot() function call does not change the process's current working directory, so relative paths may still refer to file system resources outside of the chroot jail after chroot() has been called.",,High,
42 CWE-268,Privilege Chaining (Type: Base),"Two distinct privileges, roles, capabilities, or rights can be combined in a way that allows an entity to perform unsafe actions that would not be allowed without that combination.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,High,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
43 CWE-271,Privilege Dropping / Lowering Errors (Type: Class),The software does not drop privileges before passing control of a resource to an actor that does not have those privileges.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,High,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
4444 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
45 CWE-285,EN-Improper Authorization (Type: Class),The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
45 CWE-285,Improper Authorization (Type: Class),The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
4646 When access control checks are not applied consistently - or not at all - users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
4747 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
4848 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
5050 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
5151 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39.
5252 The Art of Software Security Assessment: Chapter 11, ""ACL Inheritance"", Page 649."
53 CWE-291,EN-Reliance on IP Address for Authentication (Type: Variant),The software uses an IP address for authentication.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
54 CWE-292,EN-DEPRECATED (Duplicate): Trusting Self-reported DNS Name (Type: Variant),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
55 CWE-293,EN-Using Referer Field for Authentication (Type: Variant),"The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.","IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,"The Art of Software Security Assessment: Chapter 17, ""Referer Request Header"", Page 1030."
56 CWE-294,EN-Authentication Bypass by Capture-replay (Type: Base),A capture-replay flaw exists when the design of the software makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes).,"Capture-replay attacks are common and can be difficult to defeat without cryptography. They are a subset of network injection attacks that rely on observing previously-sent valid commands, then changing them slightly if necessary and resending the same commands to the server.",,High,
57 CWE-297,EN-Improper Validation of Certificate with Host Mismatch (Type: Variant),"The software communicates with a host that provides a certificate, but the software does not properly ensure that the certificate is actually associated with that host.","Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the software is interacting with. If the certificate's host-specific data is not properly checked - such as the Common Name (CN) in the Subject or the Subject Alternative Name (SAN) extension of an X.509 certificate - it may be possible for a redirection or spoofing attack to allow a malicious host with a valid certificate to provide data, impersonating a trusted host. In order to ensure data integrity, the certificate must be valid and it must pertain to the site that is being accessed.
53 CWE-291,Reliance on IP Address for Authentication (Type: Variant),The software uses an IP address for authentication.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
54 CWE-292,DEPRECATED (Duplicate): Trusting Self-reported DNS Name (Type: Variant),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
55 CWE-293,Using Referer Field for Authentication (Type: Variant),"The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.","IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,"The Art of Software Security Assessment: Chapter 17, ""Referer Request Header"", Page 1030."
56 CWE-294,Authentication Bypass by Capture-replay (Type: Base),A capture-replay flaw exists when the design of the software makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes).,"Capture-replay attacks are common and can be difficult to defeat without cryptography. They are a subset of network injection attacks that rely on observing previously-sent valid commands, then changing them slightly if necessary and resending the same commands to the server.",,High,
57 CWE-297,Improper Validation of Certificate with Host Mismatch (Type: Variant),"The software communicates with a host that provides a certificate, but the software does not properly ensure that the certificate is actually associated with that host.","Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the software is interacting with. If the certificate's host-specific data is not properly checked - such as the Common Name (CN) in the Subject or the Subject Alternative Name (SAN) extension of an X.509 certificate - it may be possible for a redirection or spoofing attack to allow a malicious host with a valid certificate to provide data, impersonating a trusted host. In order to ensure data integrity, the certificate must be valid and it must pertain to the site that is being accessed.
5858 Even if the software attempts to check the hostname, it is still possible to incorrectly check the hostname. For example, attackers could create a certificate with a name that begins with a trusted name followed by a NUL byte, which could cause some string-based comparisons to only examine the portion that contains the trusted name.",,High,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
5959 Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
6060 Secure programming with the OpenSSL API, Part 2: Secure handshake: http://www.ibm.com/developerworks/library/l-openssl2/index.html
6161 An Introduction to OpenSSL Programming (Part I): http://www.rtfm.com/openssl-examples/part1.pdf
6262 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
63 CWE-308,EN-Use of Single-factor Authentication (Type: Base),The use of single-factor authentication can lead to unnecessary risk of compromise when compared with the benefits of a dual-factor authentication scheme.,"While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,High,
64 CWE-321,EN-Use of Hard-coded Cryptographic Key (Type: Base),The use of a hard-coded cryptographic key significantly increases the possibility that encrypted data may be recovered.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
63 CWE-308,Use of Single-factor Authentication (Type: Base),The use of single-factor authentication can lead to unnecessary risk of compromise when compared with the benefits of a dual-factor authentication scheme.,"While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,High,
64 CWE-321,Use of Hard-coded Cryptographic Key (Type: Base),The use of a hard-coded cryptographic key significantly increases the possibility that encrypted data may be recovered.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
6565 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,High,
66 CWE-322,EN-Key Exchange without Entity Authentication (Type: Base),The software performs a key exchange with an actor without verifying the identity of that actor.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347
66 CWE-322,Key Exchange without Entity Authentication (Type: Base),The software performs a key exchange with an actor without verifying the identity of that actor.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347
6767 The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
68 CWE-323,"EN-Reusing a Nonce, Key Pair in Encryption (Type: Base)",Nonces should be used for the present occasion and only once.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,
69 CWE-360,EN-Trust of System Event Data (Type: Base),Security based on event locations are insecure and can be spoofed.,"Events are a messaging system which may provide control data to programs listening for events. Events often do not have any type of authentication framework to allow them to be verified from a trusted source. Any application, in Windows, on a given desktop can send a message to any window on the same desktop. There is no authentication framework for these messages. Therefore, any message can be used to manipulate any process on the desktop if the process does not check the validity and safeness of those messages.",,High,
70 CWE-378,EN-Creation of Temporary File With Insecure Permissions (Type: Base),"Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,High,
71 CWE-416,EN-Use After Free (Type: Base),"Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
68 CWE-323,"Reusing a Nonce, Key Pair in Encryption (Type: Base)",Nonces should be used for the present occasion and only once.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,
69 CWE-360,Trust of System Event Data (Type: Base),Security based on event locations are insecure and can be spoofed.,"Events are a messaging system which may provide control data to programs listening for events. Events often do not have any type of authentication framework to allow them to be verified from a trusted source. Any application, in Windows, on a given desktop can send a message to any window on the same desktop. There is no authentication framework for these messages. Therefore, any message can be used to manipulate any process on the desktop if the process does not check the validity and safeness of those messages.",,High,
70 CWE-378,Creation of Temporary File With Insecure Permissions (Type: Base),"Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,High,
71 CWE-416,Use After Free (Type: Base),"Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
7272 Error conditions and other exceptional circumstances.
7373 Confusion over which part of the program is responsible for freeing the memory.
7474 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
7575 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,High,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
76 CWE-457,EN-Use of Uninitialized Variable (Type: Variant),"The code uses a variable that has not been initialized, leading to unpredictable or unintended results.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,High,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
76 CWE-457,Use of Uninitialized Variable (Type: Variant),"The code uses a variable that has not been initialized, leading to unpredictable or unintended results.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,High,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
7777 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
7878 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
7979 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
80 CWE-467,EN-Use of sizeof() on a Pointer Type (Type: Variant),"The code calls sizeof() on a malloced pointer type, which always returns the wordsize/8. This can produce an unexpected result if the programmer intended to determine how much memory has been allocated.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High,EXP01-A. Do not take the sizeof a pointer to determine the size of a type: https://www.securecoding.cert.org/confluence/display/seccode/EXP01-A.+Do+not+take+the+sizeof+a+pointer+to+determine+the+size+of+a+type
81 CWE-486,EN-Comparison of Classes by Name (Type: Variant),"The program compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,High,
82 CWE-493,EN-Critical Public Variable Without Final Modifier (Type: Variant),"The product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.","If a field is non-final and public, it can be changed once the value is set by any function that has access to the class which contains the field. This could lead to a vulnerability if other parts of the program make assumptions about the contents of that field.",,High,
83 CWE-499,EN-Serializable Class Containing Sensitive Data (Type: Variant),"The code contains a class with sensitive data, but the class does not explicitly deny serialization. The data can be accessed by serializing the class through another class.","Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,High,
84 CWE-500,EN-Public Static Field Not Marked Final (Type: Variant),"An object contains a public static field that is not marked final, which might allow it to be modified in unexpected ways.",Public static variables can be read without an accessor and changed without a mutator by any classes in the application.,,High,
85 CWE-515,EN-Covert Storage Channel (Type: Base),A covert storage channel transfers information through the setting of bits by one program and the reading of those bits by another. What distinguishes this case from that of ordinary operation is that the bits are used to convey encoded information.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,High,
86 CWE-639,EN-Authorization Bypass Through User-Controlled Key (Type: Base),The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.,"Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system. One manifestation of this weakness would be if a system used sequential or otherwise easily guessable session ids that would allow one user to easily switch to another user's session and read/modify their data.",,High,
87 CWE-640,EN-Weak Password Recovery Mechanism for Forgotten Password (Type: Base),"The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.","It is common for an application to have a mechanism that provides a means for a user to gain access to their account in the event they forget their password. Very often the password recovery mechanism is weak, which has the effect of making it more likely that it would be possible for a person other than the legitimate system user to gain access to that user's account.
80 CWE-467,Use of sizeof() on a Pointer Type (Type: Variant),"The code calls sizeof() on a malloced pointer type, which always returns the wordsize/8. This can produce an unexpected result if the programmer intended to determine how much memory has been allocated.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High,EXP01-A. Do not take the sizeof a pointer to determine the size of a type: https://www.securecoding.cert.org/confluence/display/seccode/EXP01-A.+Do+not+take+the+sizeof+a+pointer+to+determine+the+size+of+a+type
81 CWE-486,Comparison of Classes by Name (Type: Variant),"The program compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,High,
82 CWE-493,Critical Public Variable Without Final Modifier (Type: Variant),"The product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.","If a field is non-final and public, it can be changed once the value is set by any function that has access to the class which contains the field. This could lead to a vulnerability if other parts of the program make assumptions about the contents of that field.",,High,
83 CWE-499,Serializable Class Containing Sensitive Data (Type: Variant),"The code contains a class with sensitive data, but the class does not explicitly deny serialization. The data can be accessed by serializing the class through another class.","Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,High,
84 CWE-500,Public Static Field Not Marked Final (Type: Variant),"An object contains a public static field that is not marked final, which might allow it to be modified in unexpected ways.",Public static variables can be read without an accessor and changed without a mutator by any classes in the application.,,High,
85 CWE-515,Covert Storage Channel (Type: Base),A covert storage channel transfers information through the setting of bits by one program and the reading of those bits by another. What distinguishes this case from that of ordinary operation is that the bits are used to convey encoded information.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,High,
86 CWE-639,Authorization Bypass Through User-Controlled Key (Type: Base),The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.,"Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system. One manifestation of this weakness would be if a system used sequential or otherwise easily guessable session ids that would allow one user to easily switch to another user's session and read/modify their data.",,High,
87 CWE-640,Weak Password Recovery Mechanism for Forgotten Password (Type: Base),"The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.","It is common for an application to have a mechanism that provides a means for a user to gain access to their account in the event they forget their password. Very often the password recovery mechanism is weak, which has the effect of making it more likely that it would be possible for a person other than the legitimate system user to gain access to that user's account.
8888 This weakness may be that the security question is too easy to guess or find an answer to (e.g. because it is too common). Or there might be an implementation weakness in the password recovery mechanism code that may for instance trick the system into e-mailing the new password to an e-mail account other than that of the user. There might be no throttling done on the rate of password resets so that a legitimate user can be denied service by an attacker if an attacker tries to recover their password in a rapid succession. The system may send the original password to the user rather than generating a new temporary password. In summary, password recovery functionality, if not carefully designed and implemented can often become the system's weakest link that can be misused in a way that would allow an attacker to gain unauthorized access to the system. Weak password recovery schemes completely undermine a strong password authentication scheme.",,High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
89 CWE-642,EN-External Control of Critical State Data (Type: Class),"The software stores security-critical state information about its users, or the software itself, in a location that is accessible to unauthorized actors.","If an attacker can modify the state information without detection, then it could be used to perform unauthorized actions or access unexpected resources, since the application programmer does not expect that the state can be changed.
89 CWE-642,External Control of Critical State Data (Type: Class),"The software stores security-critical state information about its users, or the software itself, in a location that is accessible to unauthorized actors.","If an attacker can modify the state information without detection, then it could be used to perform unauthorized actions or access unexpected resources, since the application programmer does not expect that the state can be changed.
9090 State information can be stored in various locations such as a cookie, in a hidden web form field, input parameter or argument, an environment variable, a database record, within a settings file, etc. All of these locations have the potential to be modified by an attacker. When this state information is used to control security or determine resource usage, then it may create a vulnerability. For example, an application may perform authentication, then save the state in an ""authenticated=true"" cookie. An attacker may simply create this cookie in order to bypass the authentication.",,High,"Top 10 2007-Insecure Direct Object Reference: http://www.owasp.org/index.php/Top_10_2007-A4
9191 HMAC: http://en.wikipedia.org/wiki/Hmac
9292 24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75"
93 CWE-643,EN-Improper Neutralization of Data within XPath Expressions (XPath Injection) (Type: Base),"The software uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,"XPath Injection: http://www.webappsec.org/projects/threat/classes/xpath_injection.shtml
93 CWE-643,Improper Neutralization of Data within XPath Expressions (XPath Injection) (Type: Base),"The software uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,"XPath Injection: http://www.webappsec.org/projects/threat/classes/xpath_injection.shtml
9494 The Art of Software Security Assessment: Chapter 17, ""XPath Injection"", Page 1070."
95 CWE-644,EN-Improper Neutralization of HTTP Headers for Scripting Syntax (Type: Variant),"The application does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.","An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.
95 CWE-644,Improper Neutralization of HTTP Headers for Scripting Syntax (Type: Variant),"The application does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.","An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.
9696 If an application does not neutralize user controlled data being placed in the header of an HTTP response coming from the server, the header may contain a script that will get executed in the client's browser context, potentially resulting in a cross site scripting vulnerability or possibly an HTTP response splitting attack. It is important to carefully control data that is being placed both in HTTP response header and in the HTTP response body to ensure that no scripting syntax is present, taking various encodings into account.",,High,
97 CWE-645,EN-Overly Restrictive Account Lockout Mechanism (Type: Base),"The software contains an account lockout protection mechanism, but the mechanism is too restrictive and can be triggered too easily. This allows attackers to deny service to legitimate users by causing their accounts to be locked out.","Account lockout is a security feature often present in applications as a countermeasure to the brute force attack on the password based authentication mechanism of the system. After a certain number of failed login attempts, the users' account may be disabled for a certain period of time or until it is unlocked by an administrator. Other security events may also possibly trigger account lockout. However, an attacker may use this very security feature to deny service to legitimate system users. It is therefore important to ensure that the account lockout security mechanism is not overly restrictive.",,High,
98 CWE-646,EN-Reliance on File Name or Extension of Externally-Supplied File (Type: Variant),"The software allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.","An application might use the file name or extension of of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a "".php.gif"" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.",,High,
99 CWE-647,EN-Use of Non-Canonical URL Paths for Authorization Decisions (Type: Variant),The software defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.,"If an application defines policy namespaces and makes authorization decisions based on the URL, but it does not require or convert to a canonical URL before making the authorization decision, then it opens the application to attack. For example, if the application only wants to allow access to http://www.example.com/mypage, then the attacker might be able to bypass this restriction using equivalent URLs such as:
97 CWE-645,Overly Restrictive Account Lockout Mechanism (Type: Base),"The software contains an account lockout protection mechanism, but the mechanism is too restrictive and can be triggered too easily. This allows attackers to deny service to legitimate users by causing their accounts to be locked out.","Account lockout is a security feature often present in applications as a countermeasure to the brute force attack on the password based authentication mechanism of the system. After a certain number of failed login attempts, the users' account may be disabled for a certain period of time or until it is unlocked by an administrator. Other security events may also possibly trigger account lockout. However, an attacker may use this very security feature to deny service to legitimate system users. It is therefore important to ensure that the account lockout security mechanism is not overly restrictive.",,High,
98 CWE-646,Reliance on File Name or Extension of Externally-Supplied File (Type: Variant),"The software allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.","An application might use the file name or extension of of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a "".php.gif"" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.",,High,
99 CWE-647,Use of Non-Canonical URL Paths for Authorization Decisions (Type: Variant),The software defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.,"If an application defines policy namespaces and makes authorization decisions based on the URL, but it does not require or convert to a canonical URL before making the authorization decision, then it opens the application to attack. For example, if the application only wants to allow access to http://www.example.com/mypage, then the attacker might be able to bypass this restriction using equivalent URLs such as:
100100 http://WWW.EXAMPLE.COM/mypage
101101 http://www.example.com/%6Dypage (alternate encoding)
102102 http://192.168.1.1/mypage (IP address)
103103 http://www.example.com/mypage/ (trailing /)
104104 http://www.example.com:80/mypage
105105 Therefore it is important to specify access control policy that is based on the path information in some canonical form with all alternate encodings rejected (which can be accomplished by a default deny rule).",,High,
106 CWE-649,EN-Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking (Type: Base),"The software uses obfuscation or encryption of inputs that should not be mutable by an external actor, but the software does not use integrity checks to detect if those inputs have been modified.","When an application relies on obfuscation or incorrectly applied / weak encryption to protect client-controllable tokens or parameters, that may have an effect on the user state, system state, or some decision made on the server. Without protecting the tokens/parameters for integrity, the application is vulnerable to an attack where an adversary blindly traverses the space of possible values of the said token/parameter in order to attempt to gain an advantage. The goal of the attacker is to find another admissible value that will somehow elevate his or her privileges in the system, disclose information or change the behavior of the system in some way beneficial to the attacker. If the application does not protect these critical tokens/parameters for integrity, it will not be able to determine that these values have been tampered with. Measures that are used to protect data for confidentiality should not be relied upon to provide the integrity service.",,High,
107 CWE-650,EN-Trusting HTTP Permission Methods on the Server Side (Type: Variant),"The server contains a protection mechanism that assumes that any URI that is accessed using HTTP GET will not cause a state change to the associated resource. This might allow attackers to bypass intended access restrictions and conduct resource modification and deletion attacks, since some applications allow GET to modify state.","An application may disallow the HTTP requests to perform DELETE, PUT and POST operations on the resource representation, believing that it will be enough to prevent unintended resource alterations. Even though the HTTP GET specification requires that GET requests should not have side effects, there is nothing in the HTTP protocol itself that prevents the HTTP GET method from performing more than just query of the data. For instance, it is a common practice with REST based Web Services to have HTTP GET requests modifying resources on the server side. Whenever that happens however, the access control needs to be properly enforced in the application. No assumptions should be made that only HTTP DELETE, PUT, and POST methods have the power to alter the representation of the resource being accessed in the request.",,High,
108 CWE-652,EN-Improper Neutralization of Data within XQuery Expressions (XQuery Injection) (Type: Base),"The software uses external input to dynamically construct an XQuery expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,
109 CWE-676,EN-Use of Potentially Dangerous Function (Type: Base),"The program invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,High,"Security Development Lifecycle (SDL) Banned Function Calls: http://msdn.microsoft.com/en-us/library/bb288454.aspx
106 CWE-649,Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking (Type: Base),"The software uses obfuscation or encryption of inputs that should not be mutable by an external actor, but the software does not use integrity checks to detect if those inputs have been modified.","When an application relies on obfuscation or incorrectly applied / weak encryption to protect client-controllable tokens or parameters, that may have an effect on the user state, system state, or some decision made on the server. Without protecting the tokens/parameters for integrity, the application is vulnerable to an attack where an adversary blindly traverses the space of possible values of the said token/parameter in order to attempt to gain an advantage. The goal of the attacker is to find another admissible value that will somehow elevate his or her privileges in the system, disclose information or change the behavior of the system in some way beneficial to the attacker. If the application does not protect these critical tokens/parameters for integrity, it will not be able to determine that these values have been tampered with. Measures that are used to protect data for confidentiality should not be relied upon to provide the integrity service.",,High,
107 CWE-650,Trusting HTTP Permission Methods on the Server Side (Type: Variant),"The server contains a protection mechanism that assumes that any URI that is accessed using HTTP GET will not cause a state change to the associated resource. This might allow attackers to bypass intended access restrictions and conduct resource modification and deletion attacks, since some applications allow GET to modify state.","An application may disallow the HTTP requests to perform DELETE, PUT and POST operations on the resource representation, believing that it will be enough to prevent unintended resource alterations. Even though the HTTP GET specification requires that GET requests should not have side effects, there is nothing in the HTTP protocol itself that prevents the HTTP GET method from performing more than just query of the data. For instance, it is a common practice with REST based Web Services to have HTTP GET requests modifying resources on the server side. Whenever that happens however, the access control needs to be properly enforced in the application. No assumptions should be made that only HTTP DELETE, PUT, and POST methods have the power to alter the representation of the resource being accessed in the request.",,High,
108 CWE-652,Improper Neutralization of Data within XQuery Expressions (XQuery Injection) (Type: Base),"The software uses external input to dynamically construct an XQuery expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,
109 CWE-676,Use of Potentially Dangerous Function (Type: Base),"The program invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,High,"Security Development Lifecycle (SDL) Banned Function Calls: http://msdn.microsoft.com/en-us/library/bb288454.aspx
110110 Writing Secure Code: Chapter 5, ""Safe String Handling"" Page 156, 160
111111 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
112 CWE-682,EN-Incorrect Calculation (Type: Class),The software performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management..,"When software performs a security-critical calculation incorrectly, it might lead to incorrect resource allocations, incorrect privilege assignments, or failed comparisons among other things. Many of the direct results of an incorrect calculation can lead to even larger problems such as failed protection mechanisms or even arbitrary code execution.",,High,"SafeInt: http://safeint.codeplex.com/
112 CWE-682,Incorrect Calculation (Type: Class),The software performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management..,"When software performs a security-critical calculation incorrectly, it might lead to incorrect resource allocations, incorrect privilege assignments, or failed comparisons among other things. Many of the direct results of an incorrect calculation can lead to even larger problems such as failed protection mechanisms or even arbitrary code execution.",,High,"SafeInt: http://safeint.codeplex.com/
113113 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
114114 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
115 CWE-78,EN-Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) (Type: Base),"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component..","This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage.
115 CWE-78,Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) (Type: Base),"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component..","This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage.
116116 There are at least two subtypes of OS command injection:
117117 The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system(""nslookup [HOSTNAME]"") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing.
118118 The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use ""exec([COMMAND])"" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line.
126126 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
127127 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
128128 The Art of Software Security Assessment: Chapter 8, ""Shell Metacharacters"", Page 425."
129 CWE-784,EN-Reliance on Cookies without Validation and Integrity Checking in a Security Decision (Type: Variant),"The application uses a protection mechanism that relies on the existence or values of a cookie, but it does not properly ensure that the cookie is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Attackers can bypass protection mechanisms such as authorization and authentication by modifying the cookie to contain an expected value.",,High,"Unforgivable Vulnerabilities: http://cve.mitre.org/docs/docs-2007/unforgivable.pdf
129 CWE-784,Reliance on Cookies without Validation and Integrity Checking in a Security Decision (Type: Variant),"The application uses a protection mechanism that relies on the existence or values of a cookie, but it does not properly ensure that the cookie is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Attackers can bypass protection mechanisms such as authorization and authentication by modifying the cookie to contain an expected value.",,High,"Unforgivable Vulnerabilities: http://cve.mitre.org/docs/docs-2007/unforgivable.pdf
130130 Writing Secure Code: Chapter 13, ""Sensitive Data in Cookies and Fields"" Page 435"
131 CWE-862,EN-Missing Authorization (Type: Class),The software does not perform an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
131 CWE-862,Missing Authorization (Type: Class),The software does not perform an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
132132 When access control checks are not applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
133133 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
134134 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
135135 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
136136 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
137137 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
138 CWE-863,EN-Incorrect Authorization (Type: Class),"The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
138 CWE-863,Incorrect Authorization (Type: Class),"The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
139139 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
140140 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
141141 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
142142 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
143143 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
144144 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
145 CWE-99,EN-Improper Control of Resource Identifiers (Resource Injection) (Type: Base),"The software receives input from an upstream component, but it does not restrict or incorrectly restricts the input before it is used as an identifier for a resource that may be outside the intended sphere of control.",This may enable an attacker to access or modify otherwise protected system resources.,,High,
146 CWE-120,EN-Buffer Copy without Checking Size of Input (Classic Buffer Overflow) (Type: Base),"The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127
145 CWE-99,Improper Control of Resource Identifiers (Resource Injection) (Type: Base),"The software receives input from an upstream component, but it does not restrict or incorrectly restricts the input before it is used as an identifier for a resource that may be outside the intended sphere of control.",This may enable an attacker to access or modify otherwise protected system resources.,,High,
146 CWE-120,Buffer Copy without Checking Size of Input (Classic Buffer Overflow) (Type: Base),"The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127
147147 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
148148 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
149149 Safe C String Library v1.0.3: http://www.zork.org/safestr/
156156 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
157157 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189.
158158 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
159 CWE-122,EN-Heap-based Buffer Overflow (Type: Variant),"A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Heap Overruns"" Page 138
159 CWE-122,Heap-based Buffer Overflow (Type: Variant),"A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Heap Overruns"" Page 138
160160 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
161161 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
162162 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
163 CWE-131,EN-Incorrect Calculation of Buffer Size (Type: Base),"The software does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,High to Very High,"SafeInt: http://safeint.codeplex.com/
163 CWE-131,Incorrect Calculation of Buffer Size (Type: Base),"The software does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,High to Very High,"SafeInt: http://safeint.codeplex.com/
164164 Top 25 Series - Rank 18 - Incorrect Calculation of Buffer Size: http://software-security.sans.org/blog/2010/03/19/top-25-series-rank-18-incorrect-calculation-of-buffer-size
165165 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
166166 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
169169 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
170170 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
171171 The Art of Software Security Assessment: Chapter 8, ""Incrementing Pointers Incorrectly"", Page 401."
172 CWE-22,EN-Improper Limitation of a Pathname to a Restricted Directory (Path Traversal) (Type: Class),"The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
172 CWE-22,Improper Limitation of a Pathname to a Restricted Directory (Path Traversal) (Type: Class),"The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
173173 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,High to Very High,"Writing Secure Code: Chapter 11, ""Directory Traversal and Using Parent Paths (..)"" Page 370
174174 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
175175 Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
176176 Top 25 Series - Rank 7 - Path Traversal: http://blogs.sans.org/appsecstreetfighter/2010/03/09/top-25-series-rank-7-path-traversal/
177177 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
178178 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
179 CWE-311,EN-Missing Encryption of Sensitive Data (Type: Base),The software does not encrypt sensitive or critical information before storage or transmission.,"The lack of proper data encryption passes up the guarantees of confidentiality, integrity, and accountability that properly implemented encryption conveys.",,High to Very High,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
179 CWE-311,Missing Encryption of Sensitive Data (Type: Base),The software does not encrypt sensitive or critical information before storage or transmission.,"The lack of proper data encryption passes up the guarantees of confidentiality, integrity, and accountability that properly implemented encryption conveys.",,High to Very High,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
180180 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253
181181 Top 25 Series - Rank 10 - Missing Encryption of Sensitive Data: http://blogs.sans.org/appsecstreetfighter/2010/02/26/top-25-series-rank-10-missing-encryption-of-sensitive-data/
182182 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
183183 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf"
184 CWE-464,EN-Addition of Data Structure Sentinel (Type: Base),The accidental addition of a data-structure sentinel can cause serious programming logic problems.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High to Very High,
185 CWE-67,EN-Improper Handling of Windows Device Names (Type: Variant),"The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a Windows device name such as AUX or CON. This typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file.","Not properly handling virtual filenames (e.g. AUX, CON, PRN, COM1, LPT1) can result in different types of vulnerabilities. In some cases an attacker can request a device via injection of a virtual filename in a URL, which may cause an error that leads to a denial of service or an error page that reveals sensitive information. A software system that allows device names to bypass filtering runs the risk of an attacker injecting malicious code in a file with the name of a device.",,High to Very High,"Writing Secure Code
184 CWE-464,Addition of Data Structure Sentinel (Type: Base),The accidental addition of a data-structure sentinel can cause serious programming logic problems.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High to Very High,
185 CWE-67,Improper Handling of Windows Device Names (Type: Variant),"The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a Windows device name such as AUX or CON. This typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file.","Not properly handling virtual filenames (e.g. AUX, CON, PRN, COM1, LPT1) can result in different types of vulnerabilities. In some cases an attacker can request a device via injection of a virtual filename in a URL, which may cause an error that leads to a denial of service or an error page that reveals sensitive information. A software system that allows device names to bypass filtering runs the risk of an attacker injecting malicious code in a file with the name of a device.",,High to Very High,"Writing Secure Code
186186 The Art of Software Security Assessment: Chapter 11, ""Device Files"", Page 666."
187 CWE-73,EN-External Control of File Name or Path (Type: Class),The software allows user input to control or influence paths or file names that are used in filesystem operations.,"This could allow an attacker to access or modify system files or other files that are critical to the application.
187 CWE-73,External Control of File Name or Path (Type: Class),The software allows user input to control or influence paths or file names that are used in filesystem operations.,"This could allow an attacker to access or modify system files or other files that are critical to the application.
188188 Path manipulation errors occur when the following two conditions are met:
189189 1. An attacker can specify a path used in an operation on the filesystem.
190190 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
191191 For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.",,High to Very High,OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
192 CWE-76,EN-Improper Neutralization of Equivalent Special Elements (Type: Base),"The software properly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.","The software may have a fixed list of special characters it believes is complete. However, there may be alternate encodings, or representations that also have the same meaning. For example, the software may filter out a leading slash (/) to prevent absolute path names, but does not account for a tilde (~) followed by a user name, which on some *nix systems could be expanded to an absolute pathname. Alternately, the software might filter a dangerous ""-e"" command-line switch when calling an external program, but it might not account for ""--exec"" or other switches that have the same semantics.",,High to Very High,
193 CWE-79,EN-Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) (Type: Base),The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.,"Cross-site scripting (XSS) vulnerabilities occur when:
192 CWE-76,Improper Neutralization of Equivalent Special Elements (Type: Base),"The software properly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.","The software may have a fixed list of special characters it believes is complete. However, there may be alternate encodings, or representations that also have the same meaning. For example, the software may filter out a leading slash (/) to prevent absolute path names, but does not account for a tilde (~) followed by a user name, which on some *nix systems could be expanded to an absolute pathname. Alternately, the software might filter a dangerous ""-e"" command-line switch when calling an external program, but it might not account for ""--exec"" or other switches that have the same semantics.",,High to Very High,
193 CWE-79,Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) (Type: Base),The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.,"Cross-site scripting (XSS) vulnerabilities occur when:
194194 1. Untrusted data enters a web application, typically from a web request.
195195 2. The web application dynamically generates a web page that contains this untrusted data.
196196 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
221221 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
222222 Top 25 series - Rank 1 - Cross Site Scripting: http://blogs.sans.org/appsecstreetfighter/2010/02/22/top-25-series-rank-1-cross-site-scripting/
223223 The Art of Software Security Assessment: Chapter 17, ""Cross Site Scripting"", Page 1071."
224 CWE-80,EN-Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as ""<"", "">"", and ""&"" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.","This may allow such characters to be treated as control characters, which are executed client-side in the context of the user's session. Although this can be classified as an injection problem, the more pertinent issue is the improper conversion of such special characters to respective context-appropriate entities before displaying them to the user.",,High to Very High,
225 CWE-98,EN-Improper Control of Filename for Include/Require Statement in PHP Program (PHP Remote File Inclusion) (Type: Base),"The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in ""require,"" ""include,"" or similar functions.","In certain versions and configurations of PHP, this can allow an attacker to specify a URL to a remote location from which the software will obtain the code to execute. In other cases in association with path traversal, the attacker can specify a local file that may contain executable statements that can be parsed by PHP.",,High to Very High,"Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
224 CWE-80,Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as ""<"", "">"", and ""&"" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.","This may allow such characters to be treated as control characters, which are executed client-side in the context of the user's session. Although this can be classified as an injection problem, the more pertinent issue is the improper conversion of such special characters to respective context-appropriate entities before displaying them to the user.",,High to Very High,
225 CWE-98,Improper Control of Filename for Include/Require Statement in PHP Program (PHP Remote File Inclusion) (Type: Base),"The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in ""require,"" ""include,"" or similar functions.","In certain versions and configurations of PHP, this can allow an attacker to specify a URL to a remote location from which the software will obtain the code to execute. In other cases in association with path traversal, the attacker can specify a local file that may contain executable statements that can be parsed by PHP.",,High to Very High,"Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
226226 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
227227 A Study in Scarlet: http://www.cgisecurity.com/lib/studyinscarlet.txt
228228 Suhosin: http://www.hardened-php.net/suhosin/
229229 Top 25 Series - Rank 13 - PHP File Inclusion: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-13-php-file-inclusion/"
230 CWE-188,EN-Reliance on Data/Memory Layout (Type: Base),"The software makes invalid assumptions about how protocol data or memory is organized at a lower level, resulting in unintended program behavior.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Structure Padding"", Page 284."
231 CWE-197,EN-Numeric Truncation Error (Type: Base),Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.,"When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Truncation"", Page 259."
232 CWE-252,EN-Unchecked Return Value (Type: Base),"The software does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341.
230 CWE-188,Reliance on Data/Memory Layout (Type: Base),"The software makes invalid assumptions about how protocol data or memory is organized at a lower level, resulting in unintended program behavior.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Structure Padding"", Page 284."
231 CWE-197,Numeric Truncation Error (Type: Base),Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.,"When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Truncation"", Page 259."
232 CWE-252,Unchecked Return Value (Type: Base),"The software does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341.
233233 Writing Secure Code: Chapter 20, ""Checking Returns"" Page 624
234234 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
235235 ERR10-CPP. Check for error conditions: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR10-CPP.+Check+for+error+conditions"
236 CWE-253,EN-Incorrect Check of Function Return Value (Type: Base),"The software incorrectly checks a return value from a function, which prevents the software from detecting errors or exceptional conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Return Value Testing and Interpretation"", Page 340."
237 CWE-296,EN-Improper Following of a Certificates Chain of Trust (Type: Base),"The software does not follow, or incorrectly follows, the chain of trust for a certificate back to a trusted root certificate, resulting in incorrect trust of any resource that is associated with that certificate.","If a system does not follow the chain of trust of a certificate to a root server, the certificate loses all usefulness as a metric of trust. Essentially, the trust gained from a certificate is derived from a chain of trust -- with a reputable trusted entity at the end of that list. The end user must trust that reputable source, and this reputable source must vouch for the resource in question through the medium of the certificate.
236 CWE-253,Incorrect Check of Function Return Value (Type: Base),"The software incorrectly checks a return value from a function, which prevents the software from detecting errors or exceptional conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Return Value Testing and Interpretation"", Page 340."
237 CWE-296,Improper Following of a Certificates Chain of Trust (Type: Base),"The software does not follow, or incorrectly follows, the chain of trust for a certificate back to a trusted root certificate, resulting in incorrect trust of any resource that is associated with that certificate.","If a system does not follow the chain of trust of a certificate to a root server, the certificate loses all usefulness as a metric of trust. Essentially, the trust gained from a certificate is derived from a chain of trust -- with a reputable trusted entity at the end of that list. The end user must trust that reputable source, and this reputable source must vouch for the resource in question through the medium of the certificate.
238238 In some cases, this trust traverses several entities who vouch for one another. The entity trusted by the end user is at one end of this trust chain, while the certificate-wielding resource is at the other end of the chain. If the user receives a certificate at the end of one of these trust chains and then proceeds to check only that the first link in the chain, no real trust has been derived, since the entire chain must be traversed back to a trusted source to verify the certificate.
239239 There are several ways in which the chain of trust might be broken, including but not limited to:
240240 Any certificate in the chain is self-signed, unless it the root.
242242 An intermediate, CA-signed certificate does not have the expected Basic Constraints or other important extensions.
243243 The root certificate has been compromised or authorized to the wrong party.",,Low,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
244244 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
245 CWE-298,EN-Improper Validation of Certificate Expiration (Type: Variant),"A certificate expiration is not validated or is incorrectly validated, so trust may be assigned to certificates that have been abandoned due to age.","When the expiration of a certificate is not taken into account, no trust has necessarily been conveyed through it. Therefore, the validity of the certificate cannot be verified and all benefit of the certificate is lost.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
246 CWE-324,EN-Use of a Key Past its Expiration Date (Type: Base),"The product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key.","While the expiration of keys does not necessarily ensure that they are compromised, it is a significant concern that keys which remain in use for prolonged periods of time have a decreasing probability of integrity. For this reason, it is important to replace keys within a period of time proportional to their strength.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
247 CWE-379,EN-Creation of Temporary File in Directory with Incorrect Permissions (Type: Base),The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Low,"The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538."
248 CWE-462,EN-Duplicate Key in Associative List (Alist) (Type: Base),Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.,"A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.",,Low,
249 CWE-479,EN-Signal Handler Use of a Non-reentrant Function (Type: Variant),The program defines a signal handler that calls a non-reentrant function.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
245 CWE-298,Improper Validation of Certificate Expiration (Type: Variant),"A certificate expiration is not validated or is incorrectly validated, so trust may be assigned to certificates that have been abandoned due to age.","When the expiration of a certificate is not taken into account, no trust has necessarily been conveyed through it. Therefore, the validity of the certificate cannot be verified and all benefit of the certificate is lost.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
246 CWE-324,Use of a Key Past its Expiration Date (Type: Base),"The product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key.","While the expiration of keys does not necessarily ensure that they are compromised, it is a significant concern that keys which remain in use for prolonged periods of time have a decreasing probability of integrity. For this reason, it is important to replace keys within a period of time proportional to their strength.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
247 CWE-379,Creation of Temporary File in Directory with Incorrect Permissions (Type: Base),The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Low,"The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538."
248 CWE-462,Duplicate Key in Associative List (Alist) (Type: Base),Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.,"A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.",,Low,
249 CWE-479,Signal Handler Use of a Non-reentrant Function (Type: Variant),The program defines a signal handler that calls a non-reentrant function.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
250250 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
251 CWE-480,EN-Use of Incorrect Operator (Type: Base),"The programmer accidentally uses the wrong operator, which changes the application logic in security-relevant ways.","Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
251 CWE-480,Use of Incorrect Operator (Type: Base),"The programmer accidentally uses the wrong operator, which changes the application logic in security-relevant ways.","Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
252252 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
253 CWE-481,EN-Assigning instead of Comparing (Type: Variant),The code uses an operator for assignment when the intention was to perform a comparison.,"In many languages the compare statement is very close in appearance to the assignment statement and are often confused. This bug is generally the result of a typo and usually causes obvious problems with program execution. If the comparison is in an if statement, the if statement will usually evaluate the value of the right-hand side of the predicate.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
254 CWE-482,EN-Comparing instead of Assigning (Type: Variant),The code uses an operator for comparison when the intention was to perform an assignment.,"In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
255 CWE-483,EN-Incorrect Block Delimitation (Type: Variant),"The code does not explicitly delimit a block that is intended to contain 2 or more statements, creating a logic error.","In some languages, braces (or other delimiters) are optional for blocks. When the delimiter is omitted, it is possible to insert a logic error in which a statement is thought to be in a block but is not. In some cases, the logic error can have security implications.",,Low,
256 CWE-641,EN-Improper Restriction of Names for Files and Other Resources (Type: Base),"The application constructs the name of a file or other resource using input from an upstream component, but does not restrict or incorrectly restricts the resulting name.","This may produce resultant weaknesses. For instance, if the names of these resources contain scripting characters, it is possible that a script may get executed in the client's browser if the application ever displays the name of the resource on a dynamically generated web page. Alternately, if the resources are consumed by some application parser, a specially crafted name can exploit some vulnerability internal to the parser, potentially resulting in execution of arbitrary code on the server machine. The problems will vary based on the context of usage of such malformed resource names and whether vulnerabilities are present in or assumptions are made by the targeted technology that would make code execution possible.",,Low,
257 CWE-648,EN-Incorrect Use of Privileged APIs (Type: Base),The application does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.,"When an application contains certain functions that perform operations requiring an elevated level of privilege, the caller of a privileged API must be careful to:
253 CWE-481,Assigning instead of Comparing (Type: Variant),The code uses an operator for assignment when the intention was to perform a comparison.,"In many languages the compare statement is very close in appearance to the assignment statement and are often confused. This bug is generally the result of a typo and usually causes obvious problems with program execution. If the comparison is in an if statement, the if statement will usually evaluate the value of the right-hand side of the predicate.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
254 CWE-482,Comparing instead of Assigning (Type: Variant),The code uses an operator for comparison when the intention was to perform an assignment.,"In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
255 CWE-483,Incorrect Block Delimitation (Type: Variant),"The code does not explicitly delimit a block that is intended to contain 2 or more statements, creating a logic error.","In some languages, braces (or other delimiters) are optional for blocks. When the delimiter is omitted, it is possible to insert a logic error in which a statement is thought to be in a block but is not. In some cases, the logic error can have security implications.",,Low,
256 CWE-641,Improper Restriction of Names for Files and Other Resources (Type: Base),"The application constructs the name of a file or other resource using input from an upstream component, but does not restrict or incorrectly restricts the resulting name.","This may produce resultant weaknesses. For instance, if the names of these resources contain scripting characters, it is possible that a script may get executed in the client's browser if the application ever displays the name of the resource on a dynamically generated web page. Alternately, if the resources are consumed by some application parser, a specially crafted name can exploit some vulnerability internal to the parser, potentially resulting in execution of arbitrary code on the server machine. The problems will vary based on the context of usage of such malformed resource names and whether vulnerabilities are present in or assumptions are made by the targeted technology that would make code execution possible.",,Low,
257 CWE-648,Incorrect Use of Privileged APIs (Type: Base),The application does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.,"When an application contains certain functions that perform operations requiring an elevated level of privilege, the caller of a privileged API must be careful to:
258258 ensure that assumptions made by the APIs are valid, such as validity of arguments
259259 account for known weaknesses in the design/implementation of the API
260260 call the API from a safe context
261261 If the caller of the API does not follow these requirements, then it may allow a malicious user or process to elevate their privilege, hijack the process, or steal sensitive data.
262262 For instance, it is important to know if privileged APIs do not shed their privileges before returning to the caller or if the privileged function might make certain assumptions about the data, context or state information passed to it by the caller. It is important to always know when and how privileged APIs can be called in order to ensure that their elevated level of privilege cannot be exploited.",,Low,
263 CWE-762,EN-Mismatched Memory Management Routines (Type: Variant),"The application attempts to return a memory resource to the system, but it calls a release function that is not compatible with the function that was originally used to allocate that resource.","This weakness can be generally described as mismatching memory management routines, such as:
263 CWE-762,Mismatched Memory Management Routines (Type: Variant),"The application attempts to return a memory resource to the system, but it calls a release function that is not compatible with the function that was originally used to allocate that resource.","This weakness can be generally described as mismatching memory management routines, such as:
264264 The memory was allocated on the stack (automatically), but it was deallocated using the memory management routine free() (CWE-590), which is intended for explicitly allocated heap memory.
265265 The memory was allocated explicitly using one set of memory management functions, and deallocated using a different set. For example, memory might be allocated with malloc() in C++ instead of the new operator, and then deallocated with the delete operator.
266266 When the memory management functions are mismatched, the consequences may be as severe as code execution, memory corruption, or program crash. Consequences and ease of exploit will vary depending on the implementation of the routines and the object being managed.",,Low,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
267267 Valgrind: http://valgrind.org/"
268 CWE-783,EN-Operator Precedence Logic Error (Type: Variant),The program uses an expression in which operator precedence causes incorrect logic to be used.,"While often just a bug, operator precedence logic errors can have serious consequences if they are used in security-critical code, such as making an authentication decision.",,Low,"EXP00-C. Use parentheses for precedence of operation: https://www.securecoding.cert.org/confluence/display/seccode/EXP00-C.+Use+parentheses+for+precedence+of+operation
268 CWE-783,Operator Precedence Logic Error (Type: Variant),The program uses an expression in which operator precedence causes incorrect logic to be used.,"While often just a bug, operator precedence logic errors can have serious consequences if they are used in security-critical code, such as making an authentication decision.",,Low,"EXP00-C. Use parentheses for precedence of operation: https://www.securecoding.cert.org/confluence/display/seccode/EXP00-C.+Use+parentheses+for+precedence+of+operation
269269 The Art of Software Security Assessment: Chapter 6, ""Precedence"", Page 287."
270 CWE-789,EN-Uncontrolled Memory Allocation (Type: Variant),"The product allocates memory based on an untrusted size value, but it does not validate or incorrectly validates the size, allowing arbitrary amounts of memory to be allocated.","This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Low,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
271 CWE-333,EN-Improper Handling of Insufficient Entropy in TRNG (Type: Variant),True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Low to Medium,
272 CWE-367,EN-Time-of-check Time-of-use (TOCTOU) Race Condition (Type: Base),"The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. This can cause the software to perform invalid actions when the resource is in an unexpected state.","This weakness can be security-relevant when an attacker can influence the state of the resource between check and use. This can happen with shared resources such as files, memory, or even variables in multithreaded programs.",,Low to Medium,"Portably Solving File TOCTTOU Races with Hardness Amplification: http://www.usenix.org/events/fast08/tech/tsafrir.html
270 CWE-789,Uncontrolled Memory Allocation (Type: Variant),"The product allocates memory based on an untrusted size value, but it does not validate or incorrectly validates the size, allowing arbitrary amounts of memory to be allocated.","This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Low,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
271 CWE-333,Improper Handling of Insufficient Entropy in TRNG (Type: Variant),True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Low to Medium,
272 CWE-367,Time-of-check Time-of-use (TOCTOU) Race Condition (Type: Base),"The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. This can cause the software to perform invalid actions when the resource is in an unexpected state.","This weakness can be security-relevant when an attacker can influence the state of the resource between check and use. This can happen with shared resources such as files, memory, or even variables in multithreaded programs.",,Low to Medium,"Portably Solving File TOCTTOU Races with Hardness Amplification: http://www.usenix.org/events/fast08/tech/tsafrir.html
273273 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
274274 The Art of Software Security Assessment: Chapter 9, ""TOCTOU"", Page 527."
275 CWE-404,EN-Improper Resource Shutdown or Release (Type: Base),The program does not release or incorrectly releases a resource before it is made available for re-use.,"When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
276 CWE-407,EN-Algorithmic Complexity (Type: Base),"An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Low to Medium,Algorithmic Complexity Attacks: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/index.html
277 CWE-415,EN-Double Free (Type: Variant),"The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.","When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
275 CWE-404,Improper Resource Shutdown or Release (Type: Base),The program does not release or incorrectly releases a resource before it is made available for re-use.,"When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
276 CWE-407,Algorithmic Complexity (Type: Base),"An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Low to Medium,Algorithmic Complexity Attacks: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/index.html
277 CWE-415,Double Free (Type: Variant),"The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.","When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
278278 The Art of Software Security Assessment: Chapter 7, ""Double Frees"", Page 379."
279 CWE-59,EN-Improper Link Resolution Before File Access (Link Following) (Type: Base),"The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.","Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Low to Medium,"The Art of Software Security Assessment: Chapter 9, ""Symbolic Link Attacks"", Page 518."
280 CWE-601,EN-URL Redirection to Untrusted Site (Open Redirect) (Type: Variant),"A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.","An http parameter may contain a URL value and could cause the web application to redirect the request to the specified URL. By modifying the URL value to a malicious site, an attacker may successfully launch a phishing scam and steal user credentials. Because the server name in the modified link is identical to the original site, phishing attempts have a more trustworthy appearance.",,Low to Medium,"Exploitable Redirects on the Web: Identification, Prevalence, and Defense: http://www.cs.indiana.edu/cgi-pub/cshue/research/woot08.pdf
279 CWE-59,Improper Link Resolution Before File Access (Link Following) (Type: Base),"The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.","Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Low to Medium,"The Art of Software Security Assessment: Chapter 9, ""Symbolic Link Attacks"", Page 518."
280 CWE-601,URL Redirection to Untrusted Site (Open Redirect) (Type: Variant),"A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.","An http parameter may contain a URL value and could cause the web application to redirect the request to the specified URL. By modifying the URL value to a malicious site, an attacker may successfully launch a phishing scam and steal user credentials. Because the server name in the modified link is identical to the original site, phishing attempts have a more trustworthy appearance.",,Low to Medium,"Exploitable Redirects on the Web: Identification, Prevalence, and Defense: http://www.cs.indiana.edu/cgi-pub/cshue/research/woot08.pdf
281281 Open redirect vulnerabilities: definition and prevention: http://www.net-security.org/dl/insecure/INSECURE-Mag-17.pdf
282282 Top 25 Series - Rank 23 - Open Redirect: http://software-security.sans.org/blog/2010/03/25/top-25-series-rank-23-open-redirect
283283 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
284 CWE-749,EN-Exposed Dangerous Method or Function (Type: Base),"The software provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.","This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
284 CWE-749,Exposed Dangerous Method or Function (Type: Base),"The software provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.","This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
285285 The exposure can occur in a few different ways:
286286 1) The function/method was never intended to be exposed to outside actors.
287287 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Low to Medium,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
288288 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp"
289 CWE-755,EN-Improper Handling of Exceptional Conditions (Type: Class),The software does not handle or incorrectly handles an exceptional condition.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
289 CWE-755,Improper Handling of Exceptional Conditions (Type: Class),The software does not handle or incorrectly handles an exceptional condition.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
290290 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Low to Medium,
291 CWE-766,EN-Critical Variable Declared Public (Type: Variant),The software declares a critical variable or field to be public when intended security policy requires it to be private.,"When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Low to Medium,
292 CWE-767,EN-Access to Critical Private Variable via Public Method (Type: Variant),The software defines a public method that reads or modifies a private variable.,"If an attacker modifies the variable to contain unexpected values, this could violate assumptions from other parts of the code. Additionally, if an attacker can read the private variable, it may expose sensitive information or make it easier to launch further attacks.",,Low to Medium,
293 CWE-776,EN-Improper Restriction of Recursive Entity References in DTDs (XML Entity Expansion) (Type: Variant),"The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.","If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.",,Low to Medium,"Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD: http://www.securityfocus.com/archive/1/303509
291 CWE-766,Critical Variable Declared Public (Type: Variant),The software declares a critical variable or field to be public when intended security policy requires it to be private.,"When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Low to Medium,
292 CWE-767,Access to Critical Private Variable via Public Method (Type: Variant),The software defines a public method that reads or modifies a private variable.,"If an attacker modifies the variable to contain unexpected values, this could violate assumptions from other parts of the code. Additionally, if an attacker can read the private variable, it may expose sensitive information or make it easier to launch further attacks.",,Low to Medium,
293 CWE-776,Improper Restriction of Recursive Entity References in DTDs (XML Entity Expansion) (Type: Variant),"The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.","If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.",,Low to Medium,"Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD: http://www.securityfocus.com/archive/1/303509
294294 XML security: Preventing XML bombs: http://searchsoftwarequality.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid92_gci1168442,00.html?asrc=SS_CLA_302%20%20558&psrc=CLT_92#
295295 Dismantling an XML-Bomb: http://blog.didierstevens.com/2008/09/23/dismantling-an-xml-bomb/
296296 XML Entity Expansion: http://projects.webappsec.org/XML-Entity-Expansion
297297 Tip: Configure SAX parsers for secure processing: http://www.ibm.com/developerworks/xml/library/x-tipcfsx.html
298298 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
299299 Preventing Entity Expansion Attacks in JAXB: http://blog.bdoughan.com/2011/03/preventing-entity-expansion-attacks-in.html"
300 CWE-777,EN-Regular Expression without Anchors (Type: Variant),"The software uses a regular expression to perform neutralization, but the regular expression is not anchored and may allow malicious or malformed data to slip through.","When performing tasks such as whitelist validation, data is examined and possibly modified to ensure that it is well-formed and adheres to a list of safe values. If the regular expression is not anchored, malicious or malformed data may be included before or after any string matching the regular expression. The type of malicious data that is allowed will depend on the context of the application and which anchors are omitted from the regular expression.",,Low to Medium,
301 CWE-779,EN-Logging of Excessive Data (Type: Base),"The software logs too much information, making log files hard to process and possibly hindering recovery efforts or forensic analysis after an attack.","While logging is a good practice in general, and very high levels of logging are appropriate for debugging stages of development, too much logging in a production environment might hinder a system administrator's ability to detect anomalous conditions. This can provide cover for an attacker while attempting to penetrate a system, clutter the audit trail for forensic analysis, or make it more difficult to debug problems in a production environment.",,Low to Medium,
302 CWE-781,EN-Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code (Type: Variant),"The software defines an IOCTL that uses METHOD_NEITHER for I/O, but it does not validate or incorrectly validates the addresses that are provided.","When an IOCTL uses the METHOD_NEITHER option for I/O control, it is the responsibility of the IOCTL to validate the addresses that have been supplied to it. If validation is missing or incorrect, attackers can supply arbitrary memory addresses, leading to code execution or a denial of service.",,Low to Medium,"Exploiting Common Flaws in Drivers: http://reversemode.com/index.php?option=com_content&task=view&id=38&Itemid=1
300 CWE-777,Regular Expression without Anchors (Type: Variant),"The software uses a regular expression to perform neutralization, but the regular expression is not anchored and may allow malicious or malformed data to slip through.","When performing tasks such as whitelist validation, data is examined and possibly modified to ensure that it is well-formed and adheres to a list of safe values. If the regular expression is not anchored, malicious or malformed data may be included before or after any string matching the regular expression. The type of malicious data that is allowed will depend on the context of the application and which anchors are omitted from the regular expression.",,Low to Medium,
301 CWE-779,Logging of Excessive Data (Type: Base),"The software logs too much information, making log files hard to process and possibly hindering recovery efforts or forensic analysis after an attack.","While logging is a good practice in general, and very high levels of logging are appropriate for debugging stages of development, too much logging in a production environment might hinder a system administrator's ability to detect anomalous conditions. This can provide cover for an attacker while attempting to penetrate a system, clutter the audit trail for forensic analysis, or make it more difficult to debug problems in a production environment.",,Low to Medium,
302 CWE-781,Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code (Type: Variant),"The software defines an IOCTL that uses METHOD_NEITHER for I/O, but it does not validate or incorrectly validates the addresses that are provided.","When an IOCTL uses the METHOD_NEITHER option for I/O control, it is the responsibility of the IOCTL to validate the addresses that have been supplied to it. If validation is missing or incorrect, attackers can supply arbitrary memory addresses, leading to code execution or a denial of service.",,Low to Medium,"Exploiting Common Flaws in Drivers: http://reversemode.com/index.php?option=com_content&task=view&id=38&Itemid=1
303303 Remote and Local Exploitation of Network Drivers: https://www.blackhat.com/presentations/bh-usa-07/Bulygin/Presentation/bh-usa-07-bulygin.pdf
304304 Windows driver vulnerabilities: the METHOD_NEITHER odyssey: http://www.net-security.org/dl/insecure/INSECURE-Mag-18.pdf
305305 Buffer Descriptions for I/O Control Codes: http://msdn.microsoft.com/en-us/library/ms795857.aspx
306306 Using Neither Buffered Nor Direct I/O: http://msdn.microsoft.com/en-us/library/cc264614.aspx
307307 Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
308308 No description: http://www.piotrbania.com/all/articles/ewdd.pdf"
309 CWE-782,EN-Exposed IOCTL with Insufficient Access Control (Type: Variant),"The software implements an IOCTL with functionality that should be restricted, but it does not properly enforce access control for the IOCTL.","When an IOCTL contains privileged functionality and is exposed unnecessarily, attackers may be able to access this functionality by invoking the IOCTL. Even if the functionality is benign, if the programmer has assumed that the IOCTL would only be accessed by a trusted process, there may be little or no validation of the incoming data, exposing weaknesses that would never be reachable if the attacker cannot call the IOCTL directly.
309 CWE-782,Exposed IOCTL with Insufficient Access Control (Type: Variant),"The software implements an IOCTL with functionality that should be restricted, but it does not properly enforce access control for the IOCTL.","When an IOCTL contains privileged functionality and is exposed unnecessarily, attackers may be able to access this functionality by invoking the IOCTL. Even if the functionality is benign, if the programmer has assumed that the IOCTL would only be accessed by a trusted process, there may be little or no validation of the incoming data, exposing weaknesses that would never be reachable if the attacker cannot call the IOCTL directly.
310310 The implementations of IOCTLs will differ between operating system types and versions, so the methods of attack and prevention may vary widely.",,Low to Medium,Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
311 CWE-117,EN-Improper Output Neutralization for Logs (Type: Base),The software does not neutralize or incorrectly neutralizes output that is written to logs.,"This can allow an attacker to forge log entries or inject malicious content into logs.
311 CWE-117,Improper Output Neutralization for Logs (Type: Base),The software does not neutralize or incorrectly neutralizes output that is written to logs.,"This can allow an attacker to forge log entries or inject malicious content into logs.
312312 Log forging vulnerabilities occur when:
313313 Data enters an application from an untrusted source.
314314 The data is written to an application or system log file.",,Medium,"Exploiting Software: How to Break Code
315315 The night the log was forged: http://doc.novsu.ac.ru/oreilly/tcpip/puis/ch10_05.htm
316316 OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007"
317 CWE-124,EN-Buffer Underwrite (Buffer Underflow) (Type: Base),The software writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Medium,"Buffer UNDERFLOWS: What do you know about it?: http://seclists.org/vuln-dev/2004/Jan/0022.html
317 CWE-124,Buffer Underwrite (Buffer Underflow) (Type: Base),The software writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Medium,"Buffer UNDERFLOWS: What do you know about it?: http://seclists.org/vuln-dev/2004/Jan/0022.html
318318 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
319 CWE-128,EN-Wrap-around Error (Type: Base),"Wrap around errors occur whenever a value is incremented past the maximum value for its type and therefore ""wraps around"" to a very small, negative, or undefined value.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Medium,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
319 CWE-128,Wrap-around Error (Type: Base),"Wrap around errors occur whenever a value is incremented past the maximum value for its type and therefore ""wraps around"" to a very small, negative, or undefined value.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Medium,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
320320 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
321 CWE-170,EN-Improper Null Termination (Type: Base),The software does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Medium,
322 CWE-190,EN-Integer Overflow or Wraparound (Type: Base),"The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.","An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.",,Medium,"An overview of common programming security vulnerabilities and possible solutions: http://fort-knox.org/thesis.pdf
321 CWE-170,Improper Null Termination (Type: Base),The software does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Medium,
322 CWE-190,Integer Overflow or Wraparound (Type: Base),"The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.","An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.",,Medium,"An overview of common programming security vulnerabilities and possible solutions: http://fort-knox.org/thesis.pdf
323323 Basic Integer Overflows: http://www.phrack.org/issues.html?issue=60&id=10#article
324324 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
325325 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
326326 SafeInt: http://safeint.codeplex.com/
327327 Top 25 Series - Rank 17 - Integer Overflow Or Wraparound: http://software-security.sans.org/blog/2010/03/18/top-25-series-rank-17-integer-overflow-or-wraparound
328328 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
329 CWE-196,EN-Unsigned to Signed Conversion Error (Type: Variant),An unsigned-to-signed conversion error takes place when a large unsigned primitive is used as a signed value.,It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Medium,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
330 CWE-202,EN-Exposure of Sensitive Data Through Data Queries (Type: Variant),"When trying to keep information confidential, an attacker can often infer some of the information by using statistics.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Medium,
331 CWE-250,EN-Execution with Unnecessary Privileges (Type: Class),"The software performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.","New weaknesses can be exposed because running with extra privileges, such as root or Administrator, can disable the normal security checks being performed by the operating system or surrounding environment. Other pre-existing weaknesses can turn into security vulnerabilities if they occur while operating at raised privileges.
329 CWE-196,Unsigned to Signed Conversion Error (Type: Variant),An unsigned-to-signed conversion error takes place when a large unsigned primitive is used as a signed value.,It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Medium,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
330 CWE-202,Exposure of Sensitive Data Through Data Queries (Type: Variant),"When trying to keep information confidential, an attacker can often infer some of the information by using statistics.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Medium,
331 CWE-250,Execution with Unnecessary Privileges (Type: Class),"The software performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.","New weaknesses can be exposed because running with extra privileges, such as root or Administrator, can disable the normal security checks being performed by the operating system or surrounding environment. Other pre-existing weaknesses can turn into security vulnerabilities if they occur while operating at raised privileges.
332332 Privilege management functions can behave in some less-than-obvious ways, and they have different quirks on different platforms. These inconsistencies are particularly pronounced if you are transitioning from one non-root user to another. Signal handlers and spawned processes run at the privilege of the owning process, so if a process is running as root when a signal fires or a sub-process is executed, the signal handler or sub-process will operate with root privileges.",,Medium,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
333333 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
334334 Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
335335 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm
336336 24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
337337 The Art of Software Security Assessment: Chapter 9, ""Privilege Vulnerabilities"", Page 477."
338 CWE-269,EN-Improper Privilege Management (Type: Base),"The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Medium,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
338 CWE-269,Improper Privilege Management (Type: Base),"The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Medium,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
339339 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
340 CWE-273,EN-Improper Check for Dropped Privileges (Type: Base),The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,
341 CWE-276,EN-Incorrect Default Permissions (Type: Variant),"The software, upon installation, sets incorrect permissions for an object that exposes it to an unintended actor.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,"The Art of Software Security Assessment: Chapter 3, ""Insecure Defaults"", Page 69."
342 CWE-299,EN-Improper Check for Certificate Revocation (Type: Variant),"The software does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.","An improper check for certificate revocation is a far more serious flaw than related certificate failures. This is because the use of any revoked certificate is almost certainly malicious. The most common reason for certificate revocation is compromise of the system in question, with the result that no legitimate servers will be using a revoked certificate, unless they are sorely out of sync.",,Medium,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
343 CWE-301,EN-Reflection Attack in an Authentication Protocol (Type: Variant),Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.,"A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Insufficient Validation"", Page 38."
344 CWE-329,EN-Not Using a Random IV with CBC Mode (Type: Variant),Not using a random initialization Vector (IV) with Cipher Block Chaining (CBC) Mode causes algorithms to be susceptible to dictionary attacks.,"This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Initialization Vectors"", Page 42."
345 CWE-332,EN-Insufficient Entropy in PRNG (Type: Variant),"The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
346 CWE-338,EN-Use of Cryptographically Weak PRNG (Type: Base),"The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG is not cryptographically strong.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Medium,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
347 CWE-353,EN-Missing Support for Integrity Check (Type: Base),"The software uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.","If integrity check values or ""checksums"" are omitted from a protocol, there is no way of determining if data has been corrupted in transmission. The lack of checksum functionality in a protocol removes the first application-level check of data that can be used. The end-to-end philosophy of checks states that integrity checks should be performed at the lowest level that they can be completely implemented. Excluding further sanity checks and input validation performed by applications, the protocol's checksum is the most important level of checksum, since it can be performed more completely than at any previous level and takes into account entire messages, as opposed to single packets.",,Medium,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
348 CWE-354,EN-Improper Validation of Integrity Check Value (Type: Base),"The software does not validate or incorrectly validates the integrity check values or ""checksums"" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.",Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.,,Medium,
349 CWE-362,EN-Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) (Type: Class),"The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.","This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
340 CWE-273,Improper Check for Dropped Privileges (Type: Base),The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,
341 CWE-276,Incorrect Default Permissions (Type: Variant),"The software, upon installation, sets incorrect permissions for an object that exposes it to an unintended actor.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,"The Art of Software Security Assessment: Chapter 3, ""Insecure Defaults"", Page 69."
342 CWE-299,Improper Check for Certificate Revocation (Type: Variant),"The software does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.","An improper check for certificate revocation is a far more serious flaw than related certificate failures. This is because the use of any revoked certificate is almost certainly malicious. The most common reason for certificate revocation is compromise of the system in question, with the result that no legitimate servers will be using a revoked certificate, unless they are sorely out of sync.",,Medium,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
343 CWE-301,Reflection Attack in an Authentication Protocol (Type: Variant),Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.,"A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Insufficient Validation"", Page 38."
344 CWE-329,Not Using a Random IV with CBC Mode (Type: Variant),Not using a random initialization Vector (IV) with Cipher Block Chaining (CBC) Mode causes algorithms to be susceptible to dictionary attacks.,"This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Initialization Vectors"", Page 42."
345 CWE-332,Insufficient Entropy in PRNG (Type: Variant),"The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
346 CWE-338,Use of Cryptographically Weak PRNG (Type: Base),"The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG is not cryptographically strong.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Medium,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
347 CWE-353,Missing Support for Integrity Check (Type: Base),"The software uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.","If integrity check values or ""checksums"" are omitted from a protocol, there is no way of determining if data has been corrupted in transmission. The lack of checksum functionality in a protocol removes the first application-level check of data that can be used. The end-to-end philosophy of checks states that integrity checks should be performed at the lowest level that they can be completely implemented. Excluding further sanity checks and input validation performed by applications, the protocol's checksum is the most important level of checksum, since it can be performed more completely than at any previous level and takes into account entire messages, as opposed to single packets.",,Medium,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
348 CWE-354,Improper Validation of Integrity Check Value (Type: Base),"The software does not validate or incorrectly validates the integrity check values or ""checksums"" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.",Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.,,Medium,
349 CWE-362,Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) (Type: Class),"The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.","This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
350350 A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
351351 A race condition violates these properties, which are closely related:
352352 Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
363363 Avoiding Race Conditions and Insecure File Operations: http://developer.apple.com/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html
364364 Top 25 Series - Rank 25 - Race Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/26/top-25-series-rank-25-race-conditions/
365365 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
366 CWE-364,EN-Signal Handler Race Condition (Type: Base),The software uses a signal handler that introduces a race condition.,"Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
366 CWE-364,Signal Handler Race Condition (Type: Base),The software uses a signal handler that introduces a race condition.,"Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
367367 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
368368 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
369369 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
380380 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html
381381 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
382382 The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
383 CWE-365,EN-Race Condition in Switch (Type: Base),"The code contains a switch statement in which the switched variable can be modified while the switch is still executing, resulting in unexpected behavior.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
383 CWE-365,Race Condition in Switch (Type: Base),"The code contains a switch statement in which the switched variable can be modified while the switch is still executing, resulting in unexpected behavior.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
384384 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
385385 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
386386 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
394394 Using synchronization in the signal handler
395395 Using synchronization in the regular code
396396 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
397 CWE-366,EN-Race Condition within a Thread (Type: Base),"If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
397 CWE-366,Race Condition within a Thread (Type: Base),"If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
398398 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
399399 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
400400 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
409409 Using synchronization in the regular code
410410 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
411411 The Art of Software Security Assessment: Chapter 13, ""Race Conditions"", Page 759."
412 CWE-369,EN-Divide By Zero (Type: Base),The product divides a value by zero.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Medium,"No description: http://www.cprogramming.com/tutorial/exceptions.html
412 CWE-369,Divide By Zero (Type: Base),The product divides a value by zero.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Medium,"No description: http://www.cprogramming.com/tutorial/exceptions.html
413413 No description: http://msdn.microsoft.com/en-us/library/ms173160(VS.80).aspx"
414 CWE-370,EN-Missing Check for Certificate Revocation after Initial Check (Type: Base),"The software does not check the revocation status of a certificate after its initial revocation check, which can cause the software to perform privileged actions even after the certificate is revoked at a later time.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
415 CWE-374,EN-Passing Mutable Objects to an Untrusted Method (Type: Base),"Sending non-cloned mutable data as an argument may result in that data being altered or deleted by the called function, thereby putting the calling function into an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"Does Java pass by reference or pass by value?: http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
414 CWE-370,Missing Check for Certificate Revocation after Initial Check (Type: Base),"The software does not check the revocation status of a certificate after its initial revocation check, which can cause the software to perform privileged actions even after the certificate is revoked at a later time.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
415 CWE-374,Passing Mutable Objects to an Untrusted Method (Type: Base),"Sending non-cloned mutable data as an argument may result in that data being altered or deleted by the called function, thereby putting the calling function into an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"Does Java pass by reference or pass by value?: http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
416416 Java: The Complete Reference, J2SE 5th Edition"
417 CWE-375,EN-Returning a Mutable Object to an Untrusted Caller (Type: Base),"Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function, thereby putting the class in an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,
418 CWE-385,EN-Covert Timing Channel (Type: Base),"Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
417 CWE-375,Returning a Mutable Object to an Untrusted Caller (Type: Base),"Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function, thereby putting the class in an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,
418 CWE-385,Covert Timing Channel (Type: Base),"Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
419419 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
420 CWE-390,EN-Detection of Error Condition Without Action (Type: Class),"The software detects a specific error, but takes no actions to handle the error.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
420 CWE-390,Detection of Error Condition Without Action (Type: Class),"The software detects a specific error, but takes no actions to handle the error.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
421421 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
422 CWE-391,EN-Unchecked Error Condition (Type: Base),Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
422 CWE-391,Unchecked Error Condition (Type: Base),Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
423423 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
424 CWE-401,EN-Improper Release of Memory Before Removing Last Reference (Memory Leak) (Type: Base),"The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.",This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Medium,How to Break Software Security
425 CWE-460,EN-Improper Cleanup on Thrown Exception (Type: Variant),"The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Medium,
426 CWE-468,EN-Incorrect Pointer Scaling (Type: Base),"In C and C++, one may often accidentally refer to the wrong memory due to the semantics of when math operations are implicitly scaled.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
427 CWE-469,EN-Use of Pointer Subtraction to Determine Size (Type: Base),"The application subtracts one pointer from another in order to determine size, but this calculation can be incorrect if the pointers do not exist in the same memory chunk.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,
428 CWE-476,EN-NULL Pointer Dereference (Type: Base),"A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Medium,
429 CWE-484,EN-Omitted Break Statement in Switch (Type: Base),"The program omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.",This can lead to critical code executing in situations where it should not.,,Medium,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
430 CWE-487,EN-Reliance on Package-level Scope (Type: Variant),"Java packages are not inherently closed; therefore, relying on them for code security is not a good practice.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,Medium,
431 CWE-492,EN-Use of Inner Class Containing Sensitive Data (Type: Variant),Inner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
424 CWE-401,Improper Release of Memory Before Removing Last Reference (Memory Leak) (Type: Base),"The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.",This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Medium,How to Break Software Security
425 CWE-460,Improper Cleanup on Thrown Exception (Type: Variant),"The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Medium,
426 CWE-468,Incorrect Pointer Scaling (Type: Base),"In C and C++, one may often accidentally refer to the wrong memory due to the semantics of when math operations are implicitly scaled.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
427 CWE-469,Use of Pointer Subtraction to Determine Size (Type: Base),"The application subtracts one pointer from another in order to determine size, but this calculation can be incorrect if the pointers do not exist in the same memory chunk.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,
428 CWE-476,NULL Pointer Dereference (Type: Base),"A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Medium,
429 CWE-484,Omitted Break Statement in Switch (Type: Base),"The program omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.",This can lead to critical code executing in situations where it should not.,,Medium,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
430 CWE-487,Reliance on Package-level Scope (Type: Variant),"Java packages are not inherently closed; therefore, relying on them for code security is not a good practice.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,Medium,
431 CWE-492,Use of Inner Class Containing Sensitive Data (Type: Variant),Inner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
432432 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Medium,
433 CWE-494,EN-Download of Code Without Integrity Check (Type: Base),The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Medium,"Introduction to Code Signing: http://msdn.microsoft.com/en-us/library/ms537361(VS.85).aspx
433 CWE-494,Download of Code Without Integrity Check (Type: Base),The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Medium,"Introduction to Code Signing: http://msdn.microsoft.com/en-us/library/ms537361(VS.85).aspx
434434 Authenticode: http://msdn.microsoft.com/en-us/library/ms537359(v=VS.85).aspx
435435 Code Signing Guide: http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html
436436 Secure Software Updates: Disappointments and New Challenges: http://prisms.cs.umass.edu/~kevinfu/papers/secureupdates-hotsec06.pdf
437437 24 Deadly Sins of Software Security: ""Sin 18: The Sins of Mobile Code."" Page 267
438438 Top 25 Series - Rank 20 - Download of Code Without Integrity Check: http://blogs.sans.org/appsecstreetfighter/2010/04/05/top-25-series-rank-20-download-code-integrity-check/
439439 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
440 CWE-498,EN-Cloneable Class Containing Sensitive Information (Type: Variant),"The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.","Cloneable classes are effectively open classes, since data cannot be hidden in them. Classes that do not explicitly deny cloning can be cloned by any other class without running the constructor.",,Medium,
441 CWE-502,EN-Deserialization of Untrusted Data (Type: Variant),The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.,"It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security -- which is a dangerous security assumption.
440 CWE-498,Cloneable Class Containing Sensitive Information (Type: Variant),"The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.","Cloneable classes are effectively open classes, since data cannot be hidden in them. Classes that do not explicitly deny cloning can be cloned by any other class without running the constructor.",,Medium,
441 CWE-502,Deserialization of Untrusted Data (Type: Variant),The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.,"It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security -- which is a dangerous security assumption.
442442 Data that is untrusted can not be trusted to be well-formed.",,Medium,"Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
443443 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
444 CWE-532,EN-Information Exposure Through Log Files (Type: Variant),Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Medium,
445 CWE-602,EN-Client-Side Enforcement of Server-Side Security (Type: Base),The software is composed of a server that relies on the client to implement a mechanism that is intended to protect the server.,"When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms resulting in potentially unexpected interactions between the client and server. The consequences will vary, depending on what the mechanisms are trying to protect.",,Medium,"Writing Secure Code: Chapter 23, ""Client-Side Security Is an Oxymoron"" Page 687"
446 CWE-665,EN-Improper Initialization (Type: Base),"The software does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.","This can have security implications when the associated resource is expected to have certain properties or values, such as a variable that determines whether a user has been authenticated or not.",,Medium,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
444 CWE-532,Information Exposure Through Log Files (Type: Variant),Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Medium,
445 CWE-602,Client-Side Enforcement of Server-Side Security (Type: Base),The software is composed of a server that relies on the client to implement a mechanism that is intended to protect the server.,"When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms resulting in potentially unexpected interactions between the client and server. The consequences will vary, depending on what the mechanisms are trying to protect.",,Medium,"Writing Secure Code: Chapter 23, ""Client-Side Security Is an Oxymoron"" Page 687"
446 CWE-665,Improper Initialization (Type: Base),"The software does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.","This can have security implications when the associated resource is expected to have certain properties or values, such as a variable that determines whether a user has been authenticated or not.",,Medium,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
447447 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
448448 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
449 CWE-754,EN-Improper Check for Unusual or Exceptional Conditions (Type: Class),The software does not check or improperly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
449 CWE-754,Improper Check for Unusual or Exceptional Conditions (Type: Class),The software does not check or improperly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
450450 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Medium,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341
451451 The Art of Software Security Assessment: Chapter 1, ""Exceptional Conditions,"" Page 22
452452 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
453453 Top 25 Series - Rank 15 - Improper Check for Unusual or Exceptional Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/15/top-25-series-rank-15-improper-check-for-unusual-or-exceptional-conditions/"
454 CWE-778,EN-Insufficient Logging (Type: Base),"When a security-critical event occurs, the software either does not record the event or omits important details about the event when logging it.","When security-critical events are not logged properly, such as a failed login attempt, this can make malicious behavior more difficult to detect and may hinder forensic analysis after an attack succeeds.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
455 CWE-780,EN-Use of RSA Algorithm without OAEP (Type: Variant),"The software uses the RSA algorithm but does not incorporate Optimal Asymmetric Encryption Padding (OAEP), which might weaken the encryption.",Padding schemes are often used with cryptographic algorithms to make the plaintext less predictable and complicate attack efforts. The OAEP scheme is often used with RSA to nullify the impact of predictable common text.,,Medium,"RSA Problem: http://people.csail.mit.edu/rivest/RivestKaliski-RSAProblem.pdf
454 CWE-778,Insufficient Logging (Type: Base),"When a security-critical event occurs, the software either does not record the event or omits important details about the event when logging it.","When security-critical events are not logged properly, such as a failed login attempt, this can make malicious behavior more difficult to detect and may hinder forensic analysis after an attack succeeds.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
455 CWE-780,Use of RSA Algorithm without OAEP (Type: Variant),"The software uses the RSA algorithm but does not incorporate Optimal Asymmetric Encryption Padding (OAEP), which might weaken the encryption.",Padding schemes are often used with cryptographic algorithms to make the plaintext less predictable and complicate attack efforts. The OAEP scheme is often used with RSA to nullify the impact of predictable common text.,,Medium,"RSA Problem: http://people.csail.mit.edu/rivest/RivestKaliski-RSAProblem.pdf
456456 Optimal Asymmetric Encryption Padding: http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding"
457 CWE-908,EN-Use of Uninitialized Resource (Type: Base),The software uses a resource that has not been properly initialized.,This can have security implications when the associated resource is expected to have certain properties or values.,,Medium,Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
458 CWE-909,EN-Missing Initialization of Resource (Type: Base),The software does not initialize a critical resource.,"Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.",,Medium,
459 CWE-910,EN-Use of Expired File Descriptor (Type: Base),The software uses or accesses a file descriptor after it has been closed.,"After a file descriptor for a particular file or device has been released, it can be reused. The code might not write to the original file, since the reused file descriptor might reference a different file or device.",,Medium,
460 CWE-911,EN-Improper Update of Reference Count (Type: Base),"The software uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.","Reference counts can be used when tracking how many objects contain a reference to a particular resource, such as in memory management or garbage collection. When the reference count reaches zero, the resource can be de-allocated or reused because there are no more objects that use it. If the reference count accidentally reaches zero, then the resource might be released too soon, even though it is still in use. If all objects no longer use the resource, but the reference count is not zero, then the resource might not ever be released.",,Medium,Windows Kernel Reference Count Vulnerabilities - Case Study: http://j00ru.vexillium.org/dump/zn_slides.pdf
461 CWE-94,EN-Improper Control of Generation of Code (Code Injection) (Type: Class),"The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution.
457 CWE-908,Use of Uninitialized Resource (Type: Base),The software uses a resource that has not been properly initialized.,This can have security implications when the associated resource is expected to have certain properties or values.,,Medium,Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
458 CWE-909,Missing Initialization of Resource (Type: Base),The software does not initialize a critical resource.,"Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.",,Medium,
459 CWE-910,Use of Expired File Descriptor (Type: Base),The software uses or accesses a file descriptor after it has been closed.,"After a file descriptor for a particular file or device has been released, it can be reused. The code might not write to the original file, since the reused file descriptor might reference a different file or device.",,Medium,
460 CWE-911,Improper Update of Reference Count (Type: Base),"The software uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.","Reference counts can be used when tracking how many objects contain a reference to a particular resource, such as in memory management or garbage collection. When the reference count reaches zero, the resource can be de-allocated or reused because there are no more objects that use it. If the reference count accidentally reaches zero, then the resource might be released too soon, even though it is still in use. If all objects no longer use the resource, but the reference count is not zero, then the resource might not ever be released.",,Medium,Windows Kernel Reference Count Vulnerabilities - Case Study: http://j00ru.vexillium.org/dump/zn_slides.pdf
461 CWE-94,Improper Control of Generation of Code (Code Injection) (Type: Class),"The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution.
462462 Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Medium,"24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63"
463 CWE-95,EN-Improper Neutralization of Directives in Dynamically Evaluated Code (Eval Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. ""eval"").","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Medium,"No description: http://www.rubycentral.com/book/taint.html
463 CWE-95,Improper Neutralization of Directives in Dynamically Evaluated Code (Eval Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. ""eval"").","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Medium,"No description: http://www.rubycentral.com/book/taint.html
464464 The Art of Software Security Assessment: Chapter 18, ""Inline Evaluation"", Page 1095."
465 CWE-287,EN-Improper Authentication (Type: Class),"When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Medium to High,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
465 CWE-287,Improper Authentication (Type: Class),"When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Medium to High,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
466466 Top 10 2007-Broken Authentication and Session Management: http://www.owasp.org/index.php/Top_10_2007-A7
467467 Guide to Authentication: http://www.owasp.org/index.php/Guide_to_Authentication
468468 Authentication: http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx
469469 Writing Secure Code: Chapter 4, ""Authentication"" Page 109"
470 CWE-306,EN-Missing Authentication for Critical Function (Type: Variant),The software does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.,"Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Medium to High,"The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authentication,"" Page 36
470 CWE-306,Missing Authentication for Critical Function (Type: Variant),The software does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.,"Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Medium to High,"The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authentication,"" Page 36
471471 Top 25 Series - Rank 19 - Missing Authentication for Critical Function: http://blogs.sans.org/appsecstreetfighter/2010/02/23/top-25-series-rank-19-missing-authentication-for-critical-function/
472472 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
473 CWE-319,EN-Cleartext Transmission of Sensitive Information (Type: Base),The software transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.,"Many communication channels can be ""sniffed"" by attackers during data transmission. For example, network traffic can often be sniffed by any attacker who has access to a network interface. This significantly lowers the difficulty of exploitation by attackers.",,Medium to High,"Top 10 2007-Insecure Communications: http://www.owasp.org/index.php/Top_10_2007-A9
473 CWE-319,Cleartext Transmission of Sensitive Information (Type: Base),The software transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.,"Many communication channels can be ""sniffed"" by attackers during data transmission. For example, network traffic can often be sniffed by any attacker who has access to a network interface. This significantly lowers the difficulty of exploitation by attackers.",,Medium to High,"Top 10 2007-Insecure Communications: http://www.owasp.org/index.php/Top_10_2007-A9
474474 Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
475475 24 Deadly Sins of Software Security: ""Sin 22: Failing to Protect Network Traffic."" Page 337
476476 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
477 CWE-327,EN-Use of a Broken or Risky Cryptographic Algorithm (Type: Base),The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.,The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.,,Medium to High,"Applied Cryptography: http://www.schneier.com/book-applied.html
477 CWE-327,Use of a Broken or Risky Cryptographic Algorithm (Type: Base),The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.,The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.,,Medium to High,"Applied Cryptography: http://www.schneier.com/book-applied.html
478478 Handbook of Applied Cryptography: http://www.cacr.math.uwaterloo.ca/hac/
479479 Avoiding bogus encryption products: Snake Oil FAQ: http://www.faqs.org/faqs/cryptography-faq/snake-oil/
480480 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
483483 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315
484484 Top 25 Series - Rank 24 - Use of a Broken or Risky Cryptographic Algorithm: http://blogs.sans.org/appsecstreetfighter/2010/03/25/top-25-series-rank-24-use-of-a-broken-or-risky-cryptographic-algorithm/
485485 The Art of Software Security Assessment: Chapter 2, ""Insufficient or Obsolete Encryption"", Page 44."
486 CWE-330,EN-Use of Insufficiently Random Values (Type: Class),The software may use insufficiently random numbers or values in a security context that depends on unpredictable numbers.,"When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium to High,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
486 CWE-330,Use of Insufficiently Random Values (Type: Class),The software may use insufficiently random numbers or values in a security context that depends on unpredictable numbers.,"When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium to High,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
487487 Building Secure Software: How to Avoid Security Problems the Right Way
488488 Writing Secure Code: Chapter 8, ""Using Poor Random Numbers"" Page 259
489489 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
490 CWE-400,EN-Uncontrolled Resource Consumption (Resource Exhaustion) (Type: Base),"The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.","Limited resources include memory, file system storage, database connection pool entries, or CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
490 CWE-400,Uncontrolled Resource Consumption (Resource Exhaustion) (Type: Base),"The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.","Limited resources include memory, file system storage, database connection pool entries, or CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
491491 Resource exhaustion problems have at least two common causes:
492492 Error conditions and other exceptional circumstances
493493 Confusion over which part of the program is responsible for releasing the resource",,Medium to High,"Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
494494 Resource exhaustion: http://cr.yp.to/docs/resources.html
495495 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
496496 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
497 CWE-434,EN-Unrestricted Upload of File with Dangerous Type (Type: Base),The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Medium to High,"Dynamic File Uploads, Security and You: http://shsc.info/FileUploadSecurity
497 CWE-434,Unrestricted Upload of File with Dangerous Type (Type: Base),The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Medium to High,"Dynamic File Uploads, Security and You: http://shsc.info/FileUploadSecurity
498498 8 Basic Rules to Implement Secure File Uploads: http://blogs.sans.org/appsecstreetfighter/2009/12/28/8-basic-rules-to-implement-secure-file-uploads/
499499 Top 25 Series - Rank 8 - Unrestricted Upload of Dangerous File Type: http://blogs.sans.org/appsecstreetfighter/2010/02/25/top-25-series-rank-8-unrestricted-upload-of-dangerous-file-type/
500500 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
501501 The Art of Software Security Assessment: Chapter 17, ""File Uploading"", Page 1068."
502 CWE-64,EN-Windows Shortcut Following (.LNK) (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the file is a Windows shortcut (.LNK) whose target is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.",The shortcut (file with the .lnk extension) can permit an attacker to read/write a file that they originally did not have permissions to access.,,Medium to High,
503 CWE-681,EN-Incorrect Conversion between Numeric Types (Type: Base),"When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Medium to High,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
504 CWE-732,EN-Incorrect Permission Assignment for Critical Resource (Type: Class),The software specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Medium to High,"The Art of Software Security Assessment: Chapter 9, ""File Permissions."" Page 495.
502 CWE-64,Windows Shortcut Following (.LNK) (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the file is a Windows shortcut (.LNK) whose target is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.",The shortcut (file with the .lnk extension) can permit an attacker to read/write a file that they originally did not have permissions to access.,,Medium to High,
503 CWE-681,Incorrect Conversion between Numeric Types (Type: Base),"When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Medium to High,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
504 CWE-732,Incorrect Permission Assignment for Critical Resource (Type: Class),The software specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Medium to High,"The Art of Software Security Assessment: Chapter 9, ""File Permissions."" Page 495.
505505 Building Secure Software: How to Avoid Security Problems the Right Way: Chapter 8, ""Access Control."" Page 194.
506506 Top 25 Series - Rank 21 - Incorrect Permission Assignment for Critical Response: http://software-security.sans.org/blog/2010/03/24/top-25-series-rank-21-incorrect-permission-assignment-for-critical-response
507507 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm"
508 CWE-770,EN-Allocation of Resources Without Limits or Throttling (Type: Base),"The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on how many resources can be allocated, in violation of the intended security policy for that actor.","Command injection vulnerabilities typically occur when:
508 CWE-770,Allocation of Resources Without Limits or Throttling (Type: Base),"The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on how many resources can be allocated, in violation of the intended security policy for that actor.","Command injection vulnerabilities typically occur when:
509509 1. Data enters the application from an untrusted source.
510510 2. The data is part of a string that is executed as a command by the application.
511511 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Medium to High,"Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
515515 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517
516516 Top 25 Series - Rank 22 - Allocation of Resources Without Limits or Throttling: http://blogs.sans.org/appsecstreetfighter/2010/03/23/top-25-series-rank-22-allocation-of-resources-without-limits-or-throttling/
517517 The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
518 CWE-771,EN-Missing Reference to Active Allocated Resource (Type: Base),"The software does not properly maintain a reference to a resource that has been allocated, which prevents the resource from being reclaimed.","This does not necessarily apply in languages or frameworks that automatically perform garbage collection, since the removal of all references may act as a signal that the resource is ready to be reclaimed.",,Medium to High,
519 CWE-772,EN-Missing Release of Resource after Effective Lifetime (Type: Base),"The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.","When a resource is not released after use, it can allow attackers to cause a denial of service.",,Medium to High,
520 CWE-773,EN-Missing Reference to Active File Descriptor or Handle (Type: Variant),"The software does not properly maintain references to a file descriptor or handle, which prevents that file descriptor/handle from being reclaimed.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,
521 CWE-774,EN-Allocation of File Descriptors or Handles Without Limits or Throttling (Type: Variant),"The software allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
522 CWE-775,EN-Missing Release of File Descriptor or Handle after Effective Lifetime (Type: Variant),"The software does not release a file descriptor or handle after its effective lifetime has ended, i.e., after the file descriptor/handle is no longer needed.","When a file descriptor or handle is not released after use (typically by explicitly closing it), attackers can cause a denial of service by consuming all available file descriptors/handles, or otherwise preventing other system processes from obtaining their own file descriptors/handles.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""File Descriptor Leaks"", Page 582."
523 CWE-804,EN-Guessable CAPTCHA (Type: Base),"The software uses a CAPTCHA challenge, but the challenge can be guessed or automatically recognized by a non-human actor.","An automated attacker could bypass the intended protection of the CAPTCHA challenge and perform actions at a higher frequency than humanly possible, such as launching spam attacks.
518 CWE-771,Missing Reference to Active Allocated Resource (Type: Base),"The software does not properly maintain a reference to a resource that has been allocated, which prevents the resource from being reclaimed.","This does not necessarily apply in languages or frameworks that automatically perform garbage collection, since the removal of all references may act as a signal that the resource is ready to be reclaimed.",,Medium to High,
519 CWE-772,Missing Release of Resource after Effective Lifetime (Type: Base),"The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.","When a resource is not released after use, it can allow attackers to cause a denial of service.",,Medium to High,
520 CWE-773,Missing Reference to Active File Descriptor or Handle (Type: Variant),"The software does not properly maintain references to a file descriptor or handle, which prevents that file descriptor/handle from being reclaimed.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,
521 CWE-774,Allocation of File Descriptors or Handles Without Limits or Throttling (Type: Variant),"The software allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
522 CWE-775,Missing Release of File Descriptor or Handle after Effective Lifetime (Type: Variant),"The software does not release a file descriptor or handle after its effective lifetime has ended, i.e., after the file descriptor/handle is no longer needed.","When a file descriptor or handle is not released after use (typically by explicitly closing it), attackers can cause a denial of service by consuming all available file descriptors/handles, or otherwise preventing other system processes from obtaining their own file descriptors/handles.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""File Descriptor Leaks"", Page 582."
523 CWE-804,Guessable CAPTCHA (Type: Base),"The software uses a CAPTCHA challenge, but the challenge can be guessed or automatically recognized by a non-human actor.","An automated attacker could bypass the intended protection of the CAPTCHA challenge and perform actions at a higher frequency than humanly possible, such as launching spam attacks.
524524 There can be several different causes of a guessable CAPTCHA:
525525 An audio or visual image that does not have sufficient distortion from the unobfuscated source image.
526526 A question is generated that with a format that can be automatically recognized, such as a math question.
527527 A question for which the number of possible answers is limited, such as birth years or favorite sports teams.
528528 A general-knowledge or trivia question for which the answer can be accessed using a data base, such as country capitals or popular actors.
529529 Other data associated with the CAPTCHA may provide hints about its contents, such as an image whose filename contains the word that is used in the CAPTCHA.",,Medium to High,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
530 CWE-805,EN-Buffer Access with Incorrect Length Value (Type: Base),"The software uses a sequential operation to read or write a buffer, but it uses an incorrect length value that causes it to access memory that is outside of the bounds of the buffer.","When the length value exceeds the size of the destination, a buffer overflow could occur.",,Medium to High,"Writing Secure Code: Chapter 6, ""Why ACLs Are Important"" Page 171
530 CWE-805,Buffer Access with Incorrect Length Value (Type: Base),"The software uses a sequential operation to read or write a buffer, but it uses an incorrect length value that causes it to access memory that is outside of the bounds of the buffer.","When the length value exceeds the size of the destination, a buffer overflow could occur.",,Medium to High,"Writing Secure Code: Chapter 6, ""Why ACLs Are Important"" Page 171
531531 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
532532 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
533533 PaX: http://en.wikipedia.org/wiki/PaX
536536 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
537537 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
538538 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
539 CWE-806,EN-Buffer Access Using Size of Source Buffer (Type: Variant),"The software uses the size of a source buffer when reading from or writing to a destination buffer, which may cause it to access memory that is outside of the bounds of the buffer.","When the size of the destination is smaller than the size of the source, a buffer overflow could occur.",,Medium to High,"Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
539 CWE-806,Buffer Access Using Size of Source Buffer (Type: Variant),"The software uses the size of a source buffer when reading from or writing to a destination buffer, which may cause it to access memory that is outside of the bounds of the buffer.","When the size of the destination is smaller than the size of the source, a buffer overflow could occur.",,Medium to High,"Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
540540 Safe C String Library v1.0.3: http://www.zork.org/safestr/
541541 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
542542 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
543543 PaX: http://en.wikipedia.org/wiki/PaX
544544 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx"
545 CWE-807,EN-Reliance on Untrusted Inputs in a Security Decision (Type: Base),"The application uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.","Developers may assume that inputs such as cookies, environment variables, and hidden form fields cannot be modified. However, an attacker could change these inputs using customized clients or other attacks. This change might not be detected. When security decisions such as authentication and authorization are made based on the values of these inputs, attackers can bypass the security of the software.
545 CWE-807,Reliance on Untrusted Inputs in a Security Decision (Type: Base),"The application uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.","Developers may assume that inputs such as cookies, environment variables, and hidden form fields cannot be modified. However, an attacker could change these inputs using customized clients or other attacks. This change might not be detected. When security decisions such as authentication and authorization are made based on the values of these inputs, attackers can bypass the security of the software.
546546 Without sufficient encryption, integrity checking, or other mechanism, any input that originates from an outsider cannot be trusted.",,Medium to High,"Top 25 Series - Rank 6 - Reliance on Untrusted Inputs in a Security Decision: http://blogs.sans.org/appsecstreetfighter/2010/03/05/top-25-series-rank-6-reliance-on-untrusted-inputs-in-a-security-decision/
547547 HMAC: http://en.wikipedia.org/wiki/Hmac
548548 Understanding ASP.NET View State: http://msdn.microsoft.com/en-us/library/ms972976.aspx
549549 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
550 CWE-93,EN-Improper Neutralization of CRLF Sequences (CRLF Injection) (Type: Base),"The software uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.","Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Medium to High,CRLF Injection: http://marc.info/?l=bugtraq&m=102088154213630&w=2
551 CWE-102,EN-Struts: Duplicate Validation Forms (Type: Variant),"The application uses multiple validation forms with the same name, which might cause the Struts Validator to validate a form that the programmer does not expect.","If two validation forms have the same name, the Struts Validator arbitrarily chooses one of the forms to use for input validation and discards the other. This decision might not correspond to the programmer's expectations, possibly leading to resultant weaknesses. Moreover, it indicates that the validation logic is not up-to-date, and can indicate that other, more subtle validation errors are present.",,Unknown,
552 CWE-103,EN-Struts: Incomplete validate() Method Definition (Type: Variant),"The application has a validator form that either does not define a validate() method, or defines a validate() method but does not call super.validate().","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
553 CWE-104,EN-Struts: Form Bean Does Not Extend Validation Class (Type: Variant),"If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
554 CWE-105,EN-Struts: Form Field Without Validator (Type: Variant),"The application has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
555 CWE-106,EN-Struts: Plug-in Framework not in Use (Type: Variant),"When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
556 CWE-107,EN-Struts: Unused Validation Form (Type: Variant),An unused validation form indicates that validation logic is not up-to-date.,It is easy for developers to forget to update validation logic when they remove or rename action form mappings. One indication that validation logic is not being properly maintained is the presence of an unused validation form.,,Unknown,
557 CWE-108,EN-Struts: Unvalidated Action Form (Type: Variant),Every Action Form must have a corresponding validation form.,"If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
558 CWE-109,EN-Struts: Validator Turned Off (Type: Variant),"Automatic filtering via a Struts bean has been turned off, which disables the Struts Validator and custom validation logic. This exposes the application to other weaknesses related to insufficient input validation.","If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
559 CWE-11,EN-ASP.NET Misconfiguration: Creating Debug Binary (Type: Variant),Debugging messages help attackers learn about the system and plan a form of attack.,ASP .NET applications can be configured to produce debug binaries. These binaries give detailed debugging messages and should not be used in production environments. Debug binaries are meant to be used in a development or testing environment and can pose a security risk if they are deployed to production.,,Unknown,
560 CWE-110,EN-Struts: Validator Without Form Field (Type: Variant),Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.,It is easy for developers to forget to update validation logic when they make changes to an ActionForm class. One indication that validation logic is not being properly maintained is inconsistencies between the action form and the validation form.,,Unknown,
561 CWE-111,EN-Direct Use of Unsafe JNI (Type: Base),"When a Java application uses the Java Native Interface (JNI) to call code written in another programming language, it can expose the application to weaknesses in that code, even if those weaknesses cannot occur in Java.","Many safety features that programmers may take for granted simply do not apply for native code, so you must carefully review all such code for potential problems. The languages used to implement native code may be more susceptible to buffer overflows and other attacks. Native code is unprotected by the security features enforced by the runtime environment, such as strong typing and array bounds checking.",,Unknown,"Fortify Descriptions: http://vulncat.fortifysoftware.com
550 CWE-93,Improper Neutralization of CRLF Sequences (CRLF Injection) (Type: Base),"The software uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.","Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Medium to High,CRLF Injection: http://marc.info/?l=bugtraq&m=102088154213630&w=2
551 CWE-102,Struts: Duplicate Validation Forms (Type: Variant),"The application uses multiple validation forms with the same name, which might cause the Struts Validator to validate a form that the programmer does not expect.","If two validation forms have the same name, the Struts Validator arbitrarily chooses one of the forms to use for input validation and discards the other. This decision might not correspond to the programmer's expectations, possibly leading to resultant weaknesses. Moreover, it indicates that the validation logic is not up-to-date, and can indicate that other, more subtle validation errors are present.",,Unknown,
552 CWE-103,Struts: Incomplete validate() Method Definition (Type: Variant),"The application has a validator form that either does not define a validate() method, or defines a validate() method but does not call super.validate().","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
553 CWE-104,Struts: Form Bean Does Not Extend Validation Class (Type: Variant),"If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
554 CWE-105,Struts: Form Field Without Validator (Type: Variant),"The application has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
555 CWE-106,Struts: Plug-in Framework not in Use (Type: Variant),"When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
556 CWE-107,Struts: Unused Validation Form (Type: Variant),An unused validation form indicates that validation logic is not up-to-date.,It is easy for developers to forget to update validation logic when they remove or rename action form mappings. One indication that validation logic is not being properly maintained is the presence of an unused validation form.,,Unknown,
557 CWE-108,Struts: Unvalidated Action Form (Type: Variant),Every Action Form must have a corresponding validation form.,"If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
558 CWE-109,Struts: Validator Turned Off (Type: Variant),"Automatic filtering via a Struts bean has been turned off, which disables the Struts Validator and custom validation logic. This exposes the application to other weaknesses related to insufficient input validation.","If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
559 CWE-11,ASP.NET Misconfiguration: Creating Debug Binary (Type: Variant),Debugging messages help attackers learn about the system and plan a form of attack.,ASP .NET applications can be configured to produce debug binaries. These binaries give detailed debugging messages and should not be used in production environments. Debug binaries are meant to be used in a development or testing environment and can pose a security risk if they are deployed to production.,,Unknown,
560 CWE-110,Struts: Validator Without Form Field (Type: Variant),Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.,It is easy for developers to forget to update validation logic when they make changes to an ActionForm class. One indication that validation logic is not being properly maintained is inconsistencies between the action form and the validation form.,,Unknown,
561 CWE-111,Direct Use of Unsafe JNI (Type: Base),"When a Java application uses the Java Native Interface (JNI) to call code written in another programming language, it can expose the application to weaknesses in that code, even if those weaknesses cannot occur in Java.","Many safety features that programmers may take for granted simply do not apply for native code, so you must carefully review all such code for potential problems. The languages used to implement native code may be more susceptible to buffer overflows and other attacks. Native code is unprotected by the security features enforced by the runtime environment, such as strong typing and array bounds checking.",,Unknown,"Fortify Descriptions: http://vulncat.fortifysoftware.com
562562 The Java(TM) Tutorial: The Java Native Interface: http://java.sun.com/docs/books/tutorial/native1.1/"
563 CWE-112,EN-Missing XML Validation (Type: Base),The software accepts XML from an untrusted source but does not validate the XML against the proper schema.,"Most successful attacks begin with a violation of the programmer's assumptions. By accepting an XML document without validating it against a DTD or XML schema, the programmer leaves a door open for attackers to provide unexpected, unreasonable, or malicious input.",,Unknown,
564 CWE-113,EN-Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Response Splitting) (Type: Base),"The software receives data from an upstream component, but does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.","Including unvalidated data in an HTTP header allows an attacker to specify the entirety of the HTTP response rendered by the browser. When an HTTP request contains unexpected CR (carriage return, also given by %0d or \r) and LF (line feed, also given by %0a or \n) characters the server may respond with an output stream that is interpreted as two different HTTP responses (instead of one). An attacker can control the second response and mount attacks such as cross-site scripting and cache poisoning attacks.
563 CWE-112,Missing XML Validation (Type: Base),The software accepts XML from an untrusted source but does not validate the XML against the proper schema.,"Most successful attacks begin with a violation of the programmer's assumptions. By accepting an XML document without validating it against a DTD or XML schema, the programmer leaves a door open for attackers to provide unexpected, unreasonable, or malicious input.",,Unknown,
564 CWE-113,Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Response Splitting) (Type: Base),"The software receives data from an upstream component, but does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.","Including unvalidated data in an HTTP header allows an attacker to specify the entirety of the HTTP response rendered by the browser. When an HTTP request contains unexpected CR (carriage return, also given by %0d or \r) and LF (line feed, also given by %0a or \n) characters the server may respond with an output stream that is interpreted as two different HTTP responses (instead of one). An attacker can control the second response and mount attacks such as cross-site scripting and cache poisoning attacks.
565565 HTTP response splitting weaknesses may be present when:
566566 Data enters a web application through an untrusted source, most frequently an HTTP request.
567567 The data is included in an HTTP response header sent to a web user without being validated for malicious characters.",,Unknown,"OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007
568568 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31"
569 CWE-114,EN-Process Control (Type: Base),Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.,"Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
570 CWE-115,EN-Misinterpretation of Input (Type: Base),"The software misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.","Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
571 CWE-118,EN-Improper Access of Indexable Resource (Range Error) (Type: Class),"The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.","This can allow an attacker to forge log entries or inject malicious content into logs.
569 CWE-114,Process Control (Type: Base),Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.,"Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
570 CWE-115,Misinterpretation of Input (Type: Base),"The software misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.","Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
571 CWE-118,Improper Access of Indexable Resource (Range Error) (Type: Class),"The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.","This can allow an attacker to forge log entries or inject malicious content into logs.
572572 Log forging vulnerabilities occur when:
573573 Data enters an application from an untrusted source.
574574 The data is written to an application or system log file.",,Unknown,
575 CWE-12,EN-ASP.NET Misconfiguration: Missing Custom Error Page (Type: Variant),An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.,"Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
575 CWE-12,ASP.NET Misconfiguration: Missing Custom Error Page (Type: Variant),An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.,"Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
576576 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,Unknown,"19 Deadly Sins of Software Security
577577 ASP.NET Misconfiguration: Missing Custom Error Handling: http://www.owasp.org/index.php/ASP.NET_Misconfiguration:_Missing_Custom_Error_Handling"
578 CWE-125,EN-Out-of-bounds Read (Type: Base),"The software reads data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
579 CWE-126,EN-Buffer Over-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.,This typically occurs when the pointer or its index is incremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in exposure of sensitive information or possibly a crash.,,Unknown,
580 CWE-127,EN-Buffer Under-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations prior to the targeted buffer.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,
581 CWE-13,EN-ASP.NET Misconfiguration: Password in Configuration File (Type: Variant),Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource making them an easy target for attackers.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,"How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI: http://msdn.microsoft.com/en-us/library/ms998280.aspx
578 CWE-125,Out-of-bounds Read (Type: Base),"The software reads data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
579 CWE-126,Buffer Over-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.,This typically occurs when the pointer or its index is incremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in exposure of sensitive information or possibly a crash.,,Unknown,
580 CWE-127,Buffer Under-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations prior to the targeted buffer.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,
581 CWE-13,ASP.NET Misconfiguration: Password in Configuration File (Type: Variant),Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource making them an easy target for attackers.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,"How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI: http://msdn.microsoft.com/en-us/library/ms998280.aspx
582582 How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA: http://msdn.microsoft.com/en-us/library/ms998283.aspx
583583 .NET Framework Developer's Guide - Securing Connection Strings: http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx"
584 CWE-130,EN-Improper Handling of Length Parameter Inconsistency (Type: Variant),"The software parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
585 CWE-132,EN-DEPRECATED (Duplicate): Miscalculated Null Termination (Type: Base),This entry has been deprecated because it was a duplicate of CWE-170. All content has been transferred to CWE-170.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
586 CWE-135,EN-Incorrect Calculation of Multi-Byte String Length (Type: Base),The software does not correctly calculate the length of strings that can contain wide or multi-byte characters.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,"Writing Secure Code: Chapter 5, ""Unicode and ANSI Buffer Size Mismatches"" Page 153"
587 CWE-138,EN-Improper Neutralization of Special Elements (Type: Class),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as control elements or syntactic markers when they are sent to a downstream component.","Most languages and protocols have their own special elements such as characters and reserved words. These special elements can carry control implications. If software does not prevent external control or influence over the inclusion of such special elements, the control flow of the program may be altered from what was intended. For example, both Unix and Windows interpret the symbol < (""less than"") as meaning ""read input from a file"".",,Unknown,
588 CWE-14,EN-Compiler Removal of Code to Clear Buffers (Type: Base),"Sensitive memory is cleared according to the source code, but compiler optimizations leave the memory untouched when it is not read from again, aka ""dead store removal.""","This compiler optimization error occurs when:
584 CWE-130,Improper Handling of Length Parameter Inconsistency (Type: Variant),"The software parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
585 CWE-132,DEPRECATED (Duplicate): Miscalculated Null Termination (Type: Base),This entry has been deprecated because it was a duplicate of CWE-170. All content has been transferred to CWE-170.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
586 CWE-135,Incorrect Calculation of Multi-Byte String Length (Type: Base),The software does not correctly calculate the length of strings that can contain wide or multi-byte characters.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,"Writing Secure Code: Chapter 5, ""Unicode and ANSI Buffer Size Mismatches"" Page 153"
587 CWE-138,Improper Neutralization of Special Elements (Type: Class),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as control elements or syntactic markers when they are sent to a downstream component.","Most languages and protocols have their own special elements such as characters and reserved words. These special elements can carry control implications. If software does not prevent external control or influence over the inclusion of such special elements, the control flow of the program may be altered from what was intended. For example, both Unix and Windows interpret the symbol < (""less than"") as meaning ""read input from a file"".",,Unknown,
588 CWE-14,Compiler Removal of Code to Clear Buffers (Type: Base),"Sensitive memory is cleared according to the source code, but compiler optimizations leave the memory untouched when it is not read from again, aka ""dead store removal.""","This compiler optimization error occurs when:
589589 1. Secret data are stored in memory.
590590 2. The secret data are scrubbed from memory by overwriting its contents.
591591 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322
592592 When scrubbing secrets in memory doesn't work: http://cert.uni-stuttgart.de/archive/bugtraq/2002/11/msg00046.html
593593 Some Bad News and Some Good News: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure10102002.asp
594594 GNU GCC: Optimizer Removes Code Necessary for Security: http://www.derkeiler.com/Mailing-Lists/securityfocus/bugtraq/2002-11/0257.html"
595 CWE-140,EN-Improper Neutralization of Delimiters (Type: Base),The software does not neutralize or incorrectly neutralizes delimiters.,"This compiler optimization error occurs when:
595 CWE-140,Improper Neutralization of Delimiters (Type: Base),The software does not neutralize or incorrectly neutralizes delimiters.,"This compiler optimization error occurs when:
596596 1. Secret data are stored in memory.
597597 2. The secret data are scrubbed from memory by overwriting its contents.
598598 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,
599 CWE-141,EN-Improper Neutralization of Parameter/Argument Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as parameter or argument delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408.
599 CWE-141,Improper Neutralization of Parameter/Argument Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as parameter or argument delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408.
600600 The Art of Software Security Assessment: Chapter 10, ""IFS"", Page 604."
601 CWE-142,EN-Improper Neutralization of Value Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as value delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
602 CWE-143,EN-Improper Neutralization of Record Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as record delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
603 CWE-144,EN-Improper Neutralization of Line Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as line delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
604 CWE-145,EN-Improper Neutralization of Section Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as section delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.
601 CWE-142,Improper Neutralization of Value Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as value delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
602 CWE-143,Improper Neutralization of Record Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as record delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
603 CWE-144,Improper Neutralization of Line Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as line delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
604 CWE-145,Improper Neutralization of Section Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as section delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.
605605 One example of a section delimiter is the boundary string in a multipart MIME message. In many cases, doubled line delimiters can serve as a section delimiter.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
606 CWE-146,EN-Improper Neutralization of Expression/Command Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as expression or command delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
607 CWE-147,EN-Improper Neutralization of Input Terminators (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as input terminators when they are sent to a downstream component.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
608 CWE-148,EN-Improper Neutralization of Input Leaders (Type: Variant),"The application does not properly handle when a leading character or sequence (""leader"") is missing or malformed, or if multiple leaders are used when only one should be allowed.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
609 CWE-149,EN-Improper Neutralization of Quoting Syntax (Type: Variant),"Quotes injected into an application can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
610 CWE-15,EN-External Control of System or Configuration Setting (Type: Base),One or more system settings or configuration elements can be externally controlled by a user.,"Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.",,Unknown,
611 CWE-150,"EN-Improper Neutralization of Escape, Meta, or Control Sequences (Type: Variant)","The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
612 CWE-151,EN-Improper Neutralization of Comment Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as comment delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
613 CWE-152,EN-Improper Neutralization of Macro Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as macro symbols when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
614 CWE-153,EN-Improper Neutralization of Substitution Characters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as substitution characters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
615 CWE-154,EN-Improper Neutralization of Variable Name Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as variable name delimiters when they are sent to a downstream component.","As data is parsed, an injected delimiter may cause the process to take unexpected actions that result in an attack. Example: ""$"" for an environment variable.",,Unknown,
616 CWE-155,EN-Improper Neutralization of Wildcards or Matching Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as wildcards or matching symbols when they are sent to a downstream component.","As data is parsed, an injected element may cause the process to take unexpected actions.",,Unknown,
617 CWE-156,EN-Improper Neutralization of Whitespace (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as whitespace when they are sent to a downstream component.","This can include space, tab, etc.",,Unknown,
618 CWE-157,EN-Failure to Sanitize Paired Delimiters (Type: Variant),"The software does not properly handle the characters that are used to mark the beginning and ending of a group of entities, such as parentheses, brackets, and braces.","This can include space, tab, etc.",,Unknown,
619 CWE-158,EN-Improper Neutralization of Null Byte or NUL Character (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component.","As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL Character Injection"", Page 411."
620 CWE-159,EN-Failure to Sanitize Special Element (Type: Class),Weaknesses in this attack-focused category do not properly filter and interpret special elements in user-controlled input which could cause adverse effect on the software behavior and integrity.,"As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,
621 CWE-160,EN-Improper Neutralization of Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
622 CWE-161,EN-Improper Neutralization of Multiple Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
623 CWE-162,EN-Improper Neutralization of Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
624 CWE-163,EN-Improper Neutralization of Multiple Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
625 CWE-164,EN-Improper Neutralization of Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
626 CWE-165,EN-Improper Neutralization of Multiple Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
627 CWE-166,EN-Improper Handling of Missing Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an expected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
628 CWE-167,EN-Improper Handling of Additional Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an additional unexpected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
629 CWE-168,EN-Improper Handling of Inconsistent Special Elements (Type: Base),The software does not handle when an inconsistency exists between two or more special characters or reserved words.,"An example of this problem would be if paired characters appear in the wrong order, or if the special characters are not properly nested.",,Unknown,
630 CWE-172,EN-Encoding Error (Type: Class),"The software does not properly encode or decode the data, resulting in unexpected values.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
631 CWE-173,EN-Improper Handling of Alternate Encoding (Type: Variant),The software does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
632 CWE-174,EN-Double Decoding of the Same Data (Type: Variant),"The software decodes the same input twice, which can limit the effectiveness of any protection mechanism that occurs in between the decoding operations.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
633 CWE-175,EN-Improper Handling of Mixed Encoding (Type: Variant),The software does not properly handle when the same input uses several different (mixed) encodings.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
634 CWE-176,EN-Improper Handling of Unicode Encoding (Type: Variant),The software does not properly handle when an input contains Unicode encoding.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Sets and Unicode"", Page 446."
635 CWE-177,EN-Improper Handling of URL Encoding (Hex Encoding) (Type: Variant),The software does not properly handle when all or part of an input has been URL encoded.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
636 CWE-178,EN-Improper Handling of Case Sensitivity (Type: Base),"The software does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.","Improperly handled case sensitive data can lead to several possible consequences, including:
606 CWE-146,Improper Neutralization of Expression/Command Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as expression or command delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
607 CWE-147,Improper Neutralization of Input Terminators (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as input terminators when they are sent to a downstream component.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
608 CWE-148,Improper Neutralization of Input Leaders (Type: Variant),"The application does not properly handle when a leading character or sequence (""leader"") is missing or malformed, or if multiple leaders are used when only one should be allowed.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
609 CWE-149,Improper Neutralization of Quoting Syntax (Type: Variant),"Quotes injected into an application can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
610 CWE-15,External Control of System or Configuration Setting (Type: Base),One or more system settings or configuration elements can be externally controlled by a user.,"Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.",,Unknown,
611 CWE-150,"Improper Neutralization of Escape, Meta, or Control Sequences (Type: Variant)","The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
612 CWE-151,Improper Neutralization of Comment Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as comment delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
613 CWE-152,Improper Neutralization of Macro Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as macro symbols when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
614 CWE-153,Improper Neutralization of Substitution Characters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as substitution characters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
615 CWE-154,Improper Neutralization of Variable Name Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as variable name delimiters when they are sent to a downstream component.","As data is parsed, an injected delimiter may cause the process to take unexpected actions that result in an attack. Example: ""$"" for an environment variable.",,Unknown,
616 CWE-155,Improper Neutralization of Wildcards or Matching Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as wildcards or matching symbols when they are sent to a downstream component.","As data is parsed, an injected element may cause the process to take unexpected actions.",,Unknown,
617 CWE-156,Improper Neutralization of Whitespace (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as whitespace when they are sent to a downstream component.","This can include space, tab, etc.",,Unknown,
618 CWE-157,Failure to Sanitize Paired Delimiters (Type: Variant),"The software does not properly handle the characters that are used to mark the beginning and ending of a group of entities, such as parentheses, brackets, and braces.","This can include space, tab, etc.",,Unknown,
619 CWE-158,Improper Neutralization of Null Byte or NUL Character (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component.","As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL Character Injection"", Page 411."
620 CWE-159,Failure to Sanitize Special Element (Type: Class),Weaknesses in this attack-focused category do not properly filter and interpret special elements in user-controlled input which could cause adverse effect on the software behavior and integrity.,"As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,
621 CWE-160,Improper Neutralization of Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
622 CWE-161,Improper Neutralization of Multiple Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
623 CWE-162,Improper Neutralization of Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
624 CWE-163,Improper Neutralization of Multiple Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
625 CWE-164,Improper Neutralization of Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
626 CWE-165,Improper Neutralization of Multiple Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
627 CWE-166,Improper Handling of Missing Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an expected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
628 CWE-167,Improper Handling of Additional Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an additional unexpected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
629 CWE-168,Improper Handling of Inconsistent Special Elements (Type: Base),The software does not handle when an inconsistency exists between two or more special characters or reserved words.,"An example of this problem would be if paired characters appear in the wrong order, or if the special characters are not properly nested.",,Unknown,
630 CWE-172,Encoding Error (Type: Class),"The software does not properly encode or decode the data, resulting in unexpected values.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
631 CWE-173,Improper Handling of Alternate Encoding (Type: Variant),The software does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
632 CWE-174,Double Decoding of the Same Data (Type: Variant),"The software decodes the same input twice, which can limit the effectiveness of any protection mechanism that occurs in between the decoding operations.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
633 CWE-175,Improper Handling of Mixed Encoding (Type: Variant),The software does not properly handle when the same input uses several different (mixed) encodings.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
634 CWE-176,Improper Handling of Unicode Encoding (Type: Variant),The software does not properly handle when an input contains Unicode encoding.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Sets and Unicode"", Page 446."
635 CWE-177,Improper Handling of URL Encoding (Hex Encoding) (Type: Variant),The software does not properly handle when all or part of an input has been URL encoded.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
636 CWE-178,Improper Handling of Case Sensitivity (Type: Base),"The software does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.","Improperly handled case sensitive data can lead to several possible consequences, including:
637637 case-insensitive passwords reducing the size of the key space, making brute force attacks easier
638638 bypassing filters or access controls using alternate names
639639 multiple interpretation errors using alternate names.",,Unknown,
640 CWE-179,EN-Incorrect Behavior Order: Early Validation (Type: Base),"The software validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification.","Software needs to validate data at the proper time, after data has been canonicalized and cleansed. Early validation is susceptible to various manipulations that result in dangerous inputs that are produced by canonicalization and cleansing.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Escaping Metacharacters"", Page 439."
641 CWE-180,EN-Incorrect Behavior Order: Validate Before Canonicalize (Type: Base),"The software validates input before it is canonicalized, which prevents the software from detecting data that becomes invalid after the canonicalization step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
642 CWE-181,EN-Incorrect Behavior Order: Validate Before Filter (Type: Base),"The software validates data before it has been filtered, which prevents the software from detecting data that becomes invalid after the filtering step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
643 CWE-182,EN-Collapse of Data into Unsafe Value (Type: Base),"The software filters data in a way that causes it to be reduced or ""collapsed"" into an unsafe value that violates an expected security property.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
644 CWE-183,EN-Permissive Whitelist (Type: Base),"An application uses a ""whitelist"" of acceptable values, but the whitelist includes at least one unsafe value, leading to resultant weaknesses.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
645 CWE-184,EN-Incomplete Blacklist (Type: Base),"An application uses a ""blacklist"" of prohibited values, but the blacklist is incomplete.","If an incomplete blacklist is used as a security mechanism, then the software may allow unintended values to pass into the application logic.",,Unknown,"Exploiting Software: How to Break Code
640 CWE-179,Incorrect Behavior Order: Early Validation (Type: Base),"The software validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification.","Software needs to validate data at the proper time, after data has been canonicalized and cleansed. Early validation is susceptible to various manipulations that result in dangerous inputs that are produced by canonicalization and cleansing.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Escaping Metacharacters"", Page 439."
641 CWE-180,Incorrect Behavior Order: Validate Before Canonicalize (Type: Base),"The software validates input before it is canonicalized, which prevents the software from detecting data that becomes invalid after the canonicalization step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
642 CWE-181,Incorrect Behavior Order: Validate Before Filter (Type: Base),"The software validates data before it has been filtered, which prevents the software from detecting data that becomes invalid after the filtering step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
643 CWE-182,Collapse of Data into Unsafe Value (Type: Base),"The software filters data in a way that causes it to be reduced or ""collapsed"" into an unsafe value that violates an expected security property.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
644 CWE-183,Permissive Whitelist (Type: Base),"An application uses a ""whitelist"" of acceptable values, but the whitelist includes at least one unsafe value, leading to resultant weaknesses.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
645 CWE-184,Incomplete Blacklist (Type: Base),"An application uses a ""blacklist"" of prohibited values, but the blacklist is incomplete.","If an incomplete blacklist is used as a security mechanism, then the software may allow unintended values to pass into the application logic.",,Unknown,"Exploiting Software: How to Break Code
646646 Blacklist defenses as a breeding ground for vulnerability variants: http://seclists.org/fulldisclosure/2006/Feb/0040.html
647647 The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
648 CWE-185,EN-Incorrect Regular Expression (Type: Class),The software specifies a regular expression in a way that causes data to be improperly matched or compared.,"When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,"Writing Secure Code: Chapter 10, ""Using Regular Expressions for Checking Input"" Page 350"
649 CWE-186,EN-Overly Restrictive Regular Expression (Type: Base),"A regular expression is overly restrictive, which prevents dangerous values from being detected.","When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,
650 CWE-187,EN-Partial Comparison (Type: Base),"The software performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Unknown,
651 CWE-191,EN-Integer Underflow (Wrap or Wraparound) (Type: Base),"The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.",This can happen in signed and unsigned cases.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119"
652 CWE-193,EN-Off-by-one Error (Type: Base),"A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.",This can happen in signed and unsigned cases.,,Unknown,"Third Generation Exploits: http://www.blackhat.com/presentations/bh-europe-01/halvar-flake/bh-europe-01-halvarflake.ppt
648 CWE-185,Incorrect Regular Expression (Type: Class),The software specifies a regular expression in a way that causes data to be improperly matched or compared.,"When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,"Writing Secure Code: Chapter 10, ""Using Regular Expressions for Checking Input"" Page 350"
649 CWE-186,Overly Restrictive Regular Expression (Type: Base),"A regular expression is overly restrictive, which prevents dangerous values from being detected.","When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,
650 CWE-187,Partial Comparison (Type: Base),"The software performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Unknown,
651 CWE-191,Integer Underflow (Wrap or Wraparound) (Type: Base),"The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.",This can happen in signed and unsigned cases.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119"
652 CWE-193,Off-by-one Error (Type: Base),"A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.",This can happen in signed and unsigned cases.,,Unknown,"Third Generation Exploits: http://www.blackhat.com/presentations/bh-europe-01/halvar-flake/bh-europe-01-halvarflake.ppt
653653 Off-by-one errors: a brief explanation: http://marc.theaimsgroup.com/?l=secprog&m=108379742110553&w=2
654654 The Frame Pointer Overwrite: http://kaizo.org/mirrors/phrack/phrack55/P55-08
655655 Exploiting Software: How to Break Code (The buffer overflow chapter)
656656 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
657657 The Art of Software Security Assessment: Chapter 5, ""Off-by-One Errors"", Page 180."
658 CWE-195,EN-Signed to Unsigned Conversion Error (Type: Variant),"A signed-to-unsigned conversion error takes place when a signed primitive is used as an unsigned value, usually as a size variable.",It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
659 CWE-198,EN-Use of Incorrect Byte Ordering (Type: Base),"The software receives input from an upstream component, but it does not account for byte ordering (e.g. big-endian and little-endian) when processing the input, causing an incorrect number or value to be used.","When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Unknown,
660 CWE-201,EN-Information Exposure Through Sent Data (Type: Variant),The accidental exposure of sensitive information through sent data refers to the transmission of data which are either sensitive in and of itself or useful in the further exploitation of the system through standard data channels.,"The information either
658 CWE-195,Signed to Unsigned Conversion Error (Type: Variant),"A signed-to-unsigned conversion error takes place when a signed primitive is used as an unsigned value, usually as a size variable.",It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
659 CWE-198,Use of Incorrect Byte Ordering (Type: Base),"The software receives input from an upstream component, but it does not account for byte ordering (e.g. big-endian and little-endian) when processing the input, causing an incorrect number or value to be used.","When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Unknown,
660 CWE-201,Information Exposure Through Sent Data (Type: Variant),The accidental exposure of sensitive information through sent data refers to the transmission of data which are either sensitive in and of itself or useful in the further exploitation of the system through standard data channels.,"The information either
661661 is regarded as sensitive within the product's own functionality, such as a private message; or
662662 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
663663 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,Unknown,
664 CWE-203,EN-Information Exposure Through Discrepancy (Type: Class),"The product behaves differently or sends different responses in a way that exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Unknown,
665 CWE-204,EN-Response Discrepancy Information Exposure (Type: Base),The software provides different responses to incoming requests in a way that allows an actor to determine system state information that is outside of that actor's control sphere.,"This issue frequently occurs during authentication, where a difference in failed-login messages could allow an attacker to determine if the username is valid or not. These exposures can be inadvertent (bug) or intentional (design).",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
666 CWE-205,EN-Information Exposure Through Behavioral Discrepancy (Type: Base),The product's actions indicate important differences based on (1) the internal state of the product or (2) differences from other products in the same class.,"For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
667 CWE-206,EN-Information Exposure of Internal State Through Behavioral Inconsistency (Type: Variant),"Two separate operations in a product cause the product to behave differently in a way that is observable to an attacker and reveals security-relevant information about the internal state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
668 CWE-207,EN-Information Exposure Through an External Behavioral Inconsistency (Type: Variant),"The product behaves differently than other products like it, in a way that is observable to an attacker and exposes security-relevant information about which product is being used.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
669 CWE-208,EN-Information Exposure Through Timing Discrepancy (Type: Base),"Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
670 CWE-210,EN-Information Exposure Through Self-generated Error Message (Type: Base),The software identifies an error condition and creates its own diagnostic or error messages that contain sensitive information.,"The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
664 CWE-203,Information Exposure Through Discrepancy (Type: Class),"The product behaves differently or sends different responses in a way that exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Unknown,
665 CWE-204,Response Discrepancy Information Exposure (Type: Base),The software provides different responses to incoming requests in a way that allows an actor to determine system state information that is outside of that actor's control sphere.,"This issue frequently occurs during authentication, where a difference in failed-login messages could allow an attacker to determine if the username is valid or not. These exposures can be inadvertent (bug) or intentional (design).",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
666 CWE-205,Information Exposure Through Behavioral Discrepancy (Type: Base),The product's actions indicate important differences based on (1) the internal state of the product or (2) differences from other products in the same class.,"For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
667 CWE-206,Information Exposure of Internal State Through Behavioral Inconsistency (Type: Variant),"Two separate operations in a product cause the product to behave differently in a way that is observable to an attacker and reveals security-relevant information about the internal state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
668 CWE-207,Information Exposure Through an External Behavioral Inconsistency (Type: Variant),"The product behaves differently than other products like it, in a way that is observable to an attacker and exposes security-relevant information about which product is being used.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
669 CWE-208,Information Exposure Through Timing Discrepancy (Type: Base),"Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
670 CWE-210,Information Exposure Through Self-generated Error Message (Type: Base),The software identifies an error condition and creates its own diagnostic or error messages that contain sensitive information.,"The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
671671 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
672 CWE-211,EN-Information Exposure Through Externally-generated Error Message (Type: Base),"The software performs an operation that triggers an external diagnostic or error message that is not directly generated by the software, such as an error generated by the programming language interpreter that the software uses. The error can contain sensitive system information.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,
673 CWE-212,EN-Improper Cross-boundary Removal of Sensitive Data (Type: Base),"The software uses a resource that contains sensitive data, but it does not properly remove that data before it stores, transfers, or shares the resource with actors in another control sphere.","Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
672 CWE-211,Information Exposure Through Externally-generated Error Message (Type: Base),"The software performs an operation that triggers an external diagnostic or error message that is not directly generated by the software, such as an error generated by the programming language interpreter that the software uses. The error can contain sensitive system information.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,
673 CWE-212,Improper Cross-boundary Removal of Sensitive Data (Type: Base),"The software uses a resource that contains sensitive data, but it does not properly remove that data before it stores, transfers, or shares the resource with actors in another control sphere.","Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
674674 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
675 CWE-213,EN-Intentional Information Exposure (Type: Base),A product's design or configuration explicitly requires the publication of information that could be regarded as sensitive by an administrator.,"Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
675 CWE-213,Intentional Information Exposure (Type: Base),A product's design or configuration explicitly requires the publication of information that could be regarded as sensitive by an administrator.,"Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
676676 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
677 CWE-214,EN-Information Exposure Through Process Environment (Type: Variant),"A process is invoked with sensitive arguments, environment variables, or other elements that can be seen by other processes on the operating system.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
678 CWE-215,EN-Information Exposure Through Debug Information (Type: Variant),The application contains debugging code that can expose sensitive information to untrusted parties.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
679 CWE-216,EN-Containment Errors (Container Errors) (Type: Class),"This tries to cover various problems in which improper data are included within a ""container.""","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
680 CWE-217,EN-DEPRECATED: Failure to Protect Stored Data from Modification (Type: Base),This weakness has been deprecated because it incorporated and confused multiple weaknesses. The issues formerly covered in this weakness can be found at CWE-766 and CWE-767.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
681 CWE-218,EN-DEPRECATED (Duplicate): Failure to provide confidentiality for stored data (Type: Base),This weakness has been deprecated because it was a duplicate of CWE-493. All content has been transferred to CWE-493.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
682 CWE-219,EN-Sensitive Data Under Web Root (Type: Variant),"The application stores sensitive data under the web document root with insufficient access control, which might make it accessible to untrusted parties.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
683 CWE-220,EN-Sensitive Data Under FTP Root (Type: Variant),"The application stores sensitive data under the FTP document root with insufficient access control, which might make it accessible to untrusted parties.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
677 CWE-214,Information Exposure Through Process Environment (Type: Variant),"A process is invoked with sensitive arguments, environment variables, or other elements that can be seen by other processes on the operating system.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
678 CWE-215,Information Exposure Through Debug Information (Type: Variant),The application contains debugging code that can expose sensitive information to untrusted parties.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
679 CWE-216,Containment Errors (Container Errors) (Type: Class),"This tries to cover various problems in which improper data are included within a ""container.""","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
680 CWE-217,DEPRECATED: Failure to Protect Stored Data from Modification (Type: Base),This weakness has been deprecated because it incorporated and confused multiple weaknesses. The issues formerly covered in this weakness can be found at CWE-766 and CWE-767.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
681 CWE-218,DEPRECATED (Duplicate): Failure to provide confidentiality for stored data (Type: Base),This weakness has been deprecated because it was a duplicate of CWE-493. All content has been transferred to CWE-493.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
682 CWE-219,Sensitive Data Under Web Root (Type: Variant),"The application stores sensitive data under the web document root with insufficient access control, which might make it accessible to untrusted parties.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
683 CWE-220,Sensitive Data Under FTP Root (Type: Variant),"The application stores sensitive data under the FTP document root with insufficient access control, which might make it accessible to untrusted parties.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
684684 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,Unknown,
685 CWE-221,EN-Information Loss or Omission (Type: Class),"The software does not record, or improperly records, security-relevant information that leads to an incorrect decision or hampers later analysis.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
686 CWE-222,EN-Truncation of Security-relevant Information (Type: Base),"The application truncates the display, recording, or processing of security-relevant information in a way that can obscure the source or nature of an attack.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
687 CWE-223,EN-Omission of Security-relevant Information (Type: Base),"The application does not record or display information that would be important for identifying the source or nature of an attack, or determining if an action is safe.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
688 CWE-224,EN-Obscured Security-relevant Information by Alternate Name (Type: Base),"The software records security-relevant information according to an alternate name of the affected entity, instead of the canonical name.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,Writing Secure Code
689 CWE-225,EN-DEPRECATED (Duplicate): General Information Management Problems (Type: Base),This weakness can be found at CWE-199.,"This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
690 CWE-226,EN-Sensitive Information Uncleared Before Release (Type: Base),"The software does not fully clear previously used information in a data structure, file, or other resource, before making that resource available to a party in another control sphere.","This typically results from new data that is not as long as the old data, which leaves portions of the old data still available. Equivalent errors can occur in other situations where the length of data is variable but the associated data structure is not. If memory is not cleared after use, it may allow unintended actors to read the data when the memory is reallocated.",,Unknown,
691 CWE-227,EN-Improper Fulfillment of API Contract (API Abuse) (Type: Class),The software uses an API in a manner contrary to its intended use.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
692 CWE-228,EN-Improper Handling of Syntactically Invalid Structure (Type: Class),The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
693 CWE-229,EN-Improper Handling of Values (Type: Base),"The software does not properly handle when the expected number of values for parameters, fields, or arguments is not provided in input, or if those values are undefined.","An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
694 CWE-23,EN-Relative Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as "".."" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"OWASP Attack listing: http://www.owasp.org/index.php/Relative_Path_Traversal
685 CWE-221,Information Loss or Omission (Type: Class),"The software does not record, or improperly records, security-relevant information that leads to an incorrect decision or hampers later analysis.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
686 CWE-222,Truncation of Security-relevant Information (Type: Base),"The application truncates the display, recording, or processing of security-relevant information in a way that can obscure the source or nature of an attack.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
687 CWE-223,Omission of Security-relevant Information (Type: Base),"The application does not record or display information that would be important for identifying the source or nature of an attack, or determining if an action is safe.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
688 CWE-224,Obscured Security-relevant Information by Alternate Name (Type: Base),"The software records security-relevant information according to an alternate name of the affected entity, instead of the canonical name.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,Writing Secure Code
689 CWE-225,DEPRECATED (Duplicate): General Information Management Problems (Type: Base),This weakness can be found at CWE-199.,"This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
690 CWE-226,Sensitive Information Uncleared Before Release (Type: Base),"The software does not fully clear previously used information in a data structure, file, or other resource, before making that resource available to a party in another control sphere.","This typically results from new data that is not as long as the old data, which leaves portions of the old data still available. Equivalent errors can occur in other situations where the length of data is variable but the associated data structure is not. If memory is not cleared after use, it may allow unintended actors to read the data when the memory is reallocated.",,Unknown,
691 CWE-227,Improper Fulfillment of API Contract (API Abuse) (Type: Class),The software uses an API in a manner contrary to its intended use.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
692 CWE-228,Improper Handling of Syntactically Invalid Structure (Type: Class),The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
693 CWE-229,Improper Handling of Values (Type: Base),"The software does not properly handle when the expected number of values for parameters, fields, or arguments is not provided in input, or if those values are undefined.","An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
694 CWE-23,Relative Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as "".."" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"OWASP Attack listing: http://www.owasp.org/index.php/Relative_Path_Traversal
695695 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
696 CWE-230,EN-Improper Handling of Missing Values (Type: Variant),"The software does not handle or incorrectly handles when a parameter, field, or argument name is specified, but the associated value is missing, i.e. it is empty, blank, or null.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
697 CWE-231,EN-Improper Handling of Extra Values (Type: Variant),The software does not handle or incorrectly handles when more values are provided than expected.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
698 CWE-232,EN-Improper Handling of Undefined Values (Type: Variant),"The software does not handle or incorrectly handles when a value is not defined or supported for the associated parameter, field, or argument name.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
699 CWE-233,EN-Improper Handling of Parameters (Type: Base),"The software does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
700 CWE-235,EN-Improper Handling of Extra Parameters (Type: Variant),"The software does not handle or incorrectly handles when the number of parameters, fields, or arguments with the same name exceeds the expected amount.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
701 CWE-236,EN-Improper Handling of Undefined Parameters (Type: Variant),"The software does not handle or incorrectly handles when a particular parameter, field, or argument name is not defined or supported by the product.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
702 CWE-237,EN-Improper Handling of Structural Elements (Type: Base),The software does not handle or incorrectly handles inputs that are related to complex structures.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
703 CWE-238,EN-Improper Handling of Incomplete Structural Elements (Type: Variant),The software does not handle or incorrectly handles when a particular structural element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
704 CWE-239,EN-Failure to Handle Incomplete Element (Type: Variant),The software does not properly handle when a particular element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
705 CWE-24,EN-Path Traversal: ../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
696 CWE-230,Improper Handling of Missing Values (Type: Variant),"The software does not handle or incorrectly handles when a parameter, field, or argument name is specified, but the associated value is missing, i.e. it is empty, blank, or null.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
697 CWE-231,Improper Handling of Extra Values (Type: Variant),The software does not handle or incorrectly handles when more values are provided than expected.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
698 CWE-232,Improper Handling of Undefined Values (Type: Variant),"The software does not handle or incorrectly handles when a value is not defined or supported for the associated parameter, field, or argument name.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
699 CWE-233,Improper Handling of Parameters (Type: Base),"The software does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
700 CWE-235,Improper Handling of Extra Parameters (Type: Variant),"The software does not handle or incorrectly handles when the number of parameters, fields, or arguments with the same name exceeds the expected amount.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
701 CWE-236,Improper Handling of Undefined Parameters (Type: Variant),"The software does not handle or incorrectly handles when a particular parameter, field, or argument name is not defined or supported by the product.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
702 CWE-237,Improper Handling of Structural Elements (Type: Base),The software does not handle or incorrectly handles inputs that are related to complex structures.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
703 CWE-238,Improper Handling of Incomplete Structural Elements (Type: Variant),The software does not handle or incorrectly handles when a particular structural element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
704 CWE-239,Failure to Handle Incomplete Element (Type: Variant),The software does not properly handle when a particular element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
705 CWE-24,Path Traversal: ../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
706706 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
707 CWE-240,EN-Improper Handling of Inconsistent Structural Elements (Type: Variant),"The software does not handle or incorrectly handles when two or more structural elements should be consistent, but are not.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
707 CWE-240,Improper Handling of Inconsistent Structural Elements (Type: Variant),"The software does not handle or incorrectly handles when two or more structural elements should be consistent, but are not.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
708708 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
709 CWE-241,EN-Improper Handling of Unexpected Data Type (Type: Base),"The software does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
709 CWE-241,Improper Handling of Unexpected Data Type (Type: Base),"The software does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
710710 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
711 CWE-244,EN-Improper Clearing of Heap Memory Before Release (Heap Inspection) (Type: Variant),"Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
712 CWE-245,EN-J2EE Bad Practices: Direct Management of Connections (Type: Variant),"The J2EE application directly manages connections, instead of using the container's connection management facilities.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
713 CWE-246,EN-J2EE Bad Practices: Direct Use of Sockets (Type: Variant),The J2EE application directly uses sockets instead of using framework method calls.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
714 CWE-247,EN-DEPRECATED (Duplicate): Reliance on DNS Lookups in a Security Decision (Type: Base),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
715 CWE-248,EN-Uncaught Exception (Type: Base),"An exception is thrown from a function, but it is not caught.","When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
716 CWE-249,EN-DEPRECATED: Often Misused: Path Manipulation (Type: Variant),This entry has been deprecated because of name confusion and an accidental combination of multiple weaknesses. Most of its content has been transferred to CWE-785.,"When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
717 CWE-25,EN-Path Traversal: /../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
711 CWE-244,Improper Clearing of Heap Memory Before Release (Heap Inspection) (Type: Variant),"Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
712 CWE-245,J2EE Bad Practices: Direct Management of Connections (Type: Variant),"The J2EE application directly manages connections, instead of using the container's connection management facilities.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
713 CWE-246,J2EE Bad Practices: Direct Use of Sockets (Type: Variant),The J2EE application directly uses sockets instead of using framework method calls.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
714 CWE-247,DEPRECATED (Duplicate): Reliance on DNS Lookups in a Security Decision (Type: Base),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
715 CWE-248,Uncaught Exception (Type: Base),"An exception is thrown from a function, but it is not caught.","When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
716 CWE-249,DEPRECATED: Often Misused: Path Manipulation (Type: Variant),This entry has been deprecated because of name confusion and an accidental combination of multiple weaknesses. Most of its content has been transferred to CWE-785.,"When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
717 CWE-25,Path Traversal: /../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
718718 Sometimes a program checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
719 CWE-26,EN-Path Traversal: /dir/../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/dir/../filename"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
719 CWE-26,Path Traversal: /dir/../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/dir/../filename"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
720720 The '/dir/../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
721 CWE-260,EN-Password in Configuration File (Type: Variant),The software stores a password in a configuration file that might be accessible to actors who do not know the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
722 CWE-261,EN-Weak Cryptography for Passwords (Type: Variant),Obscuring a password with a trivial encoding does not protect the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,"Building Secure Software: How to Avoid Security Problems the Right Way
721 CWE-260,Password in Configuration File (Type: Variant),The software stores a password in a configuration file that might be accessible to actors who do not know the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
722 CWE-261,Weak Cryptography for Passwords (Type: Variant),Obscuring a password with a trivial encoding does not protect the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,"Building Secure Software: How to Avoid Security Problems the Right Way
723723 24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
724 CWE-266,EN-Incorrect Privilege Assignment (Type: Base),"A product incorrectly assigns a privilege to a particular actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
725 CWE-267,EN-Privilege Defined With Unsafe Actions (Type: Base),"A particular privilege, role, capability, or right can be used to perform unsafe actions that were not intended, even when it is assigned to the correct entity.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
726 CWE-27,EN-Path Traversal: dir/../../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize multiple internal ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
724 CWE-266,Incorrect Privilege Assignment (Type: Base),"A product incorrectly assigns a privilege to a particular actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
725 CWE-267,Privilege Defined With Unsafe Actions (Type: Base),"A particular privilege, role, capability, or right can be used to perform unsafe actions that were not intended, even when it is assigned to the correct entity.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
726 CWE-27,Path Traversal: dir/../../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize multiple internal ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
727727 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,
728 CWE-270,EN-Privilege Context Switching Error (Type: Base),The software does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
728 CWE-270,Privilege Context Switching Error (Type: Base),The software does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
729729 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
730730 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
731 CWE-272,EN-Least Privilege Violation (Type: Base),The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,Unknown,
732 CWE-274,EN-Improper Handling of Insufficient Privileges (Type: Base),"The software does not handle or incorrectly handles when it has insufficient privileges to perform an operation, leading to resultant weaknesses.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
733 CWE-277,EN-Insecure Inherited Permissions (Type: Variant),A product defines a set of insecure permissions that are inherited by objects that are created by the program.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
734 CWE-278,EN-Insecure Preserved Inherited Permissions (Type: Variant),"A product inherits a set of insecure permissions for an object, e.g. when copying from an archive file, without user awareness or involvement.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
735 CWE-279,EN-Incorrect Execution-Assigned Permissions (Type: Variant),"While it is executing, the software sets the permissions of an object in a way that violates the intended permissions that have been specified by the user.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
736 CWE-28,EN-Path Traversal: ..\filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""..\"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
731 CWE-272,Least Privilege Violation (Type: Base),The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,Unknown,
732 CWE-274,Improper Handling of Insufficient Privileges (Type: Base),"The software does not handle or incorrectly handles when it has insufficient privileges to perform an operation, leading to resultant weaknesses.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
733 CWE-277,Insecure Inherited Permissions (Type: Variant),A product defines a set of insecure permissions that are inherited by objects that are created by the program.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
734 CWE-278,Insecure Preserved Inherited Permissions (Type: Variant),"A product inherits a set of insecure permissions for an object, e.g. when copying from an archive file, without user awareness or involvement.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
735 CWE-279,Incorrect Execution-Assigned Permissions (Type: Variant),"While it is executing, the software sets the permissions of an object in a way that violates the intended permissions that have been specified by the user.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
736 CWE-28,Path Traversal: ..\filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""..\"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
737737 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
738 CWE-280,EN-Improper Handling of Insufficient Permissions or Privileges (Type: Base),The application does not handle or incorrectly handles when it has insufficient privileges to access resources or functionality as specified by their permissions. This may cause it to follow unexpected code paths that may leave the application in an invalid state.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
738 CWE-280,Improper Handling of Insufficient Permissions or Privileges (Type: Base),The application does not handle or incorrectly handles when it has insufficient privileges to access resources or functionality as specified by their permissions. This may cause it to follow unexpected code paths that may leave the application in an invalid state.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
739739 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
740 CWE-281,EN-Improper Preservation of Permissions (Type: Base),"The software does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
740 CWE-281,Improper Preservation of Permissions (Type: Base),"The software does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
741741 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
742 CWE-282,EN-Improper Ownership Management (Type: Class),"The software assigns the wrong ownership, or does not properly verify the ownership, of an object or resource.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
742 CWE-282,Improper Ownership Management (Type: Class),"The software assigns the wrong ownership, or does not properly verify the ownership, of an object or resource.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
743743 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
744 CWE-283,EN-Unverified Ownership (Type: Base),The software does not properly verify that a critical resource is owned by the proper entity.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
744 CWE-283,Unverified Ownership (Type: Base),The software does not properly verify that a critical resource is owned by the proper entity.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
745745 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
746 CWE-284,EN-Improper Access Control (Type: Class),The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.,"Access control involves the use of several protection mechanisms such as authentication (proving the identity of an actor) authorization (ensuring that a given actor can access a resource), and accountability (tracking of activities that were performed). When any mechanism is not applied or otherwise fails, attackers can compromise the security of the software by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
746 CWE-284,Improper Access Control (Type: Class),The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.,"Access control involves the use of several protection mechanisms such as authentication (proving the identity of an actor) authorization (ensuring that a given actor can access a resource), and accountability (tracking of activities that were performed). When any mechanism is not applied or otherwise fails, attackers can compromise the security of the software by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
747747 There are two distinct behaviors that can introduce access control weaknesses:
748748 Specification: incorrect privileges, permissions, ownership, etc. are explicitly specified for either the user or the resource (for example, setting a password file to be world-writable, or giving administrator capabilities to a guest user). This action could be performed by the program or the administrator.
749749 Enforcement: the mechanism contains errors that prevent it from properly enforcing the specified access control requirements (e.g., allowing the user to specify their own privileges, or allowing a syntactically-incorrect ACL to produce insecure settings). This problem occurs within the program itself, in that it does not actually enforce the intended security policy that the administrator specifies.",,Unknown,"Writing Secure Code: Chapter 6, ""Determining Appropriate Access Control"" Page 171
750750 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253"
751 CWE-286,EN-Incorrect User Management (Type: Class),The software does not properly manage a user within its environment.,Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
752 CWE-288,EN-Authentication Bypass Using an Alternate Path or Channel (Type: Base),"A product requires authentication, but the product has an alternate path or channel that does not require authentication.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
753 CWE-289,EN-Authentication Bypass by Alternate Name (Type: Variant),"The software performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
754 CWE-29,EN-Path Traversal: \..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
751 CWE-286,Incorrect User Management (Type: Class),The software does not properly manage a user within its environment.,Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
752 CWE-288,Authentication Bypass Using an Alternate Path or Channel (Type: Base),"A product requires authentication, but the product has an alternate path or channel that does not require authentication.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
753 CWE-289,Authentication Bypass by Alternate Name (Type: Variant),"The software performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
754 CWE-29,Path Traversal: \..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
755755 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
756 CWE-290,EN-Authentication Bypass by Spoofing (Type: Base),This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
756 CWE-290,Authentication Bypass by Spoofing (Type: Base),This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
757757 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""Spoofing and Identification"", Page 72."
758 CWE-295,EN-Improper Certificate Validation (Type: Base),"The software does not validate, or incorrectly validates, a certificate.","When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by using a man-in-the-middle (MITM) attack. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.",,Unknown,"Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
758 CWE-295,Improper Certificate Validation (Type: Base),"The software does not validate, or incorrectly validates, a certificate.","When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by using a man-in-the-middle (MITM) attack. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.",,Unknown,"Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
759759 Computer Security: Art and Science"
760 CWE-30,EN-Path Traversal: \dir\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\dir\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
760 CWE-30,Path Traversal: \dir\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\dir\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
761761 This is similar to CWE-26, except using ""\"" instead of ""/"". The '\dir\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check.",,Unknown,
762 CWE-300,EN-Channel Accessible by Non-Endpoint (Man-in-the-Middle) (Type: Class),"The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.","In order to establish secure communication between two parties, it is often important to adequately verify the identity of entities at each end of the communication channel. Inadequate or inconsistent verification may result in insufficient or incorrect identification of either communicating entity. This can have negative consequences such as misplaced trust in the entity at the other end of the channel. An attacker can leverage this by interposing between the communicating entities and masquerading as the original entity. In the absence of sufficient verification of identity, such an attacker can eavesdrop and potentially modify the communication between the original entities.",,Unknown,Computer Security: Art and Science
763 CWE-302,EN-Authentication Bypass by Assumed-Immutable Data (Type: Variant),"The authentication scheme or implementation uses key data elements that are assumed to be immutable, but can be controlled or modified by the attacker.","A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Unknown,
764 CWE-303,EN-Incorrect Implementation of Authentication Algorithm (Type: Base),"The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect.",This incorrect implementation may allow authentication to be bypassed.,,Unknown,
765 CWE-304,EN-Missing Critical Step in Authentication (Type: Base),"The software implements an authentication technique, but it skips a step that weakens the technique.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
766 CWE-305,EN-Authentication Bypass by Primary Weakness (Type: Base),"The authentication algorithm is sound, but the implemented mechanism can be bypassed as the result of a separate weakness that is primary to the authentication error.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
767 CWE-307,EN-Improper Restriction of Excessive Authentication Attempts (Type: Base),"The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
762 CWE-300,Channel Accessible by Non-Endpoint (Man-in-the-Middle) (Type: Class),"The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.","In order to establish secure communication between two parties, it is often important to adequately verify the identity of entities at each end of the communication channel. Inadequate or inconsistent verification may result in insufficient or incorrect identification of either communicating entity. This can have negative consequences such as misplaced trust in the entity at the other end of the channel. An attacker can leverage this by interposing between the communicating entities and masquerading as the original entity. In the absence of sufficient verification of identity, such an attacker can eavesdrop and potentially modify the communication between the original entities.",,Unknown,Computer Security: Art and Science
763 CWE-302,Authentication Bypass by Assumed-Immutable Data (Type: Variant),"The authentication scheme or implementation uses key data elements that are assumed to be immutable, but can be controlled or modified by the attacker.","A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Unknown,
764 CWE-303,Incorrect Implementation of Authentication Algorithm (Type: Base),"The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect.",This incorrect implementation may allow authentication to be bypassed.,,Unknown,
765 CWE-304,Missing Critical Step in Authentication (Type: Base),"The software implements an authentication technique, but it skips a step that weakens the technique.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
766 CWE-305,Authentication Bypass by Primary Weakness (Type: Base),"The authentication algorithm is sound, but the implemented mechanism can be bypassed as the result of a separate weakness that is primary to the authentication error.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
767 CWE-307,Improper Restriction of Excessive Authentication Attempts (Type: Base),"The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
768768 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
769 CWE-31,EN-Path Traversal: dir\..\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize 'dir\..\..\filename' (multiple internal backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
769 CWE-31,Path Traversal: dir\..\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize 'dir\..\..\filename' (multiple internal backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
770770 The 'dir\..\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""..\"" sequence, so multiple ""..\"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""..\"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
771 CWE-312,EN-Cleartext Storage of Sensitive Information (Type: Base),The application stores sensitive information in cleartext within a resource that might be accessible to another control sphere.,"Because the information is stored in cleartext, attackers could potentially read it. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
771 CWE-312,Cleartext Storage of Sensitive Information (Type: Base),The application stores sensitive information in cleartext within a resource that might be accessible to another control sphere.,"Because the information is stored in cleartext, attackers could potentially read it. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
772772 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
773773 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
774 CWE-313,EN-Cleartext Storage in a File or on Disk (Type: Variant),"The application stores sensitive information in cleartext in a file, or on disk.","The sensitive information could be read by attackers with access to the file, or with physical or administrator access to the raw disk. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
775 CWE-314,EN-Cleartext Storage in the Registry (Type: Variant),The application stores sensitive information in cleartext in the registry.,"Attackers can read the information by accessing the registry key. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
776 CWE-315,EN-Cleartext Storage of Sensitive Information in a Cookie (Type: Variant),The application stores sensitive information in cleartext in a cookie.,"Attackers can use widely-available tools to view the cookie and read the sensitive information. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
777 CWE-316,EN-Cleartext Storage of Sensitive Information in Memory (Type: Variant),The application stores sensitive information in cleartext in memory.,"The sensitive memory might be saved to disk, stored in a core dump, or remain uncleared if the application crashes, or if the programmer does not properly clear the memory before freeing it.
774 CWE-313,Cleartext Storage in a File or on Disk (Type: Variant),"The application stores sensitive information in cleartext in a file, or on disk.","The sensitive information could be read by attackers with access to the file, or with physical or administrator access to the raw disk. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
775 CWE-314,Cleartext Storage in the Registry (Type: Variant),The application stores sensitive information in cleartext in the registry.,"Attackers can read the information by accessing the registry key. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
776 CWE-315,Cleartext Storage of Sensitive Information in a Cookie (Type: Variant),The application stores sensitive information in cleartext in a cookie.,"Attackers can use widely-available tools to view the cookie and read the sensitive information. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
777 CWE-316,Cleartext Storage of Sensitive Information in Memory (Type: Variant),The application stores sensitive information in cleartext in memory.,"The sensitive memory might be saved to disk, stored in a core dump, or remain uncleared if the application crashes, or if the programmer does not properly clear the memory before freeing it.
778778 It could be argued that such problems are usually only exploitable by those with administrator privileges. However, swapping could cause the memory to be written to disk and leave it accessible to physical attack afterwards. Core dump files might have insecure permissions or be stored in archive files that are accessible to untrusted people. Or, uncleared sensitive memory might be inadvertently exposed to attackers due to another weakness.",,Unknown,
779 CWE-317,EN-Cleartext Storage of Sensitive Information in GUI (Type: Variant),The application stores sensitive information in cleartext within the GUI.,"An attacker can often obtain data from a GUI, even if hidden, by using an API to directly access GUI objects such as windows and menus. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
780 CWE-318,EN-Cleartext Storage of Sensitive Information in Executable (Type: Variant),The application stores sensitive information in cleartext in an executable.,"Attackers can reverse engineer binary code to obtain secret data. This is especially easy when the cleartext is plain ASCII. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
781 CWE-32,EN-Path Traversal: ... (Triple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '...' (triple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
779 CWE-317,Cleartext Storage of Sensitive Information in GUI (Type: Variant),The application stores sensitive information in cleartext within the GUI.,"An attacker can often obtain data from a GUI, even if hidden, by using an API to directly access GUI objects such as windows and menus. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
780 CWE-318,Cleartext Storage of Sensitive Information in Executable (Type: Variant),The application stores sensitive information in cleartext in an executable.,"Attackers can reverse engineer binary code to obtain secret data. This is especially easy when the cleartext is plain ASCII. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
781 CWE-32,Path Traversal: ... (Triple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '...' (triple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
782782 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
783 CWE-325,EN-Missing Required Cryptographic Step (Type: Base),"The software does not implement a required step in a cryptographic algorithm, resulting in weaker encryption than advertised by that algorithm.","Cryptographic implementations should follow the algorithms that define them exactly, otherwise encryption can be weaker than expected.",,Unknown,
784 CWE-326,EN-Inadequate Encryption Strength (Type: Class),"The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.",A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.,,Unknown,"Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
783 CWE-325,Missing Required Cryptographic Step (Type: Base),"The software does not implement a required step in a cryptographic algorithm, resulting in weaker encryption than advertised by that algorithm.","Cryptographic implementations should follow the algorithms that define them exactly, otherwise encryption can be weaker than expected.",,Unknown,
784 CWE-326,Inadequate Encryption Strength (Type: Class),"The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.",A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.,,Unknown,"Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
785785 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315"
786 CWE-328,EN-Reversible One-Way Hash (Type: Base),"The product uses a hashing algorithm that produces a hash value that can be used to determine the original input, or to find an input that can produce the same hash, more efficiently than brute force techniques.","This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Unknown,"MD5 considered harmful today: http://www.phreedom.org/research/rogue-ca/
786 CWE-328,Reversible One-Way Hash (Type: Base),"The product uses a hashing algorithm that produces a hash value that can be used to determine the original input, or to find an input that can produce the same hash, more efficiently than brute force techniques.","This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Unknown,"MD5 considered harmful today: http://www.phreedom.org/research/rogue-ca/
787787 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Integrity"", Page 47.
788788 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
789789 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
792792 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
793793 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
794794 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
795 CWE-33,EN-Path Traversal: .... (Multiple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....' (multiple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
795 CWE-33,Path Traversal: .... (Multiple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....' (multiple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
796796 The '....' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
797 CWE-331,EN-Insufficient Entropy (Type: Base),"The software uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
798 CWE-334,EN-Small Space of Random Values (Type: Base),"The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
797 CWE-331,Insufficient Entropy (Type: Base),"The software uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
798 CWE-334,Small Space of Random Values (Type: Base),"The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
799799 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
800 CWE-335,EN-PRNG Seed Error (Type: Class),A Pseudo-Random Number Generator (PRNG) uses seeds incorrectly.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
801 CWE-336,EN-Same Seed in PRNG (Type: Base),"A PRNG uses the same seed each time the product is initialized. If an attacker can guess (or knows) the seed, then he/she may be able to determine the ""random"" number produced from the PRNG.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
802 CWE-337,EN-Predictable Seed in PRNG (Type: Base),"A PRNG is initialized from a predictable seed, e.g. using process ID or system time.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
800 CWE-335,PRNG Seed Error (Type: Class),A Pseudo-Random Number Generator (PRNG) uses seeds incorrectly.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
801 CWE-336,Same Seed in PRNG (Type: Base),"A PRNG uses the same seed each time the product is initialized. If an attacker can guess (or knows) the seed, then he/she may be able to determine the ""random"" number produced from the PRNG.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
802 CWE-337,Predictable Seed in PRNG (Type: Base),"A PRNG is initialized from a predictable seed, e.g. using process ID or system time.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
803803 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
804 CWE-339,EN-Small Seed Space in PRNG (Type: Base),A PRNG uses a relatively small space of seeds.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
805 CWE-34,EN-Path Traversal: ....// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....//' (doubled dot dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
804 CWE-339,Small Seed Space in PRNG (Type: Base),A PRNG uses a relatively small space of seeds.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
805 CWE-34,Path Traversal: ....// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....//' (doubled dot dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
806806 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,
807 CWE-340,EN-Predictability Problems (Type: Class),Weaknesses in this category are related to schemes that generate numbers or identifiers that are more predictable than required by the application.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
807 CWE-340,Predictability Problems (Type: Class),Weaknesses in this category are related to schemes that generate numbers or identifiers that are more predictable than required by the application.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
808808 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
809 CWE-341,EN-Predictable from Observable State (Type: Base),"A number or object is predictable based on observations that the attacker can make about the state of the system or network, such as time, process ID, etc.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
809 CWE-341,Predictable from Observable State (Type: Base),"A number or object is predictable based on observations that the attacker can make about the state of the system or network, such as time, process ID, etc.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
810810 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
811811 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
812 CWE-342,EN-Predictable Exact Value from Previous Values (Type: Base),An exact value or random number can be precisely predicted by observing previous values.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
812 CWE-342,Predictable Exact Value from Previous Values (Type: Base),An exact value or random number can be precisely predicted by observing previous values.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
813813 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
814814 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
815 CWE-343,EN-Predictable Value Range from Previous Values (Type: Base),"The software's random number generator produces a series of values which, when observed, can be used to infer a relatively small range of possibilities for the next value that could be generated.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
815 CWE-343,Predictable Value Range from Previous Values (Type: Base),"The software's random number generator produces a series of values which, when observed, can be used to infer a relatively small range of possibilities for the next value that could be generated.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
816816 Strange Attractors and TCP/IP Sequence Number Analysis: http://www.bindview.com/Services/Razor/Papers/2001/tcpseq.cfm
817817 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
818 CWE-344,EN-Use of Invariant Value in Dynamically Changing Context (Type: Base),"The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
819 CWE-345,EN-Insufficient Verification of Data Authenticity (Type: Class),"The software does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
820 CWE-346,EN-Origin Validation Error (Type: Base),The software does not properly verify that the source of data or communication is valid.,"The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
821 CWE-347,EN-Improper Verification of Cryptographic Signature (Type: Base),"The software does not verify, or incorrectly verifies, the cryptographic signature for data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
822 CWE-348,EN-Use of Less Trusted Source (Type: Base),"The software has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
823 CWE-349,EN-Acceptance of Extraneous Untrusted Data With Trusted Data (Type: Base),"The software, when processing trusted data, accepts any untrusted data that is also included with the trusted data, treating the untrusted data as if it were trusted.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
824 CWE-35,EN-Path Traversal: .../...// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '.../...//' (doubled triple dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
818 CWE-344,Use of Invariant Value in Dynamically Changing Context (Type: Base),"The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
819 CWE-345,Insufficient Verification of Data Authenticity (Type: Class),"The software does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
820 CWE-346,Origin Validation Error (Type: Base),The software does not properly verify that the source of data or communication is valid.,"The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
821 CWE-347,Improper Verification of Cryptographic Signature (Type: Base),"The software does not verify, or incorrectly verifies, the cryptographic signature for data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
822 CWE-348,Use of Less Trusted Source (Type: Base),"The software has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
823 CWE-349,Acceptance of Extraneous Untrusted Data With Trusted Data (Type: Base),"The software, when processing trusted data, accepts any untrusted data that is also included with the trusted data, treating the untrusted data as if it were trusted.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
824 CWE-35,Path Traversal: .../...// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '.../...//' (doubled triple dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
825825 The '.../...//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then "".../...//"" can collapse into the ""../"" unsafe value (CWE-182). Removing the first ""../"" yields ""....//""; the second removal yields ""../"". Depending on the algorithm, the software could be susceptible to CWE-34 but not CWE-35, or vice versa.",,Unknown,
826 CWE-350,EN-Reliance on Reverse DNS Resolution for a Security-Critical Action (Type: Variant),"The software performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.","When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
826 CWE-350,Reliance on Reverse DNS Resolution for a Security-Critical Action (Type: Variant),"The software performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.","When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
827827 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
828828 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231
829829 24 Deadly Sins of Software Security: ""Sin 24: Trusting Network Name Resolution."" Page 361
830830 The Art of Software Security Assessment: Chapter 16, ""DNS Spoofing"", Page 1002."
831 CWE-351,EN-Insufficient Type Distinction (Type: Base),The software does not properly distinguish between different types of elements in a way that leads to insecure behavior.,"When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
831 CWE-351,Insufficient Type Distinction (Type: Base),The software does not properly distinguish between different types of elements in a way that leads to insecure behavior.,"When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
832832 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
833833 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,
834 CWE-356,EN-Product UI does not Warn User of Unsafe Actions (Type: Base),The software's user interface does not warn the user before undertaking an unsafe action on behalf of that user. This makes it easier for attackers to trick users into inflicting damage to their system.,"Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
835 CWE-357,EN-Insufficient UI Warning of Dangerous Operations (Type: Base),"The user interface provides a warning to a user regarding dangerous or sensitive operations, but the warning is not noticeable enough to warrant attention.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
836 CWE-358,EN-Improperly Implemented Security Check for Standard (Type: Base),"The software does not implement or incorrectly implements one or more security-relevant checks as specified by the design of a standardized algorithm, protocol, or technique.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
837 CWE-359,EN-Privacy Violation (Type: Class),"Mishandling private information, such as customer passwords or social security numbers, can compromise user privacy and is often illegal.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,"AOL man pleads guilty to selling 92m email addies: http://www.theregister.co.uk/2005/02/07/aol_email_theft/
834 CWE-356,Product UI does not Warn User of Unsafe Actions (Type: Base),The software's user interface does not warn the user before undertaking an unsafe action on behalf of that user. This makes it easier for attackers to trick users into inflicting damage to their system.,"Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
835 CWE-357,Insufficient UI Warning of Dangerous Operations (Type: Base),"The user interface provides a warning to a user regarding dangerous or sensitive operations, but the warning is not noticeable enough to warrant attention.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
836 CWE-358,Improperly Implemented Security Check for Standard (Type: Base),"The software does not implement or incorrectly implements one or more security-relevant checks as specified by the design of a standardized algorithm, protocol, or technique.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
837 CWE-359,Privacy Violation (Type: Class),"Mishandling private information, such as customer passwords or social security numbers, can compromise user privacy and is often illegal.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,"AOL man pleads guilty to selling 92m email addies: http://www.theregister.co.uk/2005/02/07/aol_email_theft/
838838 Safe Harbor Privacy Framework: http://www.export.gov/safeharbor/
839839 Financial Privacy: The Gramm-Leach Bliley Act (GLBA): http://www.ftc.gov/privacy/glbact/index.html
840840 Health Insurance Portability and Accountability Act (HIPAA): http://www.hhs.gov/ocr/hipaa/
841841 California SB-1386: http://info.sen.ca.gov/pub/01-02/bill/sen/sb_1351-1400/sb_1386_bill_20020926_chaptered.html
842842 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
843843 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
844 CWE-36,EN-Absolute Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as ""/abs/path"" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
845 CWE-363,EN-Race Condition Enabling Link Following (Type: Base),"The software checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the software to access the wrong file.","While developers might expect that there is a very narrow time window between the time of check and time of use, there is still a race condition. An attacker could cause the software to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Race Conditions"", Page 526."
846 CWE-368,EN-Context Switching Race Condition (Type: Base),"A product performs a series of non-atomic actions to switch between contexts that cross privilege or other security boundaries, but a race condition allows an attacker to modify or misrepresent the product's behavior during the switch.","This is commonly seen in web browser vulnerabilities in which the attacker can perform certain actions while the browser is transitioning from a trusted to an untrusted domain, or vice versa, and the browser performs the actions on one domain using the trust level and resources of the other domain.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
847 CWE-37,EN-Path Traversal: /absolute/pathname/here (Type: Variant),A software system that accepts input in the form of a slash absolute path ('/absolute/pathname/here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Unknown,
848 CWE-372,EN-Incomplete Internal State Distinction (Type: Base),"The software does not properly determine which state it is in, causing it to assume it is in state X when in fact it is in state Y, causing it to perform incorrect operations in a security-relevant manner.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
849 CWE-373,EN-DEPRECATED: State Synchronization Error (Type: Base),This entry was deprecated because it overlapped the same concepts as race condition (CWE-362) and Improper Synchronization (CWE-662).,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
850 CWE-377,EN-Insecure Temporary File (Type: Base),Creating and using insecure temporary files can leave application and system data vulnerable to attack.,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,"Writing Secure Code: Chapter 23, ""Creating Temporary Files Securely"" Page 682
844 CWE-36,Absolute Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as ""/abs/path"" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
845 CWE-363,Race Condition Enabling Link Following (Type: Base),"The software checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the software to access the wrong file.","While developers might expect that there is a very narrow time window between the time of check and time of use, there is still a race condition. An attacker could cause the software to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Race Conditions"", Page 526."
846 CWE-368,Context Switching Race Condition (Type: Base),"A product performs a series of non-atomic actions to switch between contexts that cross privilege or other security boundaries, but a race condition allows an attacker to modify or misrepresent the product's behavior during the switch.","This is commonly seen in web browser vulnerabilities in which the attacker can perform certain actions while the browser is transitioning from a trusted to an untrusted domain, or vice versa, and the browser performs the actions on one domain using the trust level and resources of the other domain.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
847 CWE-37,Path Traversal: /absolute/pathname/here (Type: Variant),A software system that accepts input in the form of a slash absolute path ('/absolute/pathname/here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Unknown,
848 CWE-372,Incomplete Internal State Distinction (Type: Base),"The software does not properly determine which state it is in, causing it to assume it is in state X when in fact it is in state Y, causing it to perform incorrect operations in a security-relevant manner.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
849 CWE-373,DEPRECATED: State Synchronization Error (Type: Base),This entry was deprecated because it overlapped the same concepts as race condition (CWE-362) and Improper Synchronization (CWE-662).,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
850 CWE-377,Insecure Temporary File (Type: Base),Creating and using insecure temporary files can leave application and system data vulnerable to attack.,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,"Writing Secure Code: Chapter 23, ""Creating Temporary Files Securely"" Page 682
851851 The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538.
852852 The Art of Software Security Assessment: Chapter 11, ""File Squatting"", Page 662."
853 CWE-38,EN-Path Traversal: \absolute\pathname\here (Type: Variant),A software system that accepts input in the form of a backslash absolute path ('\absolute\pathname\here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
854 CWE-382,EN-J2EE Bad Practices: Use of System.exit() (Type: Variant),"A J2EE application uses System.exit(), which also shuts down its container.","On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
855 CWE-383,EN-J2EE Bad Practices: Direct Use of Threads (Type: Variant),Thread management in a Web application is forbidden in some circumstances and is always highly error prone.,"Thread management in a web application is forbidden by the J2EE standard in some circumstances and is always highly error prone. Managing threads is difficult and is likely to interfere in unpredictable ways with the behavior of the application container. Even without interfering with the container, thread management usually leads to bugs that are hard to detect and diagnose like deadlock, race conditions, and other synchronization errors.",,Unknown,
856 CWE-386,EN-Symbolic Name not Mapping to Correct Object (Type: Base),"A constant symbolic reference to an object is used, even though the reference can resolve to a different object over time.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
853 CWE-38,Path Traversal: \absolute\pathname\here (Type: Variant),A software system that accepts input in the form of a backslash absolute path ('\absolute\pathname\here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
854 CWE-382,J2EE Bad Practices: Use of System.exit() (Type: Variant),"A J2EE application uses System.exit(), which also shuts down its container.","On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
855 CWE-383,J2EE Bad Practices: Direct Use of Threads (Type: Variant),Thread management in a Web application is forbidden in some circumstances and is always highly error prone.,"Thread management in a web application is forbidden by the J2EE standard in some circumstances and is always highly error prone. Managing threads is difficult and is likely to interfere in unpredictable ways with the behavior of the application container. Even without interfering with the container, thread management usually leads to bugs that are hard to detect and diagnose like deadlock, race conditions, and other synchronization errors.",,Unknown,
856 CWE-386,Symbolic Name not Mapping to Correct Object (Type: Base),"A constant symbolic reference to an object is used, even though the reference can resolve to a different object over time.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
857857 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
858 CWE-39,EN-Path Traversal: C:dirname (Type: Variant),An attacker can inject a drive letter or Windows volume letter ('C:dirname') into a software system to potentially redirect access to an unintended location or arbitrary file.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
858 CWE-39,Path Traversal: C:dirname (Type: Variant),An attacker can inject a drive letter or Windows volume letter ('C:dirname') into a software system to potentially redirect access to an unintended location or arbitrary file.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
859859 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
860 CWE-392,EN-Missing Report of Error Condition (Type: Base),The software encounters an error but does not provide a status code or return value to indicate that an error has occurred.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
860 CWE-392,Missing Report of Error Condition (Type: Base),The software encounters an error but does not provide a status code or return value to indicate that an error has occurred.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
861861 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
862 CWE-393,EN-Return of Wrong Status Code (Type: Base),"A function or operation returns an incorrect return value or status code that does not indicate an error, but causes the product to modify its behavior based on the incorrect result.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
863 CWE-394,EN-Unexpected Status Code or Return Value (Type: Base),"The software does not properly check when a function or operation returns a value that is legitimate for the function, but is not expected by the software.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
864 CWE-395,EN-Use of NullPointerException Catch to Detect NULL Pointer Dereference (Type: Base),Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.,"This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
865 CWE-396,EN-Declaration of Catch for Generic Exception (Type: Base),Catching overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Multiple catch blocks can get ugly and repetitive, but ""condensing"" catch blocks by catching a high-level class like Exception can obscure exceptions that deserve special treatment or that should not be caught at this point in the program. Catching an overly broad exception essentially defeats the purpose of Java's typed exceptions, and can become particularly dangerous if the program grows and begins to throw new types of exceptions. The new exception types will not receive any attention.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 9: Catching Exceptions."" Page 157"
866 CWE-397,EN-Declaration of Throws for Generic Exception (Type: Base),Throwing overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Declaring a method to throw Exception or Throwable makes it difficult for callers to perform proper error handling and error recovery. Java's exception mechanism, for example, is set up to make it easy for callers to anticipate what can go wrong and write code to handle each specific exceptional circumstance. Declaring that a method throws a generic form of exception defeats this system.",,Unknown,
867 CWE-398,EN-Indicator of Poor Code Quality (Type: Class),"The code has features that do not directly introduce a weakness or vulnerability, but indicate that the product has not been carefully developed or maintained.","Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,
868 CWE-40,EN-Path Traversal: \\UNC\share\name\ (Windows UNC Share) (Type: Variant),An attacker can inject a Windows UNC share ('\\UNC\share\name') into a software system to potentially redirect access to an unintended location or arbitrary file.,"Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Filelike Objects"", Page 664."
869 CWE-402,EN-Transmission of Private Resources into a New Sphere (Resource Leak) (Type: Class),The software makes resources available to untrusted parties when those resources are only intended to be accessed by the software.,This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Unknown,
870 CWE-403,EN-Exposure of File Descriptor to Unintended Control Sphere (File Descriptor Leak) (Type: Base),"A process does not close sensitive file descriptors before invoking a child process, which allows the child to perform unauthorized I/O operations using those descriptors.","When a new process is forked or executed, the child process inherits any open file descriptors. When the child process has fewer privileges than the parent process, this might introduce a vulnerability if the child process can access the file descriptor but does not have the privileges to access the associated file.",,Unknown,"File descriptors and setuid applications: https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
862 CWE-393,Return of Wrong Status Code (Type: Base),"A function or operation returns an incorrect return value or status code that does not indicate an error, but causes the product to modify its behavior based on the incorrect result.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
863 CWE-394,Unexpected Status Code or Return Value (Type: Base),"The software does not properly check when a function or operation returns a value that is legitimate for the function, but is not expected by the software.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
864 CWE-395,Use of NullPointerException Catch to Detect NULL Pointer Dereference (Type: Base),Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.,"This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
865 CWE-396,Declaration of Catch for Generic Exception (Type: Base),Catching overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Multiple catch blocks can get ugly and repetitive, but ""condensing"" catch blocks by catching a high-level class like Exception can obscure exceptions that deserve special treatment or that should not be caught at this point in the program. Catching an overly broad exception essentially defeats the purpose of Java's typed exceptions, and can become particularly dangerous if the program grows and begins to throw new types of exceptions. The new exception types will not receive any attention.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 9: Catching Exceptions."" Page 157"
866 CWE-397,Declaration of Throws for Generic Exception (Type: Base),Throwing overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Declaring a method to throw Exception or Throwable makes it difficult for callers to perform proper error handling and error recovery. Java's exception mechanism, for example, is set up to make it easy for callers to anticipate what can go wrong and write code to handle each specific exceptional circumstance. Declaring that a method throws a generic form of exception defeats this system.",,Unknown,
867 CWE-398,Indicator of Poor Code Quality (Type: Class),"The code has features that do not directly introduce a weakness or vulnerability, but indicate that the product has not been carefully developed or maintained.","Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,
868 CWE-40,Path Traversal: \\UNC\share\name\ (Windows UNC Share) (Type: Variant),An attacker can inject a Windows UNC share ('\\UNC\share\name') into a software system to potentially redirect access to an unintended location or arbitrary file.,"Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Filelike Objects"", Page 664."
869 CWE-402,Transmission of Private Resources into a New Sphere (Resource Leak) (Type: Class),The software makes resources available to untrusted parties when those resources are only intended to be accessed by the software.,This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Unknown,
870 CWE-403,Exposure of File Descriptor to Unintended Control Sphere (File Descriptor Leak) (Type: Base),"A process does not close sensitive file descriptors before invoking a child process, which allows the child to perform unauthorized I/O operations using those descriptors.","When a new process is forked or executed, the child process inherits any open file descriptors. When the child process has fewer privileges than the parent process, this might introduce a vulnerability if the child process can access the file descriptor but does not have the privileges to access the associated file.",,Unknown,"File descriptors and setuid applications: https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
871871 Introduction to Secure Coding Guide: https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/AccessControl.html"
872 CWE-405,EN-Asymmetric Resource Consumption (Amplification) (Type: Class),Software that does not appropriately monitor or control resource consumption can lead to adverse system performance.,"This situation is amplified if the software allows malicious users or attackers to consume more resources than their access level permits. Exploiting such a weakness can lead to asymmetric resource consumption, aiding in amplification attacks against the system or the network.",,Unknown,
873 CWE-406,EN-Insufficient Control of Network Message Volume (Network Amplification) (Type: Base),"The software does not sufficiently monitor or control transmitted network traffic volume, so that an actor can cause the software to transmit more traffic than should be allowed for that actor.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
874 CWE-408,EN-Incorrect Behavior Order: Early Amplification (Type: Base),The software allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.,"In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
875 CWE-409,EN-Improper Handling of Highly Compressed Data (Data Amplification) (Type: Base),The software does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.,"An example of data amplification is a ""decompression bomb,"" a small ZIP file that can produce a large amount of data when it is decompressed.",,Unknown,
876 CWE-41,EN-Improper Resolution of Path Equivalence (Type: Base),The system or application is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.,"Path equivalence is usually employed in order to circumvent access controls expressed using an incomplete set of file name or file path representations. This is different from path traversal, wherein the manipulations are performed to generate a name for a different object.",,Unknown,
877 CWE-410,EN-Insufficient Resource Pool (Type: Base),"The software's resource pool is not large enough to handle peak demand, which allows an attacker to prevent others from accessing the resource by using a (relatively) large number of requests for resources.","Frequently the consequence is a ""flood"" of connection or sessions.",,Unknown,"Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
878 CWE-412,EN-Unrestricted Externally Accessible Lock (Type: Base),"The software properly checks for the existence of a lock, but the lock can be externally controlled or influenced by an actor that is outside of the intended sphere of control.","This prevents the software from acting on associated resources or performing other behaviors that are controlled by the presence of the lock. Relevant locks might include an exclusive lock or mutex, or modifying a shared resource that is treated as a lock. If the lock can be held for an indefinite period of time, then the denial of service could be permanent.",,Unknown,
879 CWE-413,EN-Improper Resource Locking (Type: Base),The software does not lock or does not correctly lock a resource when the software must have exclusive access to the resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
880 CWE-414,EN-Missing Lock Check (Type: Base),A product does not check to see if a lock is present before performing sensitive operations on a resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
881 CWE-419,EN-Unprotected Primary Channel (Type: Base),"The software uses a primary channel for administration or restricted functionality, but it does not properly protect the channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
872 CWE-405,Asymmetric Resource Consumption (Amplification) (Type: Class),Software that does not appropriately monitor or control resource consumption can lead to adverse system performance.,"This situation is amplified if the software allows malicious users or attackers to consume more resources than their access level permits. Exploiting such a weakness can lead to asymmetric resource consumption, aiding in amplification attacks against the system or the network.",,Unknown,
873 CWE-406,Insufficient Control of Network Message Volume (Network Amplification) (Type: Base),"The software does not sufficiently monitor or control transmitted network traffic volume, so that an actor can cause the software to transmit more traffic than should be allowed for that actor.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
874 CWE-408,Incorrect Behavior Order: Early Amplification (Type: Base),The software allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.,"In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
875 CWE-409,Improper Handling of Highly Compressed Data (Data Amplification) (Type: Base),The software does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.,"An example of data amplification is a ""decompression bomb,"" a small ZIP file that can produce a large amount of data when it is decompressed.",,Unknown,
876 CWE-41,Improper Resolution of Path Equivalence (Type: Base),The system or application is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.,"Path equivalence is usually employed in order to circumvent access controls expressed using an incomplete set of file name or file path representations. This is different from path traversal, wherein the manipulations are performed to generate a name for a different object.",,Unknown,
877 CWE-410,Insufficient Resource Pool (Type: Base),"The software's resource pool is not large enough to handle peak demand, which allows an attacker to prevent others from accessing the resource by using a (relatively) large number of requests for resources.","Frequently the consequence is a ""flood"" of connection or sessions.",,Unknown,"Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
878 CWE-412,Unrestricted Externally Accessible Lock (Type: Base),"The software properly checks for the existence of a lock, but the lock can be externally controlled or influenced by an actor that is outside of the intended sphere of control.","This prevents the software from acting on associated resources or performing other behaviors that are controlled by the presence of the lock. Relevant locks might include an exclusive lock or mutex, or modifying a shared resource that is treated as a lock. If the lock can be held for an indefinite period of time, then the denial of service could be permanent.",,Unknown,
879 CWE-413,Improper Resource Locking (Type: Base),The software does not lock or does not correctly lock a resource when the software must have exclusive access to the resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
880 CWE-414,Missing Lock Check (Type: Base),A product does not check to see if a lock is present before performing sensitive operations on a resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
881 CWE-419,Unprotected Primary Channel (Type: Base),"The software uses a primary channel for administration or restricted functionality, but it does not properly protect the channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
882882 Error conditions and other exceptional circumstances.
883883 Confusion over which part of the program is responsible for freeing the memory.
884884 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
885885 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
886 CWE-42,EN-Path Equivalence: filename. (Trailing Dot) (Type: Variant),A software system that accepts path input in the form of trailing dot ('filedir.') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
886 CWE-42,Path Equivalence: filename. (Trailing Dot) (Type: Variant),A software system that accepts path input in the form of trailing dot ('filedir.') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
887887 Error conditions and other exceptional circumstances.
888888 Confusion over which part of the program is responsible for freeing the memory.
889889 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
890890 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
891 CWE-420,EN-Unprotected Alternate Channel (Type: Base),"The software protects a primary channel, but it does not use the same level of protection for an alternate channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
891 CWE-420,Unprotected Alternate Channel (Type: Base),"The software protects a primary channel, but it does not use the same level of protection for an alternate channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
892892 Error conditions and other exceptional circumstances.
893893 Confusion over which part of the program is responsible for freeing the memory.
894894 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
895895 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
896 CWE-421,EN-Race Condition During Access to Alternate Channel (Type: Base),"The product opens an alternate channel to communicate with an authorized user, but the channel is accessible to other actors.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
896 CWE-421,Race Condition During Access to Alternate Channel (Type: Base),"The product opens an alternate channel to communicate with an authorized user, but the channel is accessible to other actors.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
897897 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
898 CWE-422,EN-Unprotected Windows Messaging Channel (Shatter) (Type: Variant),"The software does not properly verify the source of a message in the Windows Messaging System while running at elevated privileges, creating an alternate channel through which an attacker can directly send a message to the product.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Exploiting design flaws in the Win32 API for privilege escalation. Or... Shatter Attacks - How to break Windows: http://web.archive.org/web/20060115174629/http://security.tombom.co.uk/shatter.html
898 CWE-422,Unprotected Windows Messaging Channel (Shatter) (Type: Variant),"The software does not properly verify the source of a message in the Windows Messaging System while running at elevated privileges, creating an alternate channel through which an attacker can directly send a message to the product.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Exploiting design flaws in the Win32 API for privilege escalation. Or... Shatter Attacks - How to break Windows: http://web.archive.org/web/20060115174629/http://security.tombom.co.uk/shatter.html
899899 The Art of Software Security Assessment: Chapter 2, ""Design Review."" Page 34.
900900 The Art of Software Security Assessment: Chapter 12, ""Shatter Attacks"", Page 694."
901 CWE-423,EN-DEPRECATED (Duplicate): Proxied Trusted Channel (Type: Base),This entry has been deprecated because it was a duplicate of CWE-441. All content has been transferred to CWE-441.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
902 CWE-424,EN-Improper Protection of Alternate Path (Type: Class),The product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
903 CWE-425,EN-Direct Request (Forced Browsing) (Type: Base),"The web application does not adequately enforce appropriate authorization on all restricted URLs, scripts, or files.",Web applications susceptible to direct request attacks often make the false assumption that such resources can only be reached through a given navigation path and so only apply authorization at certain points in the path.,,Unknown,
904 CWE-427,EN-Uncontrolled Search Path Element (Type: Base),"The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.","Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as ""/tmp"" or the current working directory.
901 CWE-423,DEPRECATED (Duplicate): Proxied Trusted Channel (Type: Base),This entry has been deprecated because it was a duplicate of CWE-441. All content has been transferred to CWE-441.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
902 CWE-424,Improper Protection of Alternate Path (Type: Class),The product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
903 CWE-425,Direct Request (Forced Browsing) (Type: Base),"The web application does not adequately enforce appropriate authorization on all restricted URLs, scripts, or files.",Web applications susceptible to direct request attacks often make the false assumption that such resources can only be reached through a given navigation path and so only apply authorization at certain points in the path.,,Unknown,
904 CWE-427,Uncontrolled Search Path Element (Type: Base),"The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.","Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as ""/tmp"" or the current working directory.
905905 In Windows-based systems, when the LoadLibrary or LoadLibraryEx function is called with a DLL name that does not contain a fully qualified path, the function follows a search order that includes two path elements that might be uncontrolled:
906906 the directory from which the program has been loaded
907907 the current working directory.
915915 Insecure Library Loading Could Allow Remote Code Execution: http://www.microsoft.com/technet/security/advisory/2269637.mspx
916916 Application DLL Load Hijacking: http://blog.rapid7.com/?p=5325
917917 DLL Hijacking: Facts and Fiction: http://threatpost.com/en_us/blogs/dll-hijacking-facts-and-fiction-082610"
918 CWE-428,EN-Unquoted Search Path or Element (Type: Base),"The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.","If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Process Loading"", Page 654."
919 CWE-43,EN-Path Equivalence: filename.... (Multiple Trailing Dot) (Type: Variant),A software system that accepts path input in the form of multiple trailing dot ('filedir....') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,
920 CWE-430,EN-Deployment of Wrong Handler (Type: Base),"The wrong ""handler"" is assigned to process an object.","An example of deploying the wrong handler would be calling a servlet to reveal source code of a .JSP file, or automatically ""determining"" type of the object even if it is contradictory to an explicitly specified type.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
921 CWE-431,EN-Missing Handler (Type: Base),A handler is not available or implemented.,"When an exception is thrown and not caught, the process has given up an opportunity to decide if a given failure or event is worth a change in execution.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
922 CWE-432,EN-Dangerous Signal Handler not Disabled During Sensitive Operations (Type: Base),"The application uses a signal handler that shares state with other signal handlers, but it does not properly mask or prevent those signal handlers from being invoked while the original signal handler is still running.","During the execution of a signal handler, it can be interrupted by another handler when a different signal is sent. If the two handlers share state - such as global variables - then an attacker can corrupt the state by sending another signal before the first handler has completed execution.",,Unknown,
923 CWE-433,EN-Unparsed Raw Web Content Delivery (Type: Variant),The software stores raw content or supporting code under the web document root with an extension that is not specifically handled by the server.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
924 CWE-435,EN-Interaction Error (Type: Class),"An interaction error occurs when two entities work correctly when running independently, but they interact in unexpected ways when they are run together.","This could apply to products, systems, components, etc.",,Unknown,
925 CWE-436,EN-Interpretation Conflict (Type: Base),"Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,"On Interpretation Conflict Vulnerabilities
918 CWE-428,Unquoted Search Path or Element (Type: Base),"The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.","If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Process Loading"", Page 654."
919 CWE-43,Path Equivalence: filename.... (Multiple Trailing Dot) (Type: Variant),A software system that accepts path input in the form of multiple trailing dot ('filedir....') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,
920 CWE-430,Deployment of Wrong Handler (Type: Base),"The wrong ""handler"" is assigned to process an object.","An example of deploying the wrong handler would be calling a servlet to reveal source code of a .JSP file, or automatically ""determining"" type of the object even if it is contradictory to an explicitly specified type.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
921 CWE-431,Missing Handler (Type: Base),A handler is not available or implemented.,"When an exception is thrown and not caught, the process has given up an opportunity to decide if a given failure or event is worth a change in execution.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
922 CWE-432,Dangerous Signal Handler not Disabled During Sensitive Operations (Type: Base),"The application uses a signal handler that shares state with other signal handlers, but it does not properly mask or prevent those signal handlers from being invoked while the original signal handler is still running.","During the execution of a signal handler, it can be interrupted by another handler when a different signal is sent. If the two handlers share state - such as global variables - then an attacker can corrupt the state by sending another signal before the first handler has completed execution.",,Unknown,
923 CWE-433,Unparsed Raw Web Content Delivery (Type: Variant),The software stores raw content or supporting code under the web document root with an extension that is not specifically handled by the server.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
924 CWE-435,Interaction Error (Type: Class),"An interaction error occurs when two entities work correctly when running independently, but they interact in unexpected ways when they are run together.","This could apply to products, systems, components, etc.",,Unknown,
925 CWE-436,Interpretation Conflict (Type: Base),"Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,"On Interpretation Conflict Vulnerabilities
926926 Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection: http://www.insecure.org/stf/secnet_ids/secnet_ids.pdf
927927 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
928928 Poison NULL byte
929929 Re: Corsaire Security Advisory - Multiple vendor MIME RFC2047 encoding: http://marc.theaimsgroup.com/?l=bugtraq&m=109525864717484&w=2"
930 CWE-437,EN-Incomplete Model of Endpoint Features (Type: Base),"A product acts as an intermediary or monitor between two or more endpoints, but it does not have a complete model of an endpoint's features, behaviors, or state, potentially causing the product to perform incorrect actions based on this incomplete model.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
931 CWE-439,EN-Behavioral Change in New Version or Environment (Type: Base),"A's behavior or functionality changes with a new version of A, or a new environment, which is not known (or manageable) by B.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
932 CWE-44,EN-Path Equivalence: file.name (Internal Dot) (Type: Variant),A software system that accepts path input in the form of internal dot ('file.ordir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
933 CWE-440,EN-Expected Behavior Violation (Type: Base),"A feature, API, or function being used by a product behaves differently than the product expects.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
934 CWE-441,EN-Unintended Proxy or Intermediary (Confused Deputy) (Type: Class),"The software receives a request, message, or directive from an upstream component, but the software does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the software's control sphere. This causes the software to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
930 CWE-437,Incomplete Model of Endpoint Features (Type: Base),"A product acts as an intermediary or monitor between two or more endpoints, but it does not have a complete model of an endpoint's features, behaviors, or state, potentially causing the product to perform incorrect actions based on this incomplete model.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
931 CWE-439,Behavioral Change in New Version or Environment (Type: Base),"A's behavior or functionality changes with a new version of A, or a new environment, which is not known (or manageable) by B.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
932 CWE-44,Path Equivalence: file.name (Internal Dot) (Type: Variant),A software system that accepts path input in the form of internal dot ('file.ordir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
933 CWE-440,Expected Behavior Violation (Type: Base),"A feature, API, or function being used by a product behaves differently than the product expects.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
934 CWE-441,Unintended Proxy or Intermediary (Confused Deputy) (Type: Class),"The software receives a request, message, or directive from an upstream component, but the software does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the software's control sphere. This causes the software to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
935935 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
936936 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
937937 The attacker is prevented from making the request directly to the target; and
938938 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,The Confused Deputy (or why capabilities might have been invented): http://www.cap-lore.com/CapTheory/ConfusedDeputy.html
939 CWE-443,EN-DEPRECATED (Duplicate): HTTP response splitting (Type: Base),This weakness can be found at CWE-113.,"If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
939 CWE-443,DEPRECATED (Duplicate): HTTP response splitting (Type: Base),This weakness can be found at CWE-113.,"If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
940940 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
941941 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
942942 The attacker is prevented from making the request directly to the target; and
943943 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,
944 CWE-444,EN-Inconsistent Interpretation of HTTP Requests (HTTP Request Smuggling) (Type: Base),"When malformed or abnormal HTTP requests are interpreted by one or more entities in the data flow between the user and the web server, such as a proxy or firewall, they can be interpreted inconsistently, allowing the attacker to ""smuggle"" a request to one device without the other device being aware of it.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
944 CWE-444,Inconsistent Interpretation of HTTP Requests (HTTP Request Smuggling) (Type: Base),"When malformed or abnormal HTTP requests are interpreted by one or more entities in the data flow between the user and the web server, such as a proxy or firewall, they can be interpreted inconsistently, allowing the attacker to ""smuggle"" a request to one device without the other device being aware of it.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
945945 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
946946 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
947947 The attacker is prevented from making the request directly to the target; and
948948 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,HTTP Request Smuggling: http://www.cgisecurity.com/lib/HTTP-Request-Smuggling.pdf
949 CWE-446,EN-UI Discrepancy for Security Feature (Type: Base),"The user interface does not correctly enable or configure a security feature, but the interface provides feedback that causes the user to believe that the feature is in a secure state.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
950 CWE-447,EN-Unimplemented or Unsupported Feature in UI (Type: Base),"A UI function for a security feature appears to be supported and gives feedback to the user that suggests that it is supported, but the underlying functionality is not implemented.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
951 CWE-448,EN-Obsolete Feature in UI (Type: Base),A UI function is obsolete and the product does not warn the user.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
952 CWE-449,EN-The UI Performs the Wrong Action (Type: Base),The UI performs the wrong action with respect to the user's request.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
953 CWE-45,EN-Path Equivalence: file...name (Multiple Internal Dot) (Type: Variant),A software system that accepts path input in the form of multiple internal dot ('file...dir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
954 CWE-450,EN-Multiple Interpretations of UI Input (Type: Base),The UI has multiple interpretations of user input but does not prompt the user when it selects the less secure interpretation.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
955 CWE-451,EN-UI Misrepresentation of Critical Information (Type: Base),"The UI does not properly represent critical information to the user, allowing the information - or its source - to be obscured or spoofed. This is often a component in phishing attacks.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
956 CWE-453,EN-Insecure Default Variable Initialization (Type: Base),"The software, by default, initializes an internal variable with an insecure or less secure value than is possible.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
957 CWE-454,EN-External Initialization of Trusted Variables or Data Stores (Type: Base),The software initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.,"A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
958 CWE-455,EN-Non-exit on Failed Initialization (Type: Base),"The software does not exit or otherwise modify its operation when security-relevant errors occur during initialization, such as when a configuration file has a format error, which can cause the software to execute in a less secure fashion than intended by the administrator.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
959 CWE-456,EN-Missing Initialization of a Variable (Type: Base),"The software does not initialize critical variables, which causes the execution environment to use unexpected values.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
960 CWE-458,EN-DEPRECATED: Incorrect Initialization (Type: Base),"This weakness has been deprecated because its name and description did not match. The description duplicated CWE-454, while the name suggested a more abstract initialization problem. Please refer to CWE-665 for the more abstract problem.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
961 CWE-459,EN-Incomplete Cleanup (Type: Base),"The software does not properly ""clean up"" and remove temporary or supporting resources after they have been used.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
962 CWE-46,EN-Path Equivalence: filename (Trailing Space) (Type: Variant),A software system that accepts path input in the form of trailing space ('filedir ') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
963 CWE-463,EN-Deletion of Data Structure Sentinel (Type: Base),The accidental deletion of a data-structure sentinel can cause serious programming logic problems.,"Often times data-structure sentinels are used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the deletion or modification outside of some wrapper interface which provides safety.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL-Termination Problems"", Page 452."
964 CWE-466,EN-Return of Pointer Value Outside of Expected Range (Type: Base),A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
965 CWE-47,EN-Path Equivalence: filename (Leading Space) (Type: Variant),A software system that accepts path input in the form of leading space (' filedir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,
966 CWE-470,EN-Use of Externally-Controlled Input to Select Classes or Code (Unsafe Reflection) (Type: Base),"The application uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.","If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
967 CWE-471,EN-Modification of Assumed-Immutable Data (MAID) (Type: Base),The software does not properly protect an assumed-immutable element from being modified by an attacker.,"If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
968 CWE-472,EN-External Control of Assumed-Immutable Web Parameter (Type: Base),"The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
949 CWE-446,UI Discrepancy for Security Feature (Type: Base),"The user interface does not correctly enable or configure a security feature, but the interface provides feedback that causes the user to believe that the feature is in a secure state.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
950 CWE-447,Unimplemented or Unsupported Feature in UI (Type: Base),"A UI function for a security feature appears to be supported and gives feedback to the user that suggests that it is supported, but the underlying functionality is not implemented.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
951 CWE-448,Obsolete Feature in UI (Type: Base),A UI function is obsolete and the product does not warn the user.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
952 CWE-449,The UI Performs the Wrong Action (Type: Base),The UI performs the wrong action with respect to the user's request.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
953 CWE-45,Path Equivalence: file...name (Multiple Internal Dot) (Type: Variant),A software system that accepts path input in the form of multiple internal dot ('file...dir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
954 CWE-450,Multiple Interpretations of UI Input (Type: Base),The UI has multiple interpretations of user input but does not prompt the user when it selects the less secure interpretation.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
955 CWE-451,UI Misrepresentation of Critical Information (Type: Base),"The UI does not properly represent critical information to the user, allowing the information - or its source - to be obscured or spoofed. This is often a component in phishing attacks.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
956 CWE-453,Insecure Default Variable Initialization (Type: Base),"The software, by default, initializes an internal variable with an insecure or less secure value than is possible.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
957 CWE-454,External Initialization of Trusted Variables or Data Stores (Type: Base),The software initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.,"A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
958 CWE-455,Non-exit on Failed Initialization (Type: Base),"The software does not exit or otherwise modify its operation when security-relevant errors occur during initialization, such as when a configuration file has a format error, which can cause the software to execute in a less secure fashion than intended by the administrator.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
959 CWE-456,Missing Initialization of a Variable (Type: Base),"The software does not initialize critical variables, which causes the execution environment to use unexpected values.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
960 CWE-458,DEPRECATED: Incorrect Initialization (Type: Base),"This weakness has been deprecated because its name and description did not match. The description duplicated CWE-454, while the name suggested a more abstract initialization problem. Please refer to CWE-665 for the more abstract problem.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
961 CWE-459,Incomplete Cleanup (Type: Base),"The software does not properly ""clean up"" and remove temporary or supporting resources after they have been used.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
962 CWE-46,Path Equivalence: filename (Trailing Space) (Type: Variant),A software system that accepts path input in the form of trailing space ('filedir ') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
963 CWE-463,Deletion of Data Structure Sentinel (Type: Base),The accidental deletion of a data-structure sentinel can cause serious programming logic problems.,"Often times data-structure sentinels are used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the deletion or modification outside of some wrapper interface which provides safety.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL-Termination Problems"", Page 452."
964 CWE-466,Return of Pointer Value Outside of Expected Range (Type: Base),A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
965 CWE-47,Path Equivalence: filename (Leading Space) (Type: Variant),A software system that accepts path input in the form of leading space (' filedir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,
966 CWE-470,Use of Externally-Controlled Input to Select Classes or Code (Unsafe Reflection) (Type: Base),"The application uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.","If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
967 CWE-471,Modification of Assumed-Immutable Data (MAID) (Type: Base),The software does not properly protect an assumed-immutable element from being modified by an attacker.,"If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
968 CWE-472,External Control of Assumed-Immutable Web Parameter (Type: Base),"The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
969969 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75
970970 The Art of Software Security Assessment: Chapter 17, ""Embedding State in HTML and URLs"", Page 1032."
971 CWE-473,EN-PHP External Variable Modification (Type: Variant),"A PHP application does not properly protect against the modification of variables from external sources, such as query parameters or cookies. This can expose the application to numerous weaknesses that would not exist otherwise.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
971 CWE-473,PHP External Variable Modification (Type: Variant),"A PHP application does not properly protect against the modification of variables from external sources, such as query parameters or cookies. This can expose the application to numerous weaknesses that would not exist otherwise.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
972972 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
973 CWE-474,EN-Use of Function with Inconsistent Implementations (Type: Base),"The code uses a function that has inconsistent implementations across operating systems and versions, which might cause security-relevant portability problems.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
973 CWE-474,Use of Function with Inconsistent Implementations (Type: Base),"The code uses a function that has inconsistent implementations across operating systems and versions, which might cause security-relevant portability problems.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
974974 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
975 CWE-475,EN-Undefined Behavior for Input to API (Type: Base),The behavior of this function is undefined unless its control parameter is set to a specific value.,"If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
975 CWE-475,Undefined Behavior for Input to API (Type: Base),The behavior of this function is undefined unless its control parameter is set to a specific value.,"If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
976976 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
977 CWE-477,EN-Use of Obsolete Functions (Type: Base),"The code uses deprecated or obsolete functions, which suggests that the code has not been actively reviewed or maintained.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,
978 CWE-478,EN-Missing Default Case in Switch Statement (Type: Variant),"The code does not have a default case in a switch statement, which might lead to complex logical errors and resultant weaknesses.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
979 CWE-48,EN-Path Equivalence: file name (Internal Whitespace) (Type: Variant),A software system that accepts path input in the form of internal space ('file(SPACE)name') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
977 CWE-477,Use of Obsolete Functions (Type: Base),"The code uses deprecated or obsolete functions, which suggests that the code has not been actively reviewed or maintained.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,
978 CWE-478,Missing Default Case in Switch Statement (Type: Variant),"The code does not have a default case in a switch statement, which might lead to complex logical errors and resultant weaknesses.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
979 CWE-48,Path Equivalence: file name (Internal Whitespace) (Type: Variant),A software system that accepts path input in the form of internal space ('file(SPACE)name') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
980980 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Unknown,
981 CWE-485,EN-Insufficient Encapsulation (Type: Class),The product does not sufficiently encapsulate critical data or functionality.,"Encapsulation is about drawing strong boundaries. In a web browser that might mean ensuring that your mobile code cannot be abused by other mobile code. On the server it might mean differentiation between validated data and unvalidated data, between one user's data and another's, or between data users are allowed to see and data that they are not.",,Unknown,
982 CWE-488,EN-Exposure of Data Element to Wrong Session (Type: Variant),"The product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
981 CWE-485,Insufficient Encapsulation (Type: Class),The product does not sufficiently encapsulate critical data or functionality.,"Encapsulation is about drawing strong boundaries. In a web browser that might mean ensuring that your mobile code cannot be abused by other mobile code. On the server it might mean differentiation between validated data and unvalidated data, between one user's data and another's, or between data users are allowed to see and data that they are not.",,Unknown,
982 CWE-488,Exposure of Data Element to Wrong Session (Type: Variant),"The product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
983983 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
984 CWE-489,EN-Leftover Debug Code (Type: Base),The application can be deployed with active debugging code that can create unintended entry points.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
984 CWE-489,Leftover Debug Code (Type: Base),The application can be deployed with active debugging code that can create unintended entry points.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
985985 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
986 CWE-49,EN-Path Equivalence: filename/ (Trailing Slash) (Type: Variant),A software system that accepts path input in the form of trailing slash ('filedir/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
986 CWE-49,Path Equivalence: filename/ (Trailing Slash) (Type: Variant),A software system that accepts path input in the form of trailing slash ('filedir/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
987987 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
988 CWE-491,EN-Public cloneable() Method Without Final (Object Hijack) (Type: Variant),"A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
988 CWE-491,Public cloneable() Method Without Final (Object Hijack) (Type: Variant),"A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
989989 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,"OWASP , Attack Category : Mobile code: object hijack: http://www.owasp.org/index.php/Mobile_code:_object_hijack"
990 CWE-495,EN-Private Array-Typed Field Returned From A Public Method (Type: Variant),"The product has a method that is declared public, but returns a reference to a private array, which could then be modified in unexpected ways.","An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
991 CWE-496,EN-Public Data Assigned to Private Array-Typed Field (Type: Variant),Assigning public data to a private array is equivalent to giving public access to the array.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
992 CWE-497,EN-Exposure of System Data to an Unauthorized Control Sphere (Type: Variant),Exposing system data or debugging information helps an adversary learn about the system and form an attack plan.,"An information exposure occurs when system data or debugging information leaves the program through an output stream or logging function that makes it accessible to unauthorized parties. An attacker can also cause errors to occur by submitting unusual requests to the web application. The response to these errors can reveal detailed system information, deny service, cause security mechanisms to fail, and crash the server. An attacker can use error messages that reveal technologies, operating systems, and product versions to tune the attack against known vulnerabilities in these technologies. An application may use diagnostic methods that provide significant implementation details such as stack traces as part of its error handling mechanism.",,Unknown,
993 CWE-5,EN-J2EE Misconfiguration: Data Transmission Without Encryption (Type: Variant),Information sent over a network can be compromised while in transit. An attacker may be able to read/modify the contents if the data are sent in plaintext or are weakly encrypted.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
994 CWE-50,EN-Path Equivalence: //multiple/leading/slash (Type: Variant),A software system that accepts path input in the form of multiple leading slash ('//multiple/leading/slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
995 CWE-501,EN-Trust Boundary Violation (Type: Base),The product mixes trusted and untrusted data in the same data structure or structured message.,"By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.",,Unknown,
996 CWE-506,EN-Embedded Malicious Code (Type: Class),The application contains code that appears to be malicious in nature.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
997 CWE-507,EN-Trojan Horse (Type: Base),"The software appears to contain benign or useful functionality, but it also contains code that is hidden from normal operation that violates the intended security policy of the user or the system administrator.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,"Writing Secure Code: Chapter 7, ""Viruses, Trojans, and Worms In a Nutshell"" Page 208"
998 CWE-508,EN-Non-Replicating Malicious Code (Type: Base),Non-replicating malicious code only resides on the target system or software that is attacked; it does not attempt to spread to other systems.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
999 CWE-509,EN-Replicating Malicious Code (Virus or Worm) (Type: Base),"Replicating malicious code, including viruses and worms, will attempt to attack other systems once it has successfully compromised the target system or software.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1000 CWE-51,EN-Path Equivalence: /multiple//internal/slash (Type: Variant),A software system that accepts path input in the form of multiple internal slash ('/multiple//internal/slash/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1001 CWE-510,EN-Trapdoor (Type: Base),"A trapdoor is a hidden piece of code that responds to a special input, allowing its user access to resources without passing through the normal security enforcement mechanism.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1002 CWE-511,EN-Logic/Time Bomb (Type: Base),"The software contains code that is designed to disrupt the legitimate operation of the software (or its environment) when a certain time passes, or when a certain logical condition is met.","When the time bomb or logic bomb is detonated, it may perform a denial of service such as crashing the system, deleting critical data, or degrading system response time. This bomb might be placed within either a replicating or non-replicating Trojan horse.",,Unknown,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
1003 CWE-512,EN-Spyware (Type: Base),"The software collects personally identifiable information about a human user or the user's activities, but the software accesses this information using other resources besides itself, and it does not require that user's explicit approval or direct input into the software.","""Spyware"" is a commonly used term with many definitions and interpretations. In general, it is meant to software that collects information or installs functionality that human users might not allow if they were fully aware of the actions being taken by the software. For example, a user might expect that tax software would collect a social security number and include it when filing a tax return, but that same user would not expect gaming software to obtain the social security number from that tax software's data.",,Unknown,
1004 CWE-514,EN-Covert Channel (Type: Class),A covert channel is a path that can be used to transfer information in a way not intended by the system's designers.,Typically the system has not given authorization for the transmission and has no knowledge of its occurrence.,,Unknown,
1005 CWE-516,EN-DEPRECATED (Duplicate): Covert Timing Channel (Type: Base),This weakness can be found at CWE-385.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1006 CWE-52,EN-Path Equivalence: /multiple/trailing/slash// (Type: Variant),A software system that accepts path input in the form of multiple trailing slash ('/multiple/trailing/slash//') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1007 CWE-520,EN-.NET Misconfiguration: Use of Impersonation (Type: Variant),Allowing a .NET application to run at potentially escalated levels of access to the underlying operating and file systems can be dangerous and result in various forms of attacks.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1008 CWE-521,EN-Weak Password Requirements (Type: Base),"The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1009 CWE-522,EN-Insufficiently Protected Credentials (Type: Base),This weakness occurs when the application transmits or stores authentication credentials and uses an insecure method that is susceptible to unauthorized interception and/or retrieval.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1010 CWE-523,EN-Unprotected Transport of Credentials (Type: Variant),Login pages not using adequate measures to protect the user name and password while they are in transit from the client to the server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1011 CWE-524,EN-Information Exposure Through Caching (Type: Variant),"The application uses a cache to maintain a pool of objects, threads, connections, pages, or passwords to minimize the time it takes to access them or the resources to which they connect. If implemented improperly, these caches can allow access to unauthorized information or cause a denial of service vulnerability.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1012 CWE-525,EN-Information Exposure Through Browser Caching (Type: Variant),"For each web page, the application should have an appropriate caching policy specifying the extent to which the page and its form fields should be cached.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1013 CWE-526,EN-Information Exposure Through Environmental Variables (Type: Variant),Environmental variables may contain sensitive information about a remote server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1014 CWE-527,EN-Exposure of CVS Repository to an Unauthorized Control Sphere (Type: Variant),The product stores a CVS repository in a directory or other container that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1015 CWE-528,EN-Exposure of Core Dump File to an Unauthorized Control Sphere (Type: Variant),The product generates a core dump file in a directory that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1016 CWE-529,EN-Exposure of Access Control List Files to an Unauthorized Control Sphere (Type: Variant),The product stores access control list files in a directory or other container that is accessible to actors outside of the intended control sphere.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1017 CWE-53,EN-Path Equivalence: \multiple\\internal\backslash (Type: Variant),A software system that accepts path input in the form of multiple internal backslash ('\multiple\trailing\\slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1018 CWE-530,EN-Exposure of Backup File to an Unauthorized Control Sphere (Type: Variant),A backup file is stored in a directory that is accessible to actors outside of the intended control sphere.,"Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1019 CWE-531,EN-Information Exposure Through Test Code (Type: Variant),"Accessible test applications can pose a variety of security risks. Since developers or administrators rarely consider that someone besides themselves would even know about the existence of these applications, it is common for them to contain sensitive information or functions.","Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1020 CWE-533,EN-Information Exposure Through Server Log Files (Type: Variant),"A server.log file was found. This can give information on whatever application left the file. Usually this can give full path names and system information, and sometimes usernames and passwords.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1021 CWE-534,EN-Information Exposure Through Debug Log Files (Type: Variant),The application does not sufficiently restrict access to a log file that is used for debugging.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1022 CWE-535,EN-Information Exposure Through Shell Error Message (Type: Variant),"A command shell error message indicates that there exists an unhandled exception in the web application code. In many cases, an attacker can leverage the conditions that cause these errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1023 CWE-536,EN-Information Exposure Through Servlet Runtime Error Message (Type: Variant),A servlet error message indicates that there exists an unhandled exception in your web application code and may provide useful information to an attacker.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1024 CWE-537,EN-Information Exposure Through Java Runtime Error Message (Type: Variant),"In many cases, an attacker can leverage the conditions that cause unhandled exception errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1025 CWE-538,EN-File and Directory Information Exposure (Type: Base),The product stores sensitive information in files or directories that are accessible to actors outside of the intended control sphere.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
1026 CWE-539,EN-Information Exposure Through Persistent Cookies (Type: Variant),Persistent cookies are cookies that are stored on the browser's hard drive. This can cause security and privacy issues depending on the information stored in the cookie and how it is accessed.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1027 CWE-54,EN-Path Equivalence: filedir\ (Trailing Backslash) (Type: Variant),A software system that accepts path input in the form of trailing backslash ('filedir\') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1028 CWE-540,EN-Information Exposure Through Source Code (Type: Variant),Source code on a web server often contains sensitive information and should generally not be accessible to users.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1029 CWE-541,EN-Information Exposure Through Include Source Code (Type: Variant),"If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.","There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1030 CWE-542,EN-Information Exposure Through Cleanup Log Files (Type: Variant),The application does not properly protect or delete a log file related to cleanup.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1031 CWE-543,EN-Use of Singleton Pattern Without Synchronization in a Multithreaded Context (Type: Variant),The software uses the singleton pattern when creating a resource within a multithreaded environment.,The use of a singleton pattern may not be thread-safe.,,Unknown,Thread-Specifc Storage for C/C++: http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf
1032 CWE-544,EN-Missing Standardized Error Handling Mechanism (Type: Base),"The software does not use a standardized method for handling errors throughout the code, which might introduce inconsistent error handling and resultant weaknesses.","If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1033 CWE-545,EN-Use of Dynamic Class Loading (Type: Variant),Dynamically loaded code has the potential to be malicious.,"If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1034 CWE-546,EN-Suspicious Comment (Type: Variant),"The code contains comments that suggest the presence of bugs, incomplete functionality, or weaknesses.","Many suspicious comments, such as BUG, HACK, FIXME, LATER, LATER2, TODO, in the code indicate missing security functionality and checking. Others indicate code problems that programmers should fix, such as hard-coded variables, error handling, not using stored procedures, and performance issues.",,Unknown,
1035 CWE-547,"EN-Use of Hard-coded, Security-relevant Constants (Type: Variant)","The program uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.","If the developer does not find all occurrences of the hard-coded constants, an incorrect policy decision may be made if one of the constants is not changed. Making changes to these values will require code changes that may be difficult or impossible once the system is released to the field. In addition, these hard-coded values may become available to attackers if the code is ever disclosed.",,Unknown,
1036 CWE-548,EN-Information Exposure Through Directory Listing (Type: Variant),"A directory listing is inappropriately exposed, yielding potentially sensitive information to attackers.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1037 CWE-549,EN-Missing Password Field Masking (Type: Variant),"The software does not mask passwords during entry, increasing the potential for attackers to observe and capture passwords.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1038 CWE-55,EN-Path Equivalence: /./ (Single Dot Directory) (Type: Variant),A software system that accepts path input in the form of single dot directory exploit ('/./') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1039 CWE-550,EN-Information Exposure Through Server Error Message (Type: Variant),"Certain conditions, such as network failure, will cause a server error message to be displayed.","While error messages in and of themselves are not dangerous, per se, it is what an attacker can glean from them that might cause eventual problems.",,Unknown,
1040 CWE-551,EN-Incorrect Behavior Order: Authorization Before Parsing and Canonicalization (Type: Base),"If a web server does not fully parse requested URLs before it examines them for authorization, it may be possible for an attacker to bypass authorization protection.","For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1041 CWE-552,EN-Files or Directories Accessible to External Parties (Type: Base),Files or directories are accessible in the environment that should not be.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1042 CWE-553,EN-Command Shell in Externally Accessible Directory (Type: Variant),A possible shell file exists in /cgi-bin/ or other accessible directories. This is extremely dangerous and can be used by an attacker to execute commands on the web server.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1043 CWE-554,EN-ASP.NET Misconfiguration: Not Using Input Validation Framework (Type: Variant),The ASP.NET application does not use an input validation framework.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1044 CWE-555,EN-J2EE Misconfiguration: Plaintext Password in Configuration File (Type: Variant),The J2EE application stores a plaintext password in a configuration file.,"Storing a plaintext password in a configuration file allows anyone who can read the file to access the password-protected resource, making it an easy target for attackers.",,Unknown,
1045 CWE-556,EN-ASP.NET Misconfiguration: Use of Identity Impersonation (Type: Variant),Configuring an ASP.NET application to run with impersonated credentials may give the application unnecessary privileges.,The use of impersonated credentials allows an ASP.NET application to run with either the privileges of the client on whose behalf it is executing or with arbitrary privileges granted in its configuration.,,Unknown,
1046 CWE-558,EN-Use of getlogin() in Multithreaded Application (Type: Variant),"The application uses the getlogin() function in a multithreaded context, potentially causing it to return incorrect values.","The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1047 CWE-56,EN-Path Equivalence: filedir* (Wildcard) (Type: Variant),A software system that accepts path input in the form of asterisk wildcard ('filedir*') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1048 CWE-560,EN-Use of umask() with chmod-style Argument (Type: Variant),The product calls umask() with an incorrect argument that is specified as if it is an argument to chmod().,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1049 CWE-561,EN-Dead Code (Type: Variant),"The software contains dead code, which can never be executed.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1050 CWE-562,EN-Return of Stack Variable Address (Type: Base),"A function returns the address of a stack variable, which will cause unintended program behavior, typically in the form of a crash.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1051 CWE-563,EN-Unused Variable (Type: Variant),"The variable's value is assigned but never used, making it a dead store.","It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1052 CWE-564,EN-SQL Injection: Hibernate (Type: Variant),Using Hibernate to execute a dynamic SQL statement built with user-controlled input can allow an attacker to modify the statement's meaning or to execute arbitrary SQL commands.,"It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1053 CWE-565,EN-Reliance on Cookies without Validation and Integrity Checking (Type: Base),"The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.",,Unknown,
1054 CWE-566,EN-Authorization Bypass Through User-Controlled SQL Primary Key (Type: Variant),"The software uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.","When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.
990 CWE-495,Private Array-Typed Field Returned From A Public Method (Type: Variant),"The product has a method that is declared public, but returns a reference to a private array, which could then be modified in unexpected ways.","An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
991 CWE-496,Public Data Assigned to Private Array-Typed Field (Type: Variant),Assigning public data to a private array is equivalent to giving public access to the array.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
992 CWE-497,Exposure of System Data to an Unauthorized Control Sphere (Type: Variant),Exposing system data or debugging information helps an adversary learn about the system and form an attack plan.,"An information exposure occurs when system data or debugging information leaves the program through an output stream or logging function that makes it accessible to unauthorized parties. An attacker can also cause errors to occur by submitting unusual requests to the web application. The response to these errors can reveal detailed system information, deny service, cause security mechanisms to fail, and crash the server. An attacker can use error messages that reveal technologies, operating systems, and product versions to tune the attack against known vulnerabilities in these technologies. An application may use diagnostic methods that provide significant implementation details such as stack traces as part of its error handling mechanism.",,Unknown,
993 CWE-5,J2EE Misconfiguration: Data Transmission Without Encryption (Type: Variant),Information sent over a network can be compromised while in transit. An attacker may be able to read/modify the contents if the data are sent in plaintext or are weakly encrypted.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
994 CWE-50,Path Equivalence: //multiple/leading/slash (Type: Variant),A software system that accepts path input in the form of multiple leading slash ('//multiple/leading/slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
995 CWE-501,Trust Boundary Violation (Type: Base),The product mixes trusted and untrusted data in the same data structure or structured message.,"By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.",,Unknown,
996 CWE-506,Embedded Malicious Code (Type: Class),The application contains code that appears to be malicious in nature.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
997 CWE-507,Trojan Horse (Type: Base),"The software appears to contain benign or useful functionality, but it also contains code that is hidden from normal operation that violates the intended security policy of the user or the system administrator.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,"Writing Secure Code: Chapter 7, ""Viruses, Trojans, and Worms In a Nutshell"" Page 208"
998 CWE-508,Non-Replicating Malicious Code (Type: Base),Non-replicating malicious code only resides on the target system or software that is attacked; it does not attempt to spread to other systems.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
999 CWE-509,Replicating Malicious Code (Virus or Worm) (Type: Base),"Replicating malicious code, including viruses and worms, will attempt to attack other systems once it has successfully compromised the target system or software.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1000 CWE-51,Path Equivalence: /multiple//internal/slash (Type: Variant),A software system that accepts path input in the form of multiple internal slash ('/multiple//internal/slash/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1001 CWE-510,Trapdoor (Type: Base),"A trapdoor is a hidden piece of code that responds to a special input, allowing its user access to resources without passing through the normal security enforcement mechanism.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1002 CWE-511,Logic/Time Bomb (Type: Base),"The software contains code that is designed to disrupt the legitimate operation of the software (or its environment) when a certain time passes, or when a certain logical condition is met.","When the time bomb or logic bomb is detonated, it may perform a denial of service such as crashing the system, deleting critical data, or degrading system response time. This bomb might be placed within either a replicating or non-replicating Trojan horse.",,Unknown,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
1003 CWE-512,Spyware (Type: Base),"The software collects personally identifiable information about a human user or the user's activities, but the software accesses this information using other resources besides itself, and it does not require that user's explicit approval or direct input into the software.","""Spyware"" is a commonly used term with many definitions and interpretations. In general, it is meant to software that collects information or installs functionality that human users might not allow if they were fully aware of the actions being taken by the software. For example, a user might expect that tax software would collect a social security number and include it when filing a tax return, but that same user would not expect gaming software to obtain the social security number from that tax software's data.",,Unknown,
1004 CWE-514,Covert Channel (Type: Class),A covert channel is a path that can be used to transfer information in a way not intended by the system's designers.,Typically the system has not given authorization for the transmission and has no knowledge of its occurrence.,,Unknown,
1005 CWE-516,DEPRECATED (Duplicate): Covert Timing Channel (Type: Base),This weakness can be found at CWE-385.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1006 CWE-52,Path Equivalence: /multiple/trailing/slash// (Type: Variant),A software system that accepts path input in the form of multiple trailing slash ('/multiple/trailing/slash//') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1007 CWE-520,.NET Misconfiguration: Use of Impersonation (Type: Variant),Allowing a .NET application to run at potentially escalated levels of access to the underlying operating and file systems can be dangerous and result in various forms of attacks.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1008 CWE-521,Weak Password Requirements (Type: Base),"The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1009 CWE-522,Insufficiently Protected Credentials (Type: Base),This weakness occurs when the application transmits or stores authentication credentials and uses an insecure method that is susceptible to unauthorized interception and/or retrieval.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1010 CWE-523,Unprotected Transport of Credentials (Type: Variant),Login pages not using adequate measures to protect the user name and password while they are in transit from the client to the server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1011 CWE-524,Information Exposure Through Caching (Type: Variant),"The application uses a cache to maintain a pool of objects, threads, connections, pages, or passwords to minimize the time it takes to access them or the resources to which they connect. If implemented improperly, these caches can allow access to unauthorized information or cause a denial of service vulnerability.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1012 CWE-525,Information Exposure Through Browser Caching (Type: Variant),"For each web page, the application should have an appropriate caching policy specifying the extent to which the page and its form fields should be cached.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1013 CWE-526,Information Exposure Through Environmental Variables (Type: Variant),Environmental variables may contain sensitive information about a remote server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1014 CWE-527,Exposure of CVS Repository to an Unauthorized Control Sphere (Type: Variant),The product stores a CVS repository in a directory or other container that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1015 CWE-528,Exposure of Core Dump File to an Unauthorized Control Sphere (Type: Variant),The product generates a core dump file in a directory that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1016 CWE-529,Exposure of Access Control List Files to an Unauthorized Control Sphere (Type: Variant),The product stores access control list files in a directory or other container that is accessible to actors outside of the intended control sphere.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1017 CWE-53,Path Equivalence: \multiple\\internal\backslash (Type: Variant),A software system that accepts path input in the form of multiple internal backslash ('\multiple\trailing\\slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1018 CWE-530,Exposure of Backup File to an Unauthorized Control Sphere (Type: Variant),A backup file is stored in a directory that is accessible to actors outside of the intended control sphere.,"Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1019 CWE-531,Information Exposure Through Test Code (Type: Variant),"Accessible test applications can pose a variety of security risks. Since developers or administrators rarely consider that someone besides themselves would even know about the existence of these applications, it is common for them to contain sensitive information or functions.","Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1020 CWE-533,Information Exposure Through Server Log Files (Type: Variant),"A server.log file was found. This can give information on whatever application left the file. Usually this can give full path names and system information, and sometimes usernames and passwords.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1021 CWE-534,Information Exposure Through Debug Log Files (Type: Variant),The application does not sufficiently restrict access to a log file that is used for debugging.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1022 CWE-535,Information Exposure Through Shell Error Message (Type: Variant),"A command shell error message indicates that there exists an unhandled exception in the web application code. In many cases, an attacker can leverage the conditions that cause these errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1023 CWE-536,Information Exposure Through Servlet Runtime Error Message (Type: Variant),A servlet error message indicates that there exists an unhandled exception in your web application code and may provide useful information to an attacker.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1024 CWE-537,Information Exposure Through Java Runtime Error Message (Type: Variant),"In many cases, an attacker can leverage the conditions that cause unhandled exception errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1025 CWE-538,File and Directory Information Exposure (Type: Base),The product stores sensitive information in files or directories that are accessible to actors outside of the intended control sphere.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
1026 CWE-539,Information Exposure Through Persistent Cookies (Type: Variant),Persistent cookies are cookies that are stored on the browser's hard drive. This can cause security and privacy issues depending on the information stored in the cookie and how it is accessed.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1027 CWE-54,Path Equivalence: filedir\ (Trailing Backslash) (Type: Variant),A software system that accepts path input in the form of trailing backslash ('filedir\') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1028 CWE-540,Information Exposure Through Source Code (Type: Variant),Source code on a web server often contains sensitive information and should generally not be accessible to users.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1029 CWE-541,Information Exposure Through Include Source Code (Type: Variant),"If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.","There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1030 CWE-542,Information Exposure Through Cleanup Log Files (Type: Variant),The application does not properly protect or delete a log file related to cleanup.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1031 CWE-543,Use of Singleton Pattern Without Synchronization in a Multithreaded Context (Type: Variant),The software uses the singleton pattern when creating a resource within a multithreaded environment.,The use of a singleton pattern may not be thread-safe.,,Unknown,Thread-Specifc Storage for C/C++: http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf
1032 CWE-544,Missing Standardized Error Handling Mechanism (Type: Base),"The software does not use a standardized method for handling errors throughout the code, which might introduce inconsistent error handling and resultant weaknesses.","If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1033 CWE-545,Use of Dynamic Class Loading (Type: Variant),Dynamically loaded code has the potential to be malicious.,"If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1034 CWE-546,Suspicious Comment (Type: Variant),"The code contains comments that suggest the presence of bugs, incomplete functionality, or weaknesses.","Many suspicious comments, such as BUG, HACK, FIXME, LATER, LATER2, TODO, in the code indicate missing security functionality and checking. Others indicate code problems that programmers should fix, such as hard-coded variables, error handling, not using stored procedures, and performance issues.",,Unknown,
1035 CWE-547,"Use of Hard-coded, Security-relevant Constants (Type: Variant)","The program uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.","If the developer does not find all occurrences of the hard-coded constants, an incorrect policy decision may be made if one of the constants is not changed. Making changes to these values will require code changes that may be difficult or impossible once the system is released to the field. In addition, these hard-coded values may become available to attackers if the code is ever disclosed.",,Unknown,
1036 CWE-548,Information Exposure Through Directory Listing (Type: Variant),"A directory listing is inappropriately exposed, yielding potentially sensitive information to attackers.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1037 CWE-549,Missing Password Field Masking (Type: Variant),"The software does not mask passwords during entry, increasing the potential for attackers to observe and capture passwords.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1038 CWE-55,Path Equivalence: /./ (Single Dot Directory) (Type: Variant),A software system that accepts path input in the form of single dot directory exploit ('/./') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1039 CWE-550,Information Exposure Through Server Error Message (Type: Variant),"Certain conditions, such as network failure, will cause a server error message to be displayed.","While error messages in and of themselves are not dangerous, per se, it is what an attacker can glean from them that might cause eventual problems.",,Unknown,
1040 CWE-551,Incorrect Behavior Order: Authorization Before Parsing and Canonicalization (Type: Base),"If a web server does not fully parse requested URLs before it examines them for authorization, it may be possible for an attacker to bypass authorization protection.","For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1041 CWE-552,Files or Directories Accessible to External Parties (Type: Base),Files or directories are accessible in the environment that should not be.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1042 CWE-553,Command Shell in Externally Accessible Directory (Type: Variant),A possible shell file exists in /cgi-bin/ or other accessible directories. This is extremely dangerous and can be used by an attacker to execute commands on the web server.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1043 CWE-554,ASP.NET Misconfiguration: Not Using Input Validation Framework (Type: Variant),The ASP.NET application does not use an input validation framework.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1044 CWE-555,J2EE Misconfiguration: Plaintext Password in Configuration File (Type: Variant),The J2EE application stores a plaintext password in a configuration file.,"Storing a plaintext password in a configuration file allows anyone who can read the file to access the password-protected resource, making it an easy target for attackers.",,Unknown,
1045 CWE-556,ASP.NET Misconfiguration: Use of Identity Impersonation (Type: Variant),Configuring an ASP.NET application to run with impersonated credentials may give the application unnecessary privileges.,The use of impersonated credentials allows an ASP.NET application to run with either the privileges of the client on whose behalf it is executing or with arbitrary privileges granted in its configuration.,,Unknown,
1046 CWE-558,Use of getlogin() in Multithreaded Application (Type: Variant),"The application uses the getlogin() function in a multithreaded context, potentially causing it to return incorrect values.","The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1047 CWE-56,Path Equivalence: filedir* (Wildcard) (Type: Variant),A software system that accepts path input in the form of asterisk wildcard ('filedir*') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1048 CWE-560,Use of umask() with chmod-style Argument (Type: Variant),The product calls umask() with an incorrect argument that is specified as if it is an argument to chmod().,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1049 CWE-561,Dead Code (Type: Variant),"The software contains dead code, which can never be executed.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1050 CWE-562,Return of Stack Variable Address (Type: Base),"A function returns the address of a stack variable, which will cause unintended program behavior, typically in the form of a crash.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1051 CWE-563,Unused Variable (Type: Variant),"The variable's value is assigned but never used, making it a dead store.","It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1052 CWE-564,SQL Injection: Hibernate (Type: Variant),Using Hibernate to execute a dynamic SQL statement built with user-controlled input can allow an attacker to modify the statement's meaning or to execute arbitrary SQL commands.,"It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1053 CWE-565,Reliance on Cookies without Validation and Integrity Checking (Type: Base),"The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.",,Unknown,
1054 CWE-566,Authorization Bypass Through User-Controlled SQL Primary Key (Type: Variant),"The software uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.","When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.
10551055 Database access control errors occur when:
10561056 Data enters a program from an untrusted source.
10571057 The data is used to specify the value of a primary key in a SQL query.
10581058 The untrusted source does not have the permissions to be able to access all rows in the associated table.",,Unknown,
1059 CWE-567,EN-Unsynchronized Access to Shared Data in a Multithreaded Context (Type: Base),"The product does not properly synchronize shared data, such as static variables across threads, which can lead to undefined behavior and unpredictable data changes.","Within servlets, shared static variables are not protected from concurrent access, but servlets are multithreaded. This is a typical programming mistake in J2EE applications, since the multithreading is handled by the framework. When a shared variable can be influenced by an attacker, one thread could wind up modifying the variable to contain data that is not valid for a different thread that is also using the data within the variable.
1059 CWE-567,Unsynchronized Access to Shared Data in a Multithreaded Context (Type: Base),"The product does not properly synchronize shared data, such as static variables across threads, which can lead to undefined behavior and unpredictable data changes.","Within servlets, shared static variables are not protected from concurrent access, but servlets are multithreaded. This is a typical programming mistake in J2EE applications, since the multithreading is handled by the framework. When a shared variable can be influenced by an attacker, one thread could wind up modifying the variable to contain data that is not valid for a different thread that is also using the data within the variable.
10601060 Note that this weakness is not unique to servlets.",,Unknown,
1061 CWE-568,EN-finalize() Method Without super.finalize() (Type: Variant),The software contains a finalize() method that does not call super.finalize().,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1062 CWE-57,EN-Path Equivalence: fakedir/../realdir/filename (Type: Variant),"The software contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.",The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1063 CWE-570,EN-Expression is Always False (Type: Variant),The software contains an expression that will always evaluate to false.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1064 CWE-571,EN-Expression is Always True (Type: Variant),The software contains an expression that will always evaluate to true.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1065 CWE-572,EN-Call to Thread run() instead of start() (Type: Variant),"The program calls a thread's run() method instead of calling start(), which causes the code to run in the thread of the caller instead of the callee.","In most cases a direct call to a Thread object's run() method is a bug. The programmer intended to begin a new thread of control, but accidentally called run() instead of start(), so the run() method will execute in the caller's thread of control.",,Unknown,
1066 CWE-573,EN-Improper Following of Specification by Caller (Type: Class),"The software does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform.","When leveraging external functionality, such as an API, it is important that the caller does so in accordance with the requirements of the external functionality or else unintended behaviors may result, possibly leaving the system vulnerable to any number of exploits.",,Unknown,
1067 CWE-574,EN-EJB Bad Practices: Use of Synchronization Primitives (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using thread synchronization primitives.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances."" The specification justifies this requirement in the following way: ""This rule is required to ensure consistent runtime semantics because while some EJB containers may use a single JVM to execute all enterprise bean's instances, others may distribute the instances across multiple JVMs.""",,Unknown,
1068 CWE-575,EN-EJB Bad Practices: Use of AWT Swing (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the AWT functionality to attempt to output information to a display, or to input information from a keyboard."" The specification justifies this requirement in the following way: ""Most servers do not allow direct interaction between an application program and a keyboard/display attached to the server system.""",,Unknown,
1069 CWE-576,EN-EJB Bad Practices: Use of Java I/O (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the java.io package.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the java.io package to attempt to access files and directories in the file system."" The specification justifies this requirement in the following way: ""The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.""",,Unknown,
1070 CWE-577,EN-EJB Bad Practices: Use of Sockets (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using sockets.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast."" The specification justifies this requirement in the following way: ""The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean-- to serve the EJB clients.""",,Unknown,
1071 CWE-578,EN-EJB Bad Practices: Use of Class Loader (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the class loader.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1072 CWE-579,EN-J2EE Bad Practices: Non-serializable Object Stored in Session (Type: Variant),"The application stores a non-serializable object as an HttpSession attribute, which can hurt reliability.","The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1073 CWE-58,EN-Path Equivalence: Windows 8.3 Filename (Type: Variant),"The software contains a protection mechanism that restricts access to a long filename on a Windows operating system, but the software does not properly restrict access to the equivalent short ""8.3"" filename.","On later Windows operating systems, a file can have a ""long name"" and a short name that is compatible with older Windows file systems, with up to 8 characters in the filename and 3 characters for the extension. These ""8.3"" filenames, therefore, act as an alternate name for files with long names, so they are useful pathname equivalence manipulations.",,Unknown,"Writing Secure Code
1061 CWE-568,finalize() Method Without super.finalize() (Type: Variant),The software contains a finalize() method that does not call super.finalize().,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1062 CWE-57,Path Equivalence: fakedir/../realdir/filename (Type: Variant),"The software contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.",The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1063 CWE-570,Expression is Always False (Type: Variant),The software contains an expression that will always evaluate to false.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1064 CWE-571,Expression is Always True (Type: Variant),The software contains an expression that will always evaluate to true.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1065 CWE-572,Call to Thread run() instead of start() (Type: Variant),"The program calls a thread's run() method instead of calling start(), which causes the code to run in the thread of the caller instead of the callee.","In most cases a direct call to a Thread object's run() method is a bug. The programmer intended to begin a new thread of control, but accidentally called run() instead of start(), so the run() method will execute in the caller's thread of control.",,Unknown,
1066 CWE-573,Improper Following of Specification by Caller (Type: Class),"The software does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform.","When leveraging external functionality, such as an API, it is important that the caller does so in accordance with the requirements of the external functionality or else unintended behaviors may result, possibly leaving the system vulnerable to any number of exploits.",,Unknown,
1067 CWE-574,EJB Bad Practices: Use of Synchronization Primitives (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using thread synchronization primitives.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances."" The specification justifies this requirement in the following way: ""This rule is required to ensure consistent runtime semantics because while some EJB containers may use a single JVM to execute all enterprise bean's instances, others may distribute the instances across multiple JVMs.""",,Unknown,
1068 CWE-575,EJB Bad Practices: Use of AWT Swing (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the AWT functionality to attempt to output information to a display, or to input information from a keyboard."" The specification justifies this requirement in the following way: ""Most servers do not allow direct interaction between an application program and a keyboard/display attached to the server system.""",,Unknown,
1069 CWE-576,EJB Bad Practices: Use of Java I/O (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the java.io package.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the java.io package to attempt to access files and directories in the file system."" The specification justifies this requirement in the following way: ""The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.""",,Unknown,
1070 CWE-577,EJB Bad Practices: Use of Sockets (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using sockets.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast."" The specification justifies this requirement in the following way: ""The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean-- to serve the EJB clients.""",,Unknown,
1071 CWE-578,EJB Bad Practices: Use of Class Loader (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the class loader.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1072 CWE-579,J2EE Bad Practices: Non-serializable Object Stored in Session (Type: Variant),"The application stores a non-serializable object as an HttpSession attribute, which can hurt reliability.","The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1073 CWE-58,Path Equivalence: Windows 8.3 Filename (Type: Variant),"The software contains a protection mechanism that restricts access to a long filename on a Windows operating system, but the software does not properly restrict access to the equivalent short ""8.3"" filename.","On later Windows operating systems, a file can have a ""long name"" and a short name that is compatible with older Windows file systems, with up to 8 characters in the filename and 3 characters for the extension. These ""8.3"" filenames, therefore, act as an alternate name for files with long names, so they are useful pathname equivalence manipulations.",,Unknown,"Writing Secure Code
10741074 The Art of Software Security Assessment: Chapter 11, ""DOS 8.3 Filenames"", Page 673."
1075 CWE-580,EN-clone() Method Without super.clone() (Type: Variant),The software contains a clone() method that does not call super.clone() to obtain the new object.,"All implementations of clone() should obtain the new object by calling super.clone(). If a class does not follow this convention, a subclass's clone() method will return an object of the wrong type.",,Unknown,
1076 CWE-581,EN-Object Model Violation: Just One of Equals and Hashcode Defined (Type: Base),The software does not maintain equal hashcodes for equal objects.,"Java objects are expected to obey a number of invariants related to equality. One of these invariants is that equal objects must have equal hashcodes. In other words, if a.equals(b) == true then a.hashCode() == b.hashCode().",,Unknown,
1077 CWE-582,"EN-Array Declared Public, Final, and Static (Type: Variant)","The program declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.","Because arrays are mutable objects, the final constraint requires that the array object itself be assigned only once, but makes no guarantees about the values of the array elements. Since the array is public, a malicious program can change the values stored in the array. As such, in most cases an array declared public, final and static is a bug.",,Unknown,
1078 CWE-583,EN-finalize() Method Declared Public (Type: Variant),The program violates secure coding principles for mobile code by declaring a finalize() method public.,"A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1079 CWE-584,EN-Return Inside Finally Block (Type: Base),"The code has a return statement inside a finally block, which will cause any thrown exception in the try block to be discarded.","A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1080 CWE-585,EN-Empty Synchronized Block (Type: Variant),The software contains an empty synchronized block.,An empty synchronized block does not actually accomplish any synchronization and may indicate a troubled section of code. An empty synchronized block can occur because code no longer needed within the synchronized block is commented out without removing the synchronized block.,,Unknown,Intrinsic Locks and Synchronization (in Java): http://java.sun.com/docs/books/tutorial/essential/concurrency/locksync.html
1081 CWE-586,EN-Explicit Call to Finalize() (Type: Variant),The software makes an explicit call to the finalize() method from outside the finalizer.,"While the Java Language Specification allows an object's finalize() method to be called from outside the finalizer, doing so is usually a bad idea. For example, calling finalize() explicitly means that finalize() will be called more than once: the first time will be the explicit call and the last time will be the call that is made after the object is garbage collected.",,Unknown,
1082 CWE-587,EN-Assignment of a Fixed Address to a Pointer (Type: Base),The software sets a pointer to a specific address other than NULL or 0.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1083 CWE-588,EN-Attempt to Access Child of a Non-structure Pointer (Type: Variant),Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1084 CWE-589,EN-Call to Non-ubiquitous API (Type: Variant),The software uses an API function that does not exist on all versions of the target platform. This could cause portability problems or inconsistencies that allow denial of service or other consequences.,"Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Unknown,
1085 CWE-590,EN-Free of Memory not on the Heap (Type: Variant),"The application calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().","When free() is called on an invalid pointer, the program's memory management data structures may become corrupted. This corruption can cause the program to crash or, in some circumstances, an attacker may be able to cause free() to operate on controllable memory locations to modify critical program variables or execute code.",,Unknown,Valgrind: http://valgrind.org/
1086 CWE-591,EN-Sensitive Data Storage in Improperly Locked Memory (Type: Variant),"The application stores sensitive data in memory that is not locked, or that has been incorrectly locked, which might cause the memory to be written to swap files on disk by the virtual memory manager. This can make the data more accessible to external actors.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,
1087 CWE-592,EN-Authentication Bypass Issues (Type: Class),"The software does not properly perform authentication, allowing it to be bypassed through various methods.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1088 CWE-593,EN-Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created (Type: Variant),The software modifies the SSL context after connection creation has begun.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1089 CWE-594,EN-J2EE Framework: Saving Unserializable Objects to Disk (Type: Variant),When the J2EE container attempts to write unserializable objects to disk there is no guarantee that the process will complete successfully.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1090 CWE-595,EN-Comparison of Object References Instead of Object Contents (Type: Base),"The program compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.","If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1091 CWE-596,EN-Incorrect Semantic Object Comparison (Type: Base),The software does not correctly compare two objects based on their conceptual content.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1092 CWE-597,EN-Use of Wrong Operator in String Comparison (Type: Variant),"The product uses the wrong operator when comparing a string, such as using ""=="" when the equals() method should be used instead.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
1093 CWE-598,EN-Information Exposure Through Query Strings in GET Request (Type: Variant),"The web application uses the GET method to process requests that contain sensitive information, which can expose that information through the browser's history, Referers, web logs, and other sources.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,
1094 CWE-599,EN-Missing Validation of OpenSSL Certificate (Type: Variant),The software uses OpenSSL and trusts or uses a certificate without using the SSL_get_verify_result() function to ensure that the certificate satisfies all necessary security requirements.,"This could allow an attacker to use an invalid certificate to claim to be a trusted host, use expired certificates, or conduct other attacks that could be detected if the certificate is properly validated.",,Unknown,
1095 CWE-6,EN-J2EE Misconfiguration: Insufficient Session-ID Length (Type: Variant),The J2EE application is configured to use an insufficient session ID length.,"If an attacker can guess or steal a session ID, then he/she may be able to take over the user's session (called session hijacking). The number of possible session IDs increases with increased session ID length, making it more difficult to guess or steal a session ID.",,Unknown,No description: http://www.securiteam.com/securityreviews/5TP0F0UEVQ.html
1096 CWE-600,EN-Uncaught Exception in Servlet (Type: Base),"The Servlet does not catch all exceptions, which may reveal sensitive debugging information.","When a Servlet throws an exception, the default error response the Servlet container sends back to the user typically includes debugging information. This information is of great value to an attacker. For example, a stack trace might show the attacker a malformed SQL query string, the type of database being used, and the version of the application container. This information enables the attacker to target known vulnerabilities in these components.",,Unknown,
1097 CWE-603,EN-Use of Client-Side Authentication (Type: Base),"A client/server product performs authentication within client code but not in server code, allowing server-side authentication to be bypassed via a modified client that omits the authentication check.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1098 CWE-605,EN-Multiple Binds to the Same Port (Type: Base),"When multiple sockets are allowed to bind to the same port, other services on that port may be stolen or spoofed.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1099 CWE-606,EN-Unchecked Input for Loop Condition (Type: Base),"The product does not properly check inputs that are used for loop conditions, potentially leading to a denial of service because of excessive looping.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1100 CWE-607,EN-Public Static Final Field References Mutable Object (Type: Variant),"A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1101 CWE-608,EN-Struts: Non-private Field in ActionForm Class (Type: Variant),"An ActionForm class contains a field that has not been declared private, which can be accessed without using a setter or getter.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1102 CWE-609,EN-Double-Checked Locking (Type: Base),"The program uses double-checked locking to access a resource without the overhead of explicit synchronization, but the locking is insufficient.","Double-checked locking refers to the situation where a programmer checks to see if a resource has been initialized, grabs a lock, checks again to see if the resource has been initialized, and then performs the initialization if it has not occurred yet. This should not be done, as is not guaranteed to work in all languages and on all architectures. In summary, other threads may not be operating inside the synchronous block and are not guaranteed to see the operations execute in the same order as they would appear inside the synchronous block.",,Unknown,"The ""Double-Checked Locking is Broken"" Declaration: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
1075 CWE-580,clone() Method Without super.clone() (Type: Variant),The software contains a clone() method that does not call super.clone() to obtain the new object.,"All implementations of clone() should obtain the new object by calling super.clone(). If a class does not follow this convention, a subclass's clone() method will return an object of the wrong type.",,Unknown,
1076 CWE-581,Object Model Violation: Just One of Equals and Hashcode Defined (Type: Base),The software does not maintain equal hashcodes for equal objects.,"Java objects are expected to obey a number of invariants related to equality. One of these invariants is that equal objects must have equal hashcodes. In other words, if a.equals(b) == true then a.hashCode() == b.hashCode().",,Unknown,
1077 CWE-582,"Array Declared Public, Final, and Static (Type: Variant)","The program declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.","Because arrays are mutable objects, the final constraint requires that the array object itself be assigned only once, but makes no guarantees about the values of the array elements. Since the array is public, a malicious program can change the values stored in the array. As such, in most cases an array declared public, final and static is a bug.",,Unknown,
1078 CWE-583,finalize() Method Declared Public (Type: Variant),The program violates secure coding principles for mobile code by declaring a finalize() method public.,"A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1079 CWE-584,Return Inside Finally Block (Type: Base),"The code has a return statement inside a finally block, which will cause any thrown exception in the try block to be discarded.","A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1080 CWE-585,Empty Synchronized Block (Type: Variant),The software contains an empty synchronized block.,An empty synchronized block does not actually accomplish any synchronization and may indicate a troubled section of code. An empty synchronized block can occur because code no longer needed within the synchronized block is commented out without removing the synchronized block.,,Unknown,Intrinsic Locks and Synchronization (in Java): http://java.sun.com/docs/books/tutorial/essential/concurrency/locksync.html
1081 CWE-586,Explicit Call to Finalize() (Type: Variant),The software makes an explicit call to the finalize() method from outside the finalizer.,"While the Java Language Specification allows an object's finalize() method to be called from outside the finalizer, doing so is usually a bad idea. For example, calling finalize() explicitly means that finalize() will be called more than once: the first time will be the explicit call and the last time will be the call that is made after the object is garbage collected.",,Unknown,
1082 CWE-587,Assignment of a Fixed Address to a Pointer (Type: Base),The software sets a pointer to a specific address other than NULL or 0.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1083 CWE-588,Attempt to Access Child of a Non-structure Pointer (Type: Variant),Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1084 CWE-589,Call to Non-ubiquitous API (Type: Variant),The software uses an API function that does not exist on all versions of the target platform. This could cause portability problems or inconsistencies that allow denial of service or other consequences.,"Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Unknown,
1085 CWE-590,Free of Memory not on the Heap (Type: Variant),"The application calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().","When free() is called on an invalid pointer, the program's memory management data structures may become corrupted. This corruption can cause the program to crash or, in some circumstances, an attacker may be able to cause free() to operate on controllable memory locations to modify critical program variables or execute code.",,Unknown,Valgrind: http://valgrind.org/
1086 CWE-591,Sensitive Data Storage in Improperly Locked Memory (Type: Variant),"The application stores sensitive data in memory that is not locked, or that has been incorrectly locked, which might cause the memory to be written to swap files on disk by the virtual memory manager. This can make the data more accessible to external actors.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,
1087 CWE-592,Authentication Bypass Issues (Type: Class),"The software does not properly perform authentication, allowing it to be bypassed through various methods.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1088 CWE-593,Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created (Type: Variant),The software modifies the SSL context after connection creation has begun.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1089 CWE-594,J2EE Framework: Saving Unserializable Objects to Disk (Type: Variant),When the J2EE container attempts to write unserializable objects to disk there is no guarantee that the process will complete successfully.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1090 CWE-595,Comparison of Object References Instead of Object Contents (Type: Base),"The program compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.","If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1091 CWE-596,Incorrect Semantic Object Comparison (Type: Base),The software does not correctly compare two objects based on their conceptual content.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1092 CWE-597,Use of Wrong Operator in String Comparison (Type: Variant),"The product uses the wrong operator when comparing a string, such as using ""=="" when the equals() method should be used instead.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
1093 CWE-598,Information Exposure Through Query Strings in GET Request (Type: Variant),"The web application uses the GET method to process requests that contain sensitive information, which can expose that information through the browser's history, Referers, web logs, and other sources.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,
1094 CWE-599,Missing Validation of OpenSSL Certificate (Type: Variant),The software uses OpenSSL and trusts or uses a certificate without using the SSL_get_verify_result() function to ensure that the certificate satisfies all necessary security requirements.,"This could allow an attacker to use an invalid certificate to claim to be a trusted host, use expired certificates, or conduct other attacks that could be detected if the certificate is properly validated.",,Unknown,
1095 CWE-6,J2EE Misconfiguration: Insufficient Session-ID Length (Type: Variant),The J2EE application is configured to use an insufficient session ID length.,"If an attacker can guess or steal a session ID, then he/she may be able to take over the user's session (called session hijacking). The number of possible session IDs increases with increased session ID length, making it more difficult to guess or steal a session ID.",,Unknown,No description: http://www.securiteam.com/securityreviews/5TP0F0UEVQ.html
1096 CWE-600,Uncaught Exception in Servlet (Type: Base),"The Servlet does not catch all exceptions, which may reveal sensitive debugging information.","When a Servlet throws an exception, the default error response the Servlet container sends back to the user typically includes debugging information. This information is of great value to an attacker. For example, a stack trace might show the attacker a malformed SQL query string, the type of database being used, and the version of the application container. This information enables the attacker to target known vulnerabilities in these components.",,Unknown,
1097 CWE-603,Use of Client-Side Authentication (Type: Base),"A client/server product performs authentication within client code but not in server code, allowing server-side authentication to be bypassed via a modified client that omits the authentication check.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1098 CWE-605,Multiple Binds to the Same Port (Type: Base),"When multiple sockets are allowed to bind to the same port, other services on that port may be stolen or spoofed.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1099 CWE-606,Unchecked Input for Loop Condition (Type: Base),"The product does not properly check inputs that are used for loop conditions, potentially leading to a denial of service because of excessive looping.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1100 CWE-607,Public Static Final Field References Mutable Object (Type: Variant),"A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1101 CWE-608,Struts: Non-private Field in ActionForm Class (Type: Variant),"An ActionForm class contains a field that has not been declared private, which can be accessed without using a setter or getter.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1102 CWE-609,Double-Checked Locking (Type: Base),"The program uses double-checked locking to access a resource without the overhead of explicit synchronization, but the locking is insufficient.","Double-checked locking refers to the situation where a programmer checks to see if a resource has been initialized, grabs a lock, checks again to see if the resource has been initialized, and then performs the initialization if it has not occurred yet. This should not be done, as is not guaranteed to work in all languages and on all architectures. In summary, other threads may not be operating inside the synchronous block and are not guaranteed to see the operations execute in the same order as they would appear inside the synchronous block.",,Unknown,"The ""Double-Checked Locking is Broken"" Declaration: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
11031103 JSR 133 (Java Memory Model) FAQ: http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#dcl
11041104 The Art of Software Security Assessment: Chapter 13, ""Threading Vulnerabilities"", Page 815."
1105 CWE-610,EN-Externally Controlled Reference to a Resource in Another Sphere (Type: Class),The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.,,,Unknown,
1106 CWE-611,EN-Improper Restriction of XML External Entity Reference (XXE) (Type: Variant),"The software 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.","XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
1105 CWE-610,Externally Controlled Reference to a Resource in Another Sphere (Type: Class),The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.,,,Unknown,
1106 CWE-611,Improper Restriction of XML External Entity Reference (XXE) (Type: Variant),"The software 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.","XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
11071107 By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as ""file:///c:/winnt/win.ini"" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Using URIs with other schemes such as http://, the attacker can force the application to make outgoing requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions or hide the source of attacks such as port scanning.
11081108 Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g. in an error message), thereby exposing the file contents.",,Unknown,"XML External Entity (XXE) Processing: https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
11091109 XML External Entity Attacks (XXE): https://www.owasp.org/images/5/5d/XML_Exteral_Entity_Attack.pdf
11111111 XML External Entities (XXE) Attack: http://projects.webappsec.org/w/page/13247003/XML%20External%20Entities
11121112 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
11131113 Preventing XXE in PHP: http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html"
1114 CWE-612,EN-Information Exposure Through Indexing of Private Data (Type: Variant),"The product performs an indexing routine against private documents, but does not sufficiently verify that the actors who can access the index also have the privileges to access the private documents.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1115 CWE-613,EN-Insufficient Session Expiration (Type: Base),"According to WASC, ""Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.""","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1116 CWE-614,EN-Sensitive Cookie in HTTPS Session Without Secure Attribute (Type: Variant),"The Secure attribute for sensitive cookies in HTTPS sessions is not set, which could cause the user agent to send those cookies in plaintext over an HTTP session.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1117 CWE-615,EN-Information Exposure Through Comments (Type: Variant),"While adding general comments is very useful, some programmers tend to leave important data, such as: filenames related to the web application, old links or links which were not meant to be browsed by users, old code fragments, etc.","An attacker who finds these comments can map the application's structure and files, expose hidden parts of the site, and study the fragments of code to reverse engineer the application, which may help develop further attacks against the site.",,Unknown,
1118 CWE-616,EN-Incomplete Identification of Uploaded File Variables (PHP) (Type: Variant),"The PHP application uses an old method for processing uploaded files by referencing the four global variables that are set for each file (e.g. $varname, $varname_size, $varname_name, $varname_type). These variables could be overwritten by attackers, causing the application to process unauthorized files.","These global variables could be overwritten by POST requests, cookies, or other methods of populating or overwriting these variables. This could be used to read or process arbitrary files by providing values such as ""/etc/passwd"".",,Unknown,"A Study in Scarlet - section 5, ""File Upload"""
1119 CWE-617,EN-Reachable Assertion (Type: Variant),"The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.","For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.",,Unknown,
1120 CWE-618,EN-Exposed Unsafe ActiveX Method (Type: Base),"An ActiveX control is intended for use in a web browser, but it exposes dangerous methods that perform actions that are outside of the browser's security model (e.g. the zone or domain).","ActiveX controls can exercise far greater control over the operating system than typical Java or javascript. Exposed methods can be subject to various vulnerabilities, depending on the implemented behaviors of those methods, and whether input validation is performed on the provided arguments. If there is no integrity checking or origin validation, this method could be invoked by attackers.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1114 CWE-612,Information Exposure Through Indexing of Private Data (Type: Variant),"The product performs an indexing routine against private documents, but does not sufficiently verify that the actors who can access the index also have the privileges to access the private documents.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1115 CWE-613,Insufficient Session Expiration (Type: Base),"According to WASC, ""Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.""","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1116 CWE-614,Sensitive Cookie in HTTPS Session Without Secure Attribute (Type: Variant),"The Secure attribute for sensitive cookies in HTTPS sessions is not set, which could cause the user agent to send those cookies in plaintext over an HTTP session.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1117 CWE-615,Information Exposure Through Comments (Type: Variant),"While adding general comments is very useful, some programmers tend to leave important data, such as: filenames related to the web application, old links or links which were not meant to be browsed by users, old code fragments, etc.","An attacker who finds these comments can map the application's structure and files, expose hidden parts of the site, and study the fragments of code to reverse engineer the application, which may help develop further attacks against the site.",,Unknown,
1118 CWE-616,Incomplete Identification of Uploaded File Variables (PHP) (Type: Variant),"The PHP application uses an old method for processing uploaded files by referencing the four global variables that are set for each file (e.g. $varname, $varname_size, $varname_name, $varname_type). These variables could be overwritten by attackers, causing the application to process unauthorized files.","These global variables could be overwritten by POST requests, cookies, or other methods of populating or overwriting these variables. This could be used to read or process arbitrary files by providing values such as ""/etc/passwd"".",,Unknown,"A Study in Scarlet - section 5, ""File Upload"""
1119 CWE-617,Reachable Assertion (Type: Variant),"The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.","For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.",,Unknown,
1120 CWE-618,Exposed Unsafe ActiveX Method (Type: Base),"An ActiveX control is intended for use in a web browser, but it exposes dangerous methods that perform actions that are outside of the browser's security model (e.g. the zone or domain).","ActiveX controls can exercise far greater control over the operating system than typical Java or javascript. Exposed methods can be subject to various vulnerabilities, depending on the implemented behaviors of those methods, and whether input validation is performed on the provided arguments. If there is no integrity checking or origin validation, this method could be invoked by attackers.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
11211121 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
11221122 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1123 CWE-619,EN-Dangling Database Cursor (Cursor Injection) (Type: Base),"If a database cursor is not closed properly, then it could become accessible to other users while retaining the same privileges that were originally assigned, leaving the cursor ""dangling.""","For example, an improper dangling cursor could arise from unhandled exceptions. The impact of the issue depends on the cursor's role, but SQL injection attacks are commonly possible.",,Unknown,"The Oracle Hacker's Handbook
1123 CWE-619,Dangling Database Cursor (Cursor Injection) (Type: Base),"If a database cursor is not closed properly, then it could become accessible to other users while retaining the same privileges that were originally assigned, leaving the cursor ""dangling.""","For example, an improper dangling cursor could arise from unhandled exceptions. The impact of the issue depends on the cursor's role, but SQL injection attacks are commonly possible.",,Unknown,"The Oracle Hacker's Handbook
11241124 Cursor Injection: http://www.databasesecurity.com/dbsec/cursor-injection.pdf"
1125 CWE-62,EN-UNIX Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently account for when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. /etc/passwd). When the process opens the file, the attacker can assume the privileges of that process.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Hard Links"", Page 518."
1126 CWE-620,EN-Unverified Password Change (Type: Variant),"When setting a new password for a user, the product does not require knowledge of the original password, or using another form of authentication.","This could be used by an attacker to change passwords for another user, thus gaining the privileges associated with that user.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1127 CWE-621,EN-Variable Extraction Error (Type: Base),"The product uses external input to determine the names of variables into which information is extracted, without verifying that the names of the specified variables are valid. This could cause the program to overwrite unintended variables.","For example, in PHP, calling extract() or import_request_variables() without the proper arguments could allow arbitrary global variables to be overwritten, including superglobals. Similar functionality might be possible in other interpreted languages, including custom languages.",,Unknown,
1128 CWE-622,EN-Improper Validation of Function Hook Arguments (Type: Variant),"A product adds hooks to user-accessible API functions, but does not properly validate the arguments. This could lead to resultant vulnerabilities.","Such hooks can be used in defensive software that runs with privileges, such as anti-virus or firewall, which hooks kernel calls. When the arguments are not validated, they could be used to bypass the protection scheme or attack the product itself.",,Unknown,
1129 CWE-623,EN-Unsafe ActiveX Control Marked Safe For Scripting (Type: Variant),"An ActiveX control is intended for restricted use, but it has been marked as safe-for-scripting.","This might allow attackers to use dangerous functionality via a web page that accesses the control, which can lead to different resultant vulnerabilities, depending on the control's behavior.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1125 CWE-62,UNIX Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently account for when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. /etc/passwd). When the process opens the file, the attacker can assume the privileges of that process.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Hard Links"", Page 518."
1126 CWE-620,Unverified Password Change (Type: Variant),"When setting a new password for a user, the product does not require knowledge of the original password, or using another form of authentication.","This could be used by an attacker to change passwords for another user, thus gaining the privileges associated with that user.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1127 CWE-621,Variable Extraction Error (Type: Base),"The product uses external input to determine the names of variables into which information is extracted, without verifying that the names of the specified variables are valid. This could cause the program to overwrite unintended variables.","For example, in PHP, calling extract() or import_request_variables() without the proper arguments could allow arbitrary global variables to be overwritten, including superglobals. Similar functionality might be possible in other interpreted languages, including custom languages.",,Unknown,
1128 CWE-622,Improper Validation of Function Hook Arguments (Type: Variant),"A product adds hooks to user-accessible API functions, but does not properly validate the arguments. This could lead to resultant vulnerabilities.","Such hooks can be used in defensive software that runs with privileges, such as anti-virus or firewall, which hooks kernel calls. When the arguments are not validated, they could be used to bypass the protection scheme or attack the product itself.",,Unknown,
1129 CWE-623,Unsafe ActiveX Control Marked Safe For Scripting (Type: Variant),"An ActiveX control is intended for restricted use, but it has been marked as safe-for-scripting.","This might allow attackers to use dangerous functionality via a web page that accesses the control, which can lead to different resultant vulnerabilities, depending on the control's behavior.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
11301130 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
11311131 No description: http://support.microsoft.com/kb/240797
11321132 Writing Secure Code: Chapter 16, ""What ActiveX Components Are Safe for Initialization and Safe for Scripting?"" Page 510
11331133 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1134 CWE-624,EN-Executable Regular Expression Error (Type: Base),"The product uses a regular expression that either (1) contains an executable component with user-controlled inputs, or (2) allows a user to enable execution by inserting pattern modifiers.","Case (2) is possible in the PHP preg_replace() function, and possibly in other languages when a user-controlled input is inserted into a string that is later parsed as a regular expression.",,Unknown,
1135 CWE-625,EN-Permissive Regular Expression (Type: Base),The product uses a regular expression that does not sufficiently restrict the set of allowed values.,"This effectively causes the regexp to accept substrings that match the pattern, which produces a partial comparison to the target. In some cases, this can lead to other weaknesses. Common errors include:
1134 CWE-624,Executable Regular Expression Error (Type: Base),"The product uses a regular expression that either (1) contains an executable component with user-controlled inputs, or (2) allows a user to enable execution by inserting pattern modifiers.","Case (2) is possible in the PHP preg_replace() function, and possibly in other languages when a user-controlled input is inserted into a string that is later parsed as a regular expression.",,Unknown,
1135 CWE-625,Permissive Regular Expression (Type: Base),The product uses a regular expression that does not sufficiently restrict the set of allowed values.,"This effectively causes the regexp to accept substrings that match the pattern, which produces a partial comparison to the target. In some cases, this can lead to other weaknesses. Common errors include:
11361136 not identifying the beginning and end of the target string
11371137 using wildcards instead of acceptable character ranges
11381138 others",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
1139 CWE-626,EN-Null Byte Interaction Error (Poison Null Byte) (Type: Variant),The product does not properly handle null bytes or NUL characters when passing data between different representations or components.,"A null byte (NUL character) can have different meanings across representations or languages. For example, it is a string terminator in standard C libraries, but Perl and PHP strings do not treat it as a terminator. When two representations are crossed - such as when Perl or PHP invokes underlying C functionality - this can produce an interaction error with unexpected results. Similar issues have been reported for ASP. Other interpreters written in C might also be affected.",,Unknown,"Poison NULL byte: http://insecure.org/news/P55-07.txt
1139 CWE-626,Null Byte Interaction Error (Poison Null Byte) (Type: Variant),The product does not properly handle null bytes or NUL characters when passing data between different representations or components.,"A null byte (NUL character) can have different meanings across representations or languages. For example, it is a string terminator in standard C libraries, but Perl and PHP strings do not treat it as a terminator. When two representations are crossed - such as when Perl or PHP invokes underlying C functionality - this can produce an interaction error with unexpected results. Similar issues have been reported for ASP. Other interpreters written in C might also be affected.",,Unknown,"Poison NULL byte: http://insecure.org/news/P55-07.txt
11401140 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
11411141 ShAnKaR: multiple PHP application poison NULL byte vulnerability: http://seclists.org/fulldisclosure/2006/Sep/0185.html"
1142 CWE-627,EN-Dynamic Variable Evaluation (Type: Base),"In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.","The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.",,Unknown,"Dynamic Evaluation Vulnerabilities in PHP applications: http://seclists.org/fulldisclosure/2006/May/0035.html
1142 CWE-627,Dynamic Variable Evaluation (Type: Base),"In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.","The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.",,Unknown,"Dynamic Evaluation Vulnerabilities in PHP applications: http://seclists.org/fulldisclosure/2006/May/0035.html
11431143 A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications: http://www.securereality.com.au/studyinscarlet.txt"
1144 CWE-628,EN-Function Call with Incorrectly Specified Arguments (Type: Base),"The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.","There are multiple ways in which this weakness can be introduced, including:
1144 CWE-628,Function Call with Incorrectly Specified Arguments (Type: Base),"The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.","There are multiple ways in which this weakness can be introduced, including:
11451145 the wrong variable or reference;
11461146 an incorrect number of arguments;
11471147 incorrect order of arguments;
11481148 wrong type of arguments; or
11491149 wrong value.",,Unknown,
1150 CWE-636,EN-Not Failing Securely (Failing Open) (Type: Class),"When the product encounters an error condition or failure, its design requires it to fall back to a state that is less secure than other options that are available, such as selecting the weakest encryption algorithm or using the most permissive access control restrictions.","By entering a less secure state, the product inherits the weaknesses associated with that state, making it easier to compromise. At the least, it causes administrators to have a false sense of security. This weakness typically occurs as a result of wanting to ""fail functional"" to minimize administration and support costs, instead of ""failing safe.""",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1150 CWE-636,Not Failing Securely (Failing Open) (Type: Class),"When the product encounters an error condition or failure, its design requires it to fall back to a state that is less secure than other options that are available, such as selecting the weakest encryption algorithm or using the most permissive access control restrictions.","By entering a less secure state, the product inherits the weaknesses associated with that state, making it easier to compromise. At the least, it causes administrators to have a false sense of security. This weakness typically occurs as a result of wanting to ""fail functional"" to minimize administration and support costs, instead of ""failing safe.""",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11511151 Failing Securely: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/349.html"
1152 CWE-637,EN-Unnecessary Complexity in Protection Mechanism (Not Using Economy of Mechanism) (Type: Class),"The software uses a more complex mechanism than necessary, which could lead to resultant weaknesses when the mechanism is not correctly understood, modeled, configured, implemented, or used.","Security mechanisms should be as simple as possible. Complex security mechanisms may engender partial implementations and compatibility problems, with resulting mismatches in assumptions and implemented security. A corollary of this principle is that data specifications should be as simple as possible, because complex data specifications result in complex validation code. Complex tasks and systems may also need to be guarded by complex security checks, so simple systems should be preferred.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1152 CWE-637,Unnecessary Complexity in Protection Mechanism (Not Using Economy of Mechanism) (Type: Class),"The software uses a more complex mechanism than necessary, which could lead to resultant weaknesses when the mechanism is not correctly understood, modeled, configured, implemented, or used.","Security mechanisms should be as simple as possible. Complex security mechanisms may engender partial implementations and compatibility problems, with resulting mismatches in assumptions and implemented security. A corollary of this principle is that data specifications should be as simple as possible, because complex data specifications result in complex validation code. Complex tasks and systems may also need to be guarded by complex security checks, so simple systems should be preferred.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11531153 Economy of Mechanism: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/348.html"
1154 CWE-638,EN-Not Using Complete Mediation (Type: Class),"The software does not perform access checks on a resource every time the resource is accessed by an entity, which can create resultant weaknesses if that entity's rights or privileges change over time.",,,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1154 CWE-638,Not Using Complete Mediation (Type: Class),"The software does not perform access checks on a resource every time the resource is accessed by an entity, which can create resultant weaknesses if that entity's rights or privileges change over time.",,,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11551155 Complete Mediation: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/346.html"
1156 CWE-65,EN-Windows Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. AUTOEXEC.BAT). When the process opens the file, the attacker can assume the privileges of that process, or prevent the program from accurately processing data.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Links"", Page 676."
1157 CWE-651,EN-Information Exposure Through WSDL File (Type: Variant),The Web services architecture may require exposing a WSDL file that contains information on the publicly accessible services and how callers of these services should interact with them (e.g. what parameters they expect and what types they return).,"An information exposure may occur if any of the following apply:
1156 CWE-65,Windows Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. AUTOEXEC.BAT). When the process opens the file, the attacker can assume the privileges of that process, or prevent the program from accurately processing data.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Links"", Page 676."
1157 CWE-651,Information Exposure Through WSDL File (Type: Variant),The Web services architecture may require exposing a WSDL file that contains information on the publicly accessible services and how callers of these services should interact with them (e.g. what parameters they expect and what types they return).,"An information exposure may occur if any of the following apply:
11581158 The WSDL file is accessible to a wider audience than intended.
11591159 The WSDL file contains information on the methods/services that should not be publicly accessible or information about deprecated methods. This problem is made more likely due to the WSDL often being automatically generated from the code.
11601160 Information in the WSDL file helps guess names/locations of methods/resources that should not be publicly accessible.",,Unknown,
1161 CWE-653,EN-Insufficient Compartmentalization (Type: Base),"The product does not sufficiently compartmentalize functionality or processes that require different privilege levels, rights, or permissions.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1161 CWE-653,Insufficient Compartmentalization (Type: Base),"The product does not sufficiently compartmentalize functionality or processes that require different privilege levels, rights, or permissions.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11621162 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1163 CWE-654,EN-Reliance on a Single Factor in a Security Decision (Type: Base),"A protection mechanism relies exclusively, or to a large extent, on the evaluation of a single condition or the integrity of a single object or entity in order to make a decision about granting access to restricted resources or functionality.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1163 CWE-654,Reliance on a Single Factor in a Security Decision (Type: Base),"A protection mechanism relies exclusively, or to a large extent, on the evaluation of a single condition or the integrity of a single object or entity in order to make a decision about granting access to restricted resources or functionality.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11641164 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1165 CWE-655,EN-Insufficient Psychological Acceptability (Type: Base),"The software has a protection mechanism that is too difficult or inconvenient to use, encouraging non-malicious users to disable or bypass the mechanism, whether by accident or on purpose.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1165 CWE-655,Insufficient Psychological Acceptability (Type: Base),"The software has a protection mechanism that is too difficult or inconvenient to use, encouraging non-malicious users to disable or bypass the mechanism, whether by accident or on purpose.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11661166 Psychological Acceptability: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/354.html
11671167 Usability of Security: A Case Study: http://reports-archive.adm.cs.cmu.edu/anon/1998/CMU-CS-98-155.pdf
11681168 24 Deadly Sins of Software Security: ""Sin 14: Poor Usability."" Page 217"
1169 CWE-656,EN-Reliance on Security Through Obscurity (Type: Base),"The software uses a protection mechanism whose strength depends heavily on its obscurity, such that knowledge of its algorithms or key data is sufficient to defeat the mechanism.","This reliance on ""security through obscurity"" can produce resultant weaknesses if an attacker is able to reverse engineer the inner workings of the mechanism. Note that obscurity can be one small part of defense in depth, since it can create more work for an attacker; however, it is a significant risk if used as the primary means of protection.",,Unknown,"RFC: 793, TRANSMISSION CONTROL PROTOCOL: http://www.ietf.org/rfc/rfc0793.txt
1169 CWE-656,Reliance on Security Through Obscurity (Type: Base),"The software uses a protection mechanism whose strength depends heavily on its obscurity, such that knowledge of its algorithms or key data is sufficient to defeat the mechanism.","This reliance on ""security through obscurity"" can produce resultant weaknesses if an attacker is able to reverse engineer the inner workings of the mechanism. Note that obscurity can be one small part of defense in depth, since it can create more work for an attacker; however, it is a significant risk if used as the primary means of protection.",,Unknown,"RFC: 793, TRANSMISSION CONTROL PROTOCOL: http://www.ietf.org/rfc/rfc0793.txt
11701170 The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11711171 Never Assuming that Your Secrets Are Safe: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/352.html"
1172 CWE-657,EN-Violation of Secure Design Principles (Type: Class),The product violates well-established principles for secure design.,"This can introduce resultant weaknesses or make it easier for developers to introduce related weaknesses during implementation. Because code is centered around design, it can be resource-intensive to fix design problems.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1172 CWE-657,Violation of Secure Design Principles (Type: Class),The product violates well-established principles for secure design.,"This can introduce resultant weaknesses or make it easier for developers to introduce related weaknesses during implementation. Because code is centered around design, it can be resource-intensive to fix design problems.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
11731173 Design Principles: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/358.html"
1174 CWE-66,EN-Improper Handling of File Names that Identify Virtual Resources (Type: Base),"The product does not handle or incorrectly handles a file name that identifies a ""virtual"" resource that is not directly specified within the directory that is associated with the file name, causing the product to perform file-based operations on a resource that is not a file.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1175 CWE-662,EN-Improper Synchronization (Type: Base),"The software attempts to use a shared resource in an exclusive manner, but does not prevent or incorrectly prevents use of the resource by another thread or process.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1176 CWE-663,EN-Use of a Non-reentrant Function in a Concurrent Context (Type: Base),The software calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.,"Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,"Java Concurrency API: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantLock.html
1174 CWE-66,Improper Handling of File Names that Identify Virtual Resources (Type: Base),"The product does not handle or incorrectly handles a file name that identifies a ""virtual"" resource that is not directly specified within the directory that is associated with the file name, causing the product to perform file-based operations on a resource that is not a file.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1175 CWE-662,Improper Synchronization (Type: Base),"The software attempts to use a shared resource in an exclusive manner, but does not prevent or incorrectly prevents use of the resource by another thread or process.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1176 CWE-663,Use of a Non-reentrant Function in a Concurrent Context (Type: Base),The software calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.,"Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,"Java Concurrency API: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantLock.html
11771177 Use reentrant functions for safer signal handling: http://www.ibm.com/developerworks/linux/library/l-reent.html"
1178 CWE-664,EN-Improper Control of a Resource Through its Lifetime (Type: Class),"The software does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.","Resources often have explicit instructions on how to be created, used and destroyed. When software does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states.
1178 CWE-664,Improper Control of a Resource Through its Lifetime (Type: Class),"The software does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.","Resources often have explicit instructions on how to be created, used and destroyed. When software does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states.
11791179 Even without explicit instructions, various principles are expected to be adhered to, such as ""Do not use an object until after its creation is complete,"" or ""do not use an object after it has been slated for destruction.""",,Unknown,
1180 CWE-666,EN-Operation on Resource in Wrong Phase of Lifetime (Type: Base),"The software performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1181 CWE-667,EN-Improper Locking (Type: Base),"The software does not properly acquire a lock on a resource, or it does not properly release a lock on a resource, leading to unexpected resource state changes and behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1182 CWE-668,EN-Exposure of Resource to Wrong Sphere (Type: Class),"The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1180 CWE-666,Operation on Resource in Wrong Phase of Lifetime (Type: Base),"The software performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1181 CWE-667,Improper Locking (Type: Base),"The software does not properly acquire a lock on a resource, or it does not properly release a lock on a resource, leading to unexpected resource state changes and behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1182 CWE-668,Exposure of Resource to Wrong Sphere (Type: Class),"The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
11831183 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
11841184 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1185 CWE-669,EN-Incorrect Resource Transfer Between Spheres (Type: Class),"The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1185 CWE-669,Incorrect Resource Transfer Between Spheres (Type: Class),"The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
11861186 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
11871187 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1188 CWE-670,EN-Always-Incorrect Control Flow Implementation (Type: Class),"The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.","This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.",,Unknown,
1189 CWE-671,EN-Lack of Administrator Control over Security (Type: Class),The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect the environment in which the product is being used. This introduces resultant weaknesses or prevents it from operating at a level of security that is desired by the administrator.,"If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1190 CWE-672,EN-Operation on a Resource after Expiration or Release (Type: Base),"The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.","If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1191 CWE-673,EN-External Influence of Sphere Definition (Type: Class),The product does not prevent the definition of control spheres from external actors.,"Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1192 CWE-674,EN-Uncontrolled Recursion (Type: Base),"The product does not properly control the amount of recursion that takes place, which consumes excessive resources, such as allocated memory or the program stack.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1193 CWE-675,EN-Duplicate Operations on Resource (Type: Class),"The product performs the same operation on a resource two or more times, when the operation should only be applied once.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1194 CWE-683,EN-Function Call With Incorrect Order of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses.","While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers or types of arguments, such as format strings in C. It also can occur in languages or environments that do not enforce strong typing.",,Unknown,
1195 CWE-684,EN-Incorrect Provision of Specified Functionality (Type: Base),"The code does not function according to its published specifications, potentially leading to incorrect usage.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1196 CWE-685,EN-Function Call With Incorrect Number of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1197 CWE-686,EN-Function Call With Incorrect Argument Type (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that is the wrong data type, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1198 CWE-687,EN-Function Call With Incorrectly Specified Argument Value (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that contains the wrong value, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1199 CWE-688,EN-Function Call With Incorrect Variable or Reference as Argument (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1200 CWE-69,EN-Improper Handling of Windows ::DATA Alternate Data Stream (Type: Variant),"The software does not properly prevent access to, or detect usage of, alternate data streams (ADS).","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,"Windows NTFS Alternate Data Streams: http://www.securityfocus.com/infocus/1822
1188 CWE-670,Always-Incorrect Control Flow Implementation (Type: Class),"The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.","This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.",,Unknown,
1189 CWE-671,Lack of Administrator Control over Security (Type: Class),The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect the environment in which the product is being used. This introduces resultant weaknesses or prevents it from operating at a level of security that is desired by the administrator.,"If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1190 CWE-672,Operation on a Resource after Expiration or Release (Type: Base),"The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.","If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1191 CWE-673,External Influence of Sphere Definition (Type: Class),The product does not prevent the definition of control spheres from external actors.,"Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1192 CWE-674,Uncontrolled Recursion (Type: Base),"The product does not properly control the amount of recursion that takes place, which consumes excessive resources, such as allocated memory or the program stack.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1193 CWE-675,Duplicate Operations on Resource (Type: Class),"The product performs the same operation on a resource two or more times, when the operation should only be applied once.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1194 CWE-683,Function Call With Incorrect Order of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses.","While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers or types of arguments, such as format strings in C. It also can occur in languages or environments that do not enforce strong typing.",,Unknown,
1195 CWE-684,Incorrect Provision of Specified Functionality (Type: Base),"The code does not function according to its published specifications, potentially leading to incorrect usage.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1196 CWE-685,Function Call With Incorrect Number of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1197 CWE-686,Function Call With Incorrect Argument Type (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that is the wrong data type, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1198 CWE-687,Function Call With Incorrectly Specified Argument Value (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that contains the wrong value, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1199 CWE-688,Function Call With Incorrect Variable or Reference as Argument (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1200 CWE-69,Improper Handling of Windows ::DATA Alternate Data Stream (Type: Variant),"The software does not properly prevent access to, or detect usage of, alternate data streams (ADS).","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,"Windows NTFS Alternate Data Streams: http://www.securityfocus.com/infocus/1822
12011201 Writing Secure Code"
1202 CWE-691,EN-Insufficient Control Flow Management (Type: Class),"The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,
1203 CWE-693,EN-Protection Mechanism Failure (Type: Class),The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.,"This weakness covers three distinct situations. A ""missing"" protection mechanism occurs when the application does not define any mechanism against a certain class of attack. An ""insufficient"" protection mechanism might provide some defenses - for example, against the most common attacks - but it does not protect against everything that is intended. Finally, an ""ignored"" mechanism occurs when a mechanism is available and in active use within the product, but the developer has not applied it in some code path.",,Unknown,
1204 CWE-694,EN-Use of Multiple Resources with Duplicate Identifier (Type: Base),"The software uses multiple resources that can have the same identifier, in a context in which unique identifiers are required.","If the software assumes that each resource has a unique identifier, the software could operate on the wrong resource if attackers can cause multiple resources to be associated with the same identifier.",,Unknown,
1205 CWE-695,EN-Use of Low-Level Functionality (Type: Base),The software uses low-level functionality that is explicitly prohibited by the framework or specification under which the software is supposed to operate.,"The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1206 CWE-696,EN-Incorrect Behavior Order (Type: Class),"The software performs multiple related behaviors, but the behaviors are performed in the wrong order in ways which may produce resultant weaknesses.","The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1207 CWE-697,EN-Insufficient Comparison (Type: Class),"The software compares two entities in a security-relevant context, but the comparison is insufficient, which may lead to resultant weaknesses.","This weakness class covers several possibilities:
1202 CWE-691,Insufficient Control Flow Management (Type: Class),"The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,
1203 CWE-693,Protection Mechanism Failure (Type: Class),The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.,"This weakness covers three distinct situations. A ""missing"" protection mechanism occurs when the application does not define any mechanism against a certain class of attack. An ""insufficient"" protection mechanism might provide some defenses - for example, against the most common attacks - but it does not protect against everything that is intended. Finally, an ""ignored"" mechanism occurs when a mechanism is available and in active use within the product, but the developer has not applied it in some code path.",,Unknown,
1204 CWE-694,Use of Multiple Resources with Duplicate Identifier (Type: Base),"The software uses multiple resources that can have the same identifier, in a context in which unique identifiers are required.","If the software assumes that each resource has a unique identifier, the software could operate on the wrong resource if attackers can cause multiple resources to be associated with the same identifier.",,Unknown,
1205 CWE-695,Use of Low-Level Functionality (Type: Base),The software uses low-level functionality that is explicitly prohibited by the framework or specification under which the software is supposed to operate.,"The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1206 CWE-696,Incorrect Behavior Order (Type: Class),"The software performs multiple related behaviors, but the behaviors are performed in the wrong order in ways which may produce resultant weaknesses.","The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1207 CWE-697,Insufficient Comparison (Type: Class),"The software compares two entities in a security-relevant context, but the comparison is insufficient, which may lead to resultant weaknesses.","This weakness class covers several possibilities:
12081208 the comparison checks one factor incorrectly;
12091209 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,
1210 CWE-698,EN-Execution After Redirect (EAR) (Type: Base),"The web application sends a redirect to another location, but instead of exiting, it executes additional code.","This weakness class covers several possibilities:
1210 CWE-698,Execution After Redirect (EAR) (Type: Base),"The web application sends a redirect to another location, but instead of exiting, it executes additional code.","This weakness class covers several possibilities:
12111211 the comparison checks one factor incorrectly;
12121212 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,Fear the EAR: Discovering and Mitigating Execution After Redirect Vulnerabilities: http://cs.ucsb.edu/~bboe/public/pubs/fear-the-ear-ccs2011.pdf
1213 CWE-7,EN-J2EE Misconfiguration: Missing Custom Error Page (Type: Variant),The default error page of a web application should not display sensitive information about the software system.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,19 Deadly Sins of Software Security
1214 CWE-703,EN-Improper Check or Handling of Exceptional Conditions (Type: Class),The software does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the software.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,"A Taxonomy of Security Faults in the UNIX Operating System: http://ftp.cerias.purdue.edu/pub/papers/taimur-aslam/aslam-taxonomy-msthesis.pdf
1213 CWE-7,J2EE Misconfiguration: Missing Custom Error Page (Type: Variant),The default error page of a web application should not display sensitive information about the software system.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,19 Deadly Sins of Software Security
1214 CWE-703,Improper Check or Handling of Exceptional Conditions (Type: Class),The software does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the software.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,"A Taxonomy of Security Faults in the UNIX Operating System: http://ftp.cerias.purdue.edu/pub/papers/taimur-aslam/aslam-taxonomy-msthesis.pdf
12151215 Use of A Taxonomy of Security Faults: http://csrc.nist.gov/nissc/1996/papers/NISSC96/paper057/PAPER.PDF
12161216 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
1217 CWE-704,EN-Incorrect Type Conversion or Cast (Type: Class),"The software does not correctly convert an object, resource or structure from one type to a different type.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1218 CWE-705,EN-Incorrect Control Flow Scoping (Type: Class),The software does not properly return control flow to the proper location after it has completed a task or detected an unusual condition.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1219 CWE-706,EN-Use of Incorrectly-Resolved Name or Reference (Type: Class),"The software uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1220 CWE-707,EN-Improper Enforcement of Message or Data Structure (Type: Class),The software does not enforce or incorrectly enforces that structured messages or data are well-formed before being read from an upstream component or sent to a downstream component.,"If a message is malformed it may cause the message to be incorrectly interpreted.
1217 CWE-704,Incorrect Type Conversion or Cast (Type: Class),"The software does not correctly convert an object, resource or structure from one type to a different type.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1218 CWE-705,Incorrect Control Flow Scoping (Type: Class),The software does not properly return control flow to the proper location after it has completed a task or detected an unusual condition.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1219 CWE-706,Use of Incorrectly-Resolved Name or Reference (Type: Class),"The software uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1220 CWE-707,Improper Enforcement of Message or Data Structure (Type: Class),The software does not enforce or incorrectly enforces that structured messages or data are well-formed before being read from an upstream component or sent to a downstream component.,"If a message is malformed it may cause the message to be incorrectly interpreted.
12211221 This weakness typically applies in cases where the product prepares a control message that another process must act on, such as a command or query, and malicious input that was intended as data, can enter the control plane instead. However, this weakness also applies to more general cases where there are not always control implications.",,Unknown,
1222 CWE-708,EN-Incorrect Ownership Assignment (Type: Base),"The software assigns an owner to a resource, but the owner is outside of the intended control sphere.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1223 CWE-71,EN-Apple .DS_Store (Type: Variant),"Software operating in a MAC OS environment, where .DS_Store is in effect, must carefully manage hard links, otherwise an attacker may be able to leverage a hard link from .DS_Store to overwrite arbitrary files and gain privileges.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1224 CWE-710,EN-Coding Standards Violation (Type: Class),"The software does not follow certain coding rules for development, which can lead to resultant weaknesses or increase the severity of the associated vulnerabilities.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1225 CWE-72,EN-Improper Handling of Apple HFS+ Alternate Data Stream Path (Type: Variant),The software does not properly handle special paths that may identify the data or resource fork of a file on the HFS+ file system.,"If the software chooses actions to take based on the file name, then if an attacker provides the data or resource fork, the software may take unexpected actions. Further, if the software intends to restrict access to a file, then an attacker might still be able to bypass intended access restrictions by requesting the data or resource fork for that file.",,Unknown,No description: http://docs.info.apple.com/article.html?artnum=300422
1226 CWE-733,EN-Compiler Optimization Removal or Modification of Security-critical Code (Type: Base),The developer builds a security-critical protection mechanism into the software but the compiler optimizes the program such that the mechanism is removed or modified.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322"
1227 CWE-75,EN-Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) (Type: Class),The software does not adequately filter user-controlled input for special elements with control implications.,"This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
1222 CWE-708,Incorrect Ownership Assignment (Type: Base),"The software assigns an owner to a resource, but the owner is outside of the intended control sphere.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1223 CWE-71,Apple .DS_Store (Type: Variant),"Software operating in a MAC OS environment, where .DS_Store is in effect, must carefully manage hard links, otherwise an attacker may be able to leverage a hard link from .DS_Store to overwrite arbitrary files and gain privileges.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1224 CWE-710,Coding Standards Violation (Type: Class),"The software does not follow certain coding rules for development, which can lead to resultant weaknesses or increase the severity of the associated vulnerabilities.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1225 CWE-72,Improper Handling of Apple HFS+ Alternate Data Stream Path (Type: Variant),The software does not properly handle special paths that may identify the data or resource fork of a file on the HFS+ file system.,"If the software chooses actions to take based on the file name, then if an attacker provides the data or resource fork, the software may take unexpected actions. Further, if the software intends to restrict access to a file, then an attacker might still be able to bypass intended access restrictions by requesting the data or resource fork for that file.",,Unknown,No description: http://docs.info.apple.com/article.html?artnum=300422
1226 CWE-733,Compiler Optimization Removal or Modification of Security-critical Code (Type: Base),The developer builds a security-critical protection mechanism into the software but the compiler optimizes the program such that the mechanism is removed or modified.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322"
1227 CWE-75,Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) (Type: Class),The software does not adequately filter user-controlled input for special elements with control implications.,"This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
12281228 The exposure can occur in a few different ways:
12291229 1) The function/method was never intended to be exposed to outside actors.
12301230 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Unknown,
1231 CWE-756,EN-Missing Custom Error Page (Type: Class),"The software does not return custom error pages to the user, possibly exposing sensitive information.","The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
1231 CWE-756,Missing Custom Error Page (Type: Class),"The software does not return custom error pages to the user, possibly exposing sensitive information.","The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
12321232 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Unknown,
1233 CWE-757,EN-Selection of Less-Secure Algorithm During Negotiation (Algorithm Downgrade) (Type: Class),"A protocol or its implementation supports interaction between multiple actors and allows those actors to negotiate which algorithm should be used as a protection mechanism such as encryption or authentication, but it does not select the strongest algorithm that is available to both parties.","When a security mechanism can be forced to downgrade to use a less secure algorithm, this can make it easier for attackers to compromise the software by exploiting weaker algorithm. The victim might not be aware that the less secure algorithm is being used. For example, if an attacker can force a communications channel to use cleartext instead of strongly-encrypted data, then the attacker could read the channel by sniffing, instead of going through extra effort of trying to decrypt the data using brute force techniques.",,Unknown,
1234 CWE-758,"EN-Reliance on Undefined, Unspecified, or Implementation-Defined Behavior (Type: Class)","The software uses an API function, data structure, or other entity in a way that relies on properties that are not always guaranteed to hold for that entity.","This can lead to resultant weaknesses when the required properties change, such as when the software is ported to a different platform or if an interaction error (CWE-435) occurs.",,Unknown,
1235 CWE-759,EN-Use of a One-Way Hash without a Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.
1233 CWE-757,Selection of Less-Secure Algorithm During Negotiation (Algorithm Downgrade) (Type: Class),"A protocol or its implementation supports interaction between multiple actors and allows those actors to negotiate which algorithm should be used as a protection mechanism such as encryption or authentication, but it does not select the strongest algorithm that is available to both parties.","When a security mechanism can be forced to downgrade to use a less secure algorithm, this can make it easier for attackers to compromise the software by exploiting weaker algorithm. The victim might not be aware that the less secure algorithm is being used. For example, if an attacker can force a communications channel to use cleartext instead of strongly-encrypted data, then the attacker could read the channel by sniffing, instead of going through extra effort of trying to decrypt the data using brute force techniques.",,Unknown,
1234 CWE-758,"Reliance on Undefined, Unspecified, or Implementation-Defined Behavior (Type: Class)","The software uses an API function, data structure, or other entity in a way that relies on properties that are not always guaranteed to hold for that entity.","This can lead to resultant weaknesses when the required properties change, such as when the software is ported to a different platform or if an interaction error (CWE-435) occurs.",,Unknown,
1235 CWE-759,Use of a One-Way Hash without a Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.
12361236 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
12371237 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
12381238 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
12501250 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
12511251 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
12521252 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1253 CWE-760,EN-Use of a One-Way Hash with a Predictable Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software uses a predictable salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables, effectively disabling the protection that an unpredictable salt would provide.
1253 CWE-760,Use of a One-Way Hash with a Predictable Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software uses a predictable salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables, effectively disabling the protection that an unpredictable salt would provide.
12541254 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
12551255 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
12561256 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
12681268 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
12691269 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
12701270 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1271 CWE-761,EN-Free of Pointer not at Start of Buffer (Type: Variant),"The application calls free() on a pointer to a memory resource that was allocated on the heap, but the pointer is not at the start of the buffer.","This can cause the application to crash, or in some cases, modify critical program variables or execute code.
1271 CWE-761,Free of Pointer not at Start of Buffer (Type: Variant),"The application calls free() on a pointer to a memory resource that was allocated on the heap, but the pointer is not at the start of the buffer.","This can cause the application to crash, or in some cases, modify critical program variables or execute code.
12721272 This weakness often occurs when the memory is allocated explicitly on the heap with one of the malloc() family functions and free() is called, but pointer arithmetic has caused the pointer to be in the interior or end of the buffer.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
12731273 Valgrind: http://valgrind.org/"
1274 CWE-763,EN-Release of Invalid Pointer or Reference (Type: Base),"The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly.","This weakness can take several forms, such as:
1274 CWE-763,Release of Invalid Pointer or Reference (Type: Base),"The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly.","This weakness can take several forms, such as:
12751275 The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
12761276 The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
12771277 Valgrind: http://valgrind.org/"
1278 CWE-764,EN-Multiple Locks of a Critical Resource (Type: Variant),"The software locks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly locks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra locking calls will reduce the size of the total available pool, possibly leading to degraded performance or a denial of service. If this can be triggered by an attacker, it will be similar to an unrestricted lock (CWE-412). In the context of a binary lock, it is likely that any duplicate locking attempts will never succeed since the lock is already held and progress may not be possible.",,Unknown,
1279 CWE-765,EN-Multiple Unlocks of a Critical Resource (Type: Variant),"The software unlocks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Unknown,
1280 CWE-785,EN-Use of Path Manipulation Function without Maximum-sized Buffer (Type: Variant),"The software invokes a function for normalizing paths or file names, but it provides an output buffer that is smaller than the maximum possible size, such as PATH_MAX.","Passing an inadequately-sized output buffer to a path manipulation function can result in a buffer overflow. Such functions include realpath(), readlink(), PathAppend(), and others.",,Unknown,
1281 CWE-786,EN-Access of Memory Location Before Start of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Unknown,
1282 CWE-787,EN-Out-of-bounds Write (Type: Base),"The software writes data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,
1283 CWE-788,EN-Access of Memory Location After End of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location after the end of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Unknown,
1284 CWE-790,EN-Improper Filtering of Special Elements (Type: Class),"The software receives data from an upstream component, but does not filter or incorrectly filters special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1278 CWE-764,Multiple Locks of a Critical Resource (Type: Variant),"The software locks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly locks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra locking calls will reduce the size of the total available pool, possibly leading to degraded performance or a denial of service. If this can be triggered by an attacker, it will be similar to an unrestricted lock (CWE-412). In the context of a binary lock, it is likely that any duplicate locking attempts will never succeed since the lock is already held and progress may not be possible.",,Unknown,
1279 CWE-765,Multiple Unlocks of a Critical Resource (Type: Variant),"The software unlocks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Unknown,
1280 CWE-785,Use of Path Manipulation Function without Maximum-sized Buffer (Type: Variant),"The software invokes a function for normalizing paths or file names, but it provides an output buffer that is smaller than the maximum possible size, such as PATH_MAX.","Passing an inadequately-sized output buffer to a path manipulation function can result in a buffer overflow. Such functions include realpath(), readlink(), PathAppend(), and others.",,Unknown,
1281 CWE-786,Access of Memory Location Before Start of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Unknown,
1282 CWE-787,Out-of-bounds Write (Type: Base),"The software writes data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,
1283 CWE-788,Access of Memory Location After End of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location after the end of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Unknown,
1284 CWE-790,Improper Filtering of Special Elements (Type: Class),"The software receives data from an upstream component, but does not filter or incorrectly filters special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
12851285 1. Untrusted data enters a web application, typically from a web request.
12861286 2. The web application dynamically generates a web page that contains this untrusted data.
12871287 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
12941294 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
12951295 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
12961296 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1297 CWE-791,EN-Incomplete Filtering of Special Elements (Type: Base),"The software receives data from an upstream component, but does not completely filter special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1297 CWE-791,Incomplete Filtering of Special Elements (Type: Base),"The software receives data from an upstream component, but does not completely filter special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
12981298 1. Untrusted data enters a web application, typically from a web request.
12991299 2. The web application dynamically generates a web page that contains this untrusted data.
13001300 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
13071307 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
13081308 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
13091309 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1310 CWE-792,EN-Incomplete Filtering of One or More Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not completely filter one or more instances of special elements before sending it to a downstream component.","Incomplete filtering of this nature involves either
1310 CWE-792,Incomplete Filtering of One or More Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not completely filter one or more instances of special elements before sending it to a downstream component.","Incomplete filtering of this nature involves either
13111311 only filtering a single instance of a special element when more exist, or
13121312 not filtering all instances or all elements where multiple special elements exist.",,Unknown,
1313 CWE-793,EN-Only Filtering One Instance of a Special Element (Type: Variant),"The software receives data from an upstream component, but only filters a single instance of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be location-dependent, as in only the first or last element is filtered.",,Unknown,
1314 CWE-794,EN-Incomplete Filtering of Multiple Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not filter all instances of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be applied to
1313 CWE-793,Only Filtering One Instance of a Special Element (Type: Variant),"The software receives data from an upstream component, but only filters a single instance of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be location-dependent, as in only the first or last element is filtered.",,Unknown,
1314 CWE-794,Incomplete Filtering of Multiple Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not filter all instances of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be applied to
13151315 sequential elements (special elements that appear next to each other) or
13161316 non-sequential elements (special elements that appear multiple times in different locations).",,Unknown,
1317 CWE-795,EN-Only Filtering Special Elements at a Specified Location (Type: Base),"The software receives data from an upstream component, but only accounts for special elements at a specified location, thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1317 CWE-795,Only Filtering Special Elements at a Specified Location (Type: Base),"The software receives data from an upstream component, but only accounts for special elements at a specified location, thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
13181318 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
13191319 at an absolute position (e.g. ""byte number 10"").
13201320 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1321 CWE-796,EN-Only Filtering Special Elements Relative to a Marker (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements positioned relative to a marker (e.g. ""at the beginning/end of a string; the second argument""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1321 CWE-796,Only Filtering Special Elements Relative to a Marker (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements positioned relative to a marker (e.g. ""at the beginning/end of a string; the second argument""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
13221322 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
13231323 at an absolute position (e.g. ""byte number 10"").
13241324 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1325 CWE-797,EN-Only Filtering Special Elements at an Absolute Position (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. ""byte number 10""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1325 CWE-797,Only Filtering Special Elements at an Absolute Position (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. ""byte number 10""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
13261326 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
13271327 at an absolute position (e.g. ""byte number 10"").
13281328 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1329 CWE-799,EN-Improper Control of Interaction Frequency (Type: Class),"The software does not properly limit the number or frequency of interactions that it has with an actor, such as the number of incoming requests.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
1330 CWE-8,EN-J2EE Misconfiguration: Entity Bean Declared Remote (Type: Variant),"When an application exposes a remote interface for an entity bean, it might also expose methods that get or set the bean's data. These methods could be leveraged to read sensitive information, or to change data in ways that violate the application's expectations, potentially leading to other vulnerabilities.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,
1331 CWE-81,EN-Improper Neutralization of Script in an Error Message Web Page (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page.","Error pages may include customized 403 Forbidden or 404 Not Found pages.
1329 CWE-799,Improper Control of Interaction Frequency (Type: Class),"The software does not properly limit the number or frequency of interactions that it has with an actor, such as the number of incoming requests.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
1330 CWE-8,J2EE Misconfiguration: Entity Bean Declared Remote (Type: Variant),"When an application exposes a remote interface for an entity bean, it might also expose methods that get or set the bean's data. These methods could be leveraged to read sensitive information, or to change data in ways that violate the application's expectations, potentially leading to other vulnerabilities.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,
1331 CWE-81,Improper Neutralization of Script in an Error Message Web Page (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page.","Error pages may include customized 403 Forbidden or 404 Not Found pages.
13321332 When an attacker can trigger an error that contains unneutralized input, then cross-site scripting attacks may be possible.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
1333 CWE-82,EN-Improper Neutralization of Script in Attributes of IMG Tags in a Web Page (Type: Variant),"The web application does not neutralize or incorrectly neutralizes scripting elements within attributes of HTML IMG tags, such as the src attribute.","Attackers can embed XSS exploits into the values for IMG attributes (e.g. SRC) that is streamed and then executed in a victim's browser. Note that when the page is loaded into a user's browsers, the exploit will automatically execute.",,Unknown,
1334 CWE-820,EN-Missing Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but does not attempt to synchronize access to the resource.,"If access to a shared resource is not synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1335 CWE-821,EN-Incorrect Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but it does not correctly synchronize access to the resource.,"If access to a shared resource is not correctly synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1336 CWE-822,EN-Untrusted Pointer Dereference (Type: Base),"The program obtains a value from an untrusted source, converts this value to a pointer, and dereferences the resulting pointer.","An attacker can supply a pointer for memory locations that the program is not expecting. If the pointer is dereferenced for a write operation, the attack might allow modification of critical program state variables, cause a crash, or execute code. If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash, or set a program variable to an unexpected value (since the value will be read from an unexpected memory location).
1333 CWE-82,Improper Neutralization of Script in Attributes of IMG Tags in a Web Page (Type: Variant),"The web application does not neutralize or incorrectly neutralizes scripting elements within attributes of HTML IMG tags, such as the src attribute.","Attackers can embed XSS exploits into the values for IMG attributes (e.g. SRC) that is streamed and then executed in a victim's browser. Note that when the page is loaded into a user's browsers, the exploit will automatically execute.",,Unknown,
1334 CWE-820,Missing Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but does not attempt to synchronize access to the resource.,"If access to a shared resource is not synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1335 CWE-821,Incorrect Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but it does not correctly synchronize access to the resource.,"If access to a shared resource is not correctly synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1336 CWE-822,Untrusted Pointer Dereference (Type: Base),"The program obtains a value from an untrusted source, converts this value to a pointer, and dereferences the resulting pointer.","An attacker can supply a pointer for memory locations that the program is not expecting. If the pointer is dereferenced for a write operation, the attack might allow modification of critical program state variables, cause a crash, or execute code. If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash, or set a program variable to an unexpected value (since the value will be read from an unexpected memory location).
13371337 There are several variants of this weakness, including but not necessarily limited to:
13381338 The untrusted value is directly invoked as a function call.
13391339 In OS kernels or drivers where there is a boundary between ""userland"" and privileged memory spaces, an untrusted pointer might enter through an API or system call (see CWE-781 for one such example).
13401340 Inadvertently accepting the value from an untrusted control sphere when it did not have to be accepted as input at all. This might occur when the code was originally developed to be run by a single user in a non-networked environment, and the code is then ported to or otherwise exposed to a networked environment.",,Unknown,
1341 CWE-823,EN-Use of Out-of-range Pointer Offset (Type: Base),"The program performs pointer arithmetic on a valid pointer, but it uses an offset that can point outside of the intended range of valid memory locations for the resulting pointer.","While a pointer can contain a reference to any arbitrary memory location, a program typically only intends to use the pointer to access limited portions of memory, such as contiguous memory used to access an individual array.
1341 CWE-823,Use of Out-of-range Pointer Offset (Type: Base),"The program performs pointer arithmetic on a valid pointer, but it uses an offset that can point outside of the intended range of valid memory locations for the resulting pointer.","While a pointer can contain a reference to any arbitrary memory location, a program typically only intends to use the pointer to access limited portions of memory, such as contiguous memory used to access an individual array.
13421342 Programs may use offsets in order to access fields or sub-elements stored within structured data. The offset might be out-of-range if it comes from an untrusted source, is the result of an incorrect calculation, or occurs because of another error.
13431343 If an attacker can control or influence the offset so that it points outside of the intended boundaries of the structure, then the attacker may be able to read or write to memory locations that are used elsewhere in the program. As a result, the attack might change the state of the software as accessed through program variables, cause a crash or instable behavior, and possibly lead to code execution.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
1344 CWE-824,EN-Access of Uninitialized Pointer (Type: Base),The program accesses or uses a pointer that has not been initialized.,"If the pointer contains an uninitialized value, then the value might not point to a valid memory location. This could cause the program to read from or write to unexpected memory locations, leading to a denial of service. If the uninitialized pointer is used as a function call, then arbitrary functions could be invoked. If an attacker can influence the portion of uninitialized memory that is contained in the pointer, this weakness could be leveraged to execute code or perform other attacks.
1344 CWE-824,Access of Uninitialized Pointer (Type: Base),The program accesses or uses a pointer that has not been initialized.,"If the pointer contains an uninitialized value, then the value might not point to a valid memory location. This could cause the program to read from or write to unexpected memory locations, leading to a denial of service. If the uninitialized pointer is used as a function call, then arbitrary functions could be invoked. If an attacker can influence the portion of uninitialized memory that is contained in the pointer, this weakness could be leveraged to execute code or perform other attacks.
13451345 Depending on memory layout, associated memory management behaviors, and program operation, the attacker might be able to influence the contents of the uninitialized pointer, thus gaining more fine-grained control of the memory location to be accessed.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
1346 CWE-825,EN-Expired Pointer Dereference (Type: Base),"The program dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.","When a program releases memory, but it maintains a pointer to that memory, then the memory might be re-allocated at a later time. If the original pointer is accessed to read or write data, then this could cause the program to read or modify data that is in use by a different function or process. Depending on how the newly-allocated memory is used, this could lead to a denial of service, information exposure, or code execution.",,Unknown,
1347 CWE-826,EN-Premature Release of Resource During Expected Lifetime (Type: Base),The program releases a resource that is still intended to be used by the program itself or another actor.,"This weakness focuses on errors in which the program should not release a resource, but performs the release anyway. This is different than a weakness in which the program releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weaknesses, the resource should still be valid upon the subsequent access.
1346 CWE-825,Expired Pointer Dereference (Type: Base),"The program dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.","When a program releases memory, but it maintains a pointer to that memory, then the memory might be re-allocated at a later time. If the original pointer is accessed to read or write data, then this could cause the program to read or modify data that is in use by a different function or process. Depending on how the newly-allocated memory is used, this could lead to a denial of service, information exposure, or code execution.",,Unknown,
1347 CWE-826,Premature Release of Resource During Expected Lifetime (Type: Base),The program releases a resource that is still intended to be used by the program itself or another actor.,"This weakness focuses on errors in which the program should not release a resource, but performs the release anyway. This is different than a weakness in which the program releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weaknesses, the resource should still be valid upon the subsequent access.
13481348 When a program releases a resource that is still being used, it is possible that operations will still be taken on this resource, which may have been repurposed in the meantime, leading to issues similar to CWE-825. Consequences may include denial of service, information exposure, or code execution.",,Unknown,
1349 CWE-827,EN-Improper Control of Document Type Definition (Type: Base),"The software does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the software to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker.","As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content.
1349 CWE-827,Improper Control of Document Type Definition (Type: Base),"The software does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the software to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker.","As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content.
13501350 For example, the SOAP specification prohibits SOAP messages from containing DTDs.",,Unknown,Apache CXF Security Advisory (CVE-2010-2076): http://svn.apache.org/repos/asf/cxf/trunk/security/CVE-2010-2076.pdf
1351 CWE-828,EN-Signal Handler with Functionality that is not Asynchronous-Safe (Type: Base),"The software defines a signal handler that contains code sequences that are not asynchronous-safe, i.e., the functionality is not reentrant, or it can be interrupted.","This can lead to an unexpected system state with a variety of potential consequences depending on context, including denial of service and code execution.
1351 CWE-828,Signal Handler with Functionality that is not Asynchronous-Safe (Type: Base),"The software defines a signal handler that contains code sequences that are not asynchronous-safe, i.e., the functionality is not reentrant, or it can be interrupted.","This can lead to an unexpected system state with a variety of potential consequences depending on context, including denial of service and code execution.
13521352 Signal handlers are typically intended to interrupt normal functionality of a program, or even other signals, in order to notify the process of an event. When a signal handler uses global or static variables, or invokes functions that ultimately depend on such state or its associated metadata, then it could corrupt system state that is being used by normal functionality. This could subject the program to race conditions or other weaknesses that allow an attacker to cause the program state to be corrupted. While denial of service is frequently the consequence, in some cases this weakness could be leveraged for code execution.
13531353 There are several different scenarios that introduce this issue:
13541354 Invocation of non-reentrant functions from within the handler. One example is malloc(), which modifies internal global variables as it manages memory. Very few functions are actually reentrant.
13571357 Note that in some environments or contexts, it might be possible for the signal handler to be interrupted itself.
13581358 If both a signal handler and the normal behavior of the software have to operate on the same set of state variables, and a signal is received in the middle of the normal execution's modifications of those variables, the variables may be in an incorrect or corrupt state during signal handler execution, and possibly still incorrect or corrupt upon return.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
13591359 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1360 CWE-829,EN-Inclusion of Functionality from Untrusted Control Sphere (Type: Class),"The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1360 CWE-829,Inclusion of Functionality from Untrusted Control Sphere (Type: Class),"The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
13611361 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
13621362 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
1363 CWE-83,EN-Improper Neutralization of Script in Attributes in a Web Page (Type: Variant),"The software does not neutralize or incorrectly neutralizes ""javascript:"" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1363 CWE-83,Improper Neutralization of Script in Attributes in a Web Page (Type: Variant),"The software does not neutralize or incorrectly neutralizes ""javascript:"" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
13641364 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,
1365 CWE-830,EN-Inclusion of Web Functionality from an Untrusted Source (Type: Base),"The software includes web functionality (such as a web widget) from another domain, which causes it to operate within the domain of the software, potentially granting total access and control of the software to the untrusted source.","Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
1365 CWE-830,Inclusion of Web Functionality from an Untrusted Source (Type: Base),"The software includes web functionality (such as a web widget) from another domain, which causes it to operate within the domain of the software, potentially granting total access and control of the software to the untrusted source.","Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
13661366 Even if the third party is a trusted source, the software may still be exposed to attacks and malicious behavior if that trusted source is compromised, or if the code is modified in transmission from the third party to the software.
13671367 This weakness is common in ""mashup"" development on the web, which may include source functionality from other domains. For example, Javascript-based web widgets may be inserted by using '<SCRIPT SRC=""http://other.domain.here"">' tags, which causes the code to run in the domain of the software, not the remote site from which the widget was loaded. As a result, the included code has access to the local DOM, including cookies and other data that the developer might not want the remote site to be able to access.
13681368 Such dependencies may be desirable, or even required, but sometimes programmers are not aware that a dependency exists.",,Unknown,Third-Party Web Widget Security FAQ: http://jeremiahgrossman.blogspot.com/2010/07/third-party-web-widget-security-faq.html
1369 CWE-831,EN-Signal Handler Function Associated with Multiple Signals (Type: Base),The software defines a function that is used as a handler for more than one signal.,"While sometimes intentional and safe, when the same function is used to handle multiple signals, a race condition could occur if the function uses any state outside of its local declaration, such as global variables or non-reentrant functions, or has any side effects.
1369 CWE-831,Signal Handler Function Associated with Multiple Signals (Type: Base),The software defines a function that is used as a handler for more than one signal.,"While sometimes intentional and safe, when the same function is used to handle multiple signals, a race condition could occur if the function uses any state outside of its local declaration, such as global variables or non-reentrant functions, or has any side effects.
13701370 An attacker could send one signal that invokes the handler function; in many OSes, this will typically prevent the same signal from invoking the handler again, at least until the handler function has completed execution. However, the attacker could then send a different signal that is associated with the same handler function. This could interrupt the original handler function while it is still executing. If there is shared state, then the state could be corrupted. This can lead to a variety of potential consequences depending on context, including denial of service and code execution.
13711371 Another rarely-explored possibility arises when the signal handler is only designed to be executed once (if at all). By sending multiple signals, an attacker could invoke the function more than once. This may generate extra, unintended side effects. A race condition might not even be necessary; the attacker could send one signal, wait until it is handled, then send the other signal.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
13721372 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1373 CWE-832,EN-Unlock of a Resource that is not Locked (Type: Base),The software attempts to unlock a resource that is not locked.,"Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,
1374 CWE-833,EN-Deadlock (Type: Base),"The software contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in deadlock.","Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,"The Art of Software Security Assessment: Chapter 13, ""Synchronization Problems"" / ""Starvation and Deadlocks"", Page 760
1373 CWE-832,Unlock of a Resource that is not Locked (Type: Base),The software attempts to unlock a resource that is not locked.,"Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,
1374 CWE-833,Deadlock (Type: Base),"The software contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in deadlock.","Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,"The Art of Software Security Assessment: Chapter 13, ""Synchronization Problems"" / ""Starvation and Deadlocks"", Page 760
13751375 The Art of Software Security Assessment: Chapter 13, ""Starvation and Deadlocks"", Page 760.
13761376 Secure Coding in C and C++: Chapter 7, ""Concurrency"", section ""Mutual Exclusion and Deadlock"", Page 248."
1377 CWE-834,EN-Excessive Iteration (Type: Base),The software performs an iteration or loop without sufficiently limiting the number of times that the loop is executed.,"If the iteration can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory. In many cases, a loop does not need to be infinite in order to cause enough resource consumption to adversely affect the software or its host system; it depends on the amount of resources consumed per iteration.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1378 CWE-835,EN-Loop with Unreachable Exit Condition (Infinite Loop) (Type: Base),"The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.","If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1379 CWE-836,EN-Use of Password Hash Instead of Password for Authentication (Type: Base),"The software records password hashes in a data store, receives a hash of a password from a client, and compares the supplied hash to the hash obtained from the data store.","Some authentication mechanisms rely on the client to generate the hash for a password, possibly to reduce load on the server or avoid sending the password across the network. However, when the client is used to generate the hash, an attacker can bypass the authentication by obtaining a copy of the hash, e.g. by using SQL injection to compromise a database of authentication credentials, or by exploiting an information exposure. The attacker could then use a modified client to replay the stolen hash without having knowledge of the original password.
1377 CWE-834,Excessive Iteration (Type: Base),The software performs an iteration or loop without sufficiently limiting the number of times that the loop is executed.,"If the iteration can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory. In many cases, a loop does not need to be infinite in order to cause enough resource consumption to adversely affect the software or its host system; it depends on the amount of resources consumed per iteration.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1378 CWE-835,Loop with Unreachable Exit Condition (Infinite Loop) (Type: Base),"The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.","If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1379 CWE-836,Use of Password Hash Instead of Password for Authentication (Type: Base),"The software records password hashes in a data store, receives a hash of a password from a client, and compares the supplied hash to the hash obtained from the data store.","Some authentication mechanisms rely on the client to generate the hash for a password, possibly to reduce load on the server or avoid sending the password across the network. However, when the client is used to generate the hash, an attacker can bypass the authentication by obtaining a copy of the hash, e.g. by using SQL injection to compromise a database of authentication credentials, or by exploiting an information exposure. The attacker could then use a modified client to replay the stolen hash without having knowledge of the original password.
13801380 As a result, the server-side comparison against a client-side hash does not provide any more security than the use of passwords without hashing.",,Unknown,
1381 CWE-837,"EN-Improper Enforcement of a Single, Unique Action (Type: Base)","The software requires that an actor should only be able to perform an action once, or to have only one unique action, but the software does not enforce or improperly enforces this restriction.","In various applications, a user is only expected to perform a certain action once, such as voting, requesting a refund, or making a purchase. When this restriction is not enforced, sometimes this can have security implications. For example, in a voting application, an attacker could attempt to ""stuff the ballot box"" by voting multiple times. If these votes are counted separately, then the attacker could directly affect who wins the vote. This could have significant business impact depending on the purpose of the software.",,Unknown,
1382 CWE-838,EN-Inappropriate Encoding for Output Context (Type: Base),"The software uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.","This weakness can cause the downstream component to use a decoding method that produces different data than what the software intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the software. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks.
1381 CWE-837,"Improper Enforcement of a Single, Unique Action (Type: Base)","The software requires that an actor should only be able to perform an action once, or to have only one unique action, but the software does not enforce or improperly enforces this restriction.","In various applications, a user is only expected to perform a certain action once, such as voting, requesting a refund, or making a purchase. When this restriction is not enforced, sometimes this can have security implications. For example, in a voting application, an attacker could attempt to ""stuff the ballot box"" by voting multiple times. If these votes are counted separately, then the attacker could directly affect who wins the vote. This could have significant business impact depending on the purpose of the software.",,Unknown,
1382 CWE-838,Inappropriate Encoding for Output Context (Type: Base),"The software uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.","This weakness can cause the downstream component to use a decoding method that produces different data than what the software intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the software. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks.
13831383 While using output encoding is essential for ensuring that communications between components are accurate, the use of the wrong encoding - even if closely related - could cause the downstream component to misinterpret the output.
13841384 For example, HTML entity encoding is used for elements in the HTML body of a web page. However, a programmer might use entity encoding when generating output for that is used within an attribute of an HTML tag, which could contain functional Javascript that is not affected by the HTML encoding.
13851385 While web applications have received the most attention for this problem, this weakness could potentially apply to any type of software that uses a communications stream that could support multiple encodings.",,Unknown,"Injection-safe templating languages: http://manicode.blogspot.com/2010/06/injection-safe-templating-languages_30.html
13891389 XSS Attacks: Preventing XSS Attacks
13901390 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
13911391 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
1392 CWE-839,EN-Numeric Range Comparison Without Minimum Check (Type: Base),"The program checks a value to ensure that it does not exceed a maximum, but it does not verify that the value exceeds the minimum.","Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1392 CWE-839,Numeric Range Comparison Without Minimum Check (Type: Base),"The program checks a value to ensure that it does not exceed a maximum, but it does not verify that the value exceeds the minimum.","Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
13931393 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversion Vulnerabilities"" Page 246.
13941394 The Art of Software Security Assessment: Chapter 6, ""Comparisons"", Page 265."
1395 CWE-84,EN-Improper Neutralization of Encoded URI Schemes in a Web Page (Type: Variant),The web application improperly neutralizes user-controlled input for executable script disguised with URI encodings.,"Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1395 CWE-84,Improper Neutralization of Encoded URI Schemes in a Web Page (Type: Variant),The web application improperly neutralizes user-controlled input for executable script disguised with URI encodings.,"Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
13961396 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,
1397 CWE-841,EN-Improper Enforcement of Behavioral Workflow (Type: Base),"The software supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence.","By performing actions in an unexpected order, or by omitting steps, an attacker could manipulate the business logic of the software or cause it to enter an invalid state. In some cases, this can also expose resultant weaknesses.
1397 CWE-841,Improper Enforcement of Behavioral Workflow (Type: Base),"The software supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence.","By performing actions in an unexpected order, or by omitting steps, an attacker could manipulate the business logic of the software or cause it to enter an invalid state. In some cases, this can also expose resultant weaknesses.
13981398 For example, a file-sharing protocol might require that an actor perform separate steps to provide a username, then a password, before being able to transfer files. If the file-sharing server accepts a password command followed by a transfer command, without any username being provided, the software might still perform the transfer.
13991399 Note that this is different than CWE-696, which focuses on when the software performs actions in the wrong sequence; this entry is closely related, but it is focused on ensuring that the actor performs actions in the correct sequence.
14001400 Workflow-related behaviors include:
14091409 Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
14101410 Toward Automated Detection of Logic Vulnerabilities in Web Applications: http://www.usenix.org/events/sec10/tech/full_papers/Felmetsger.pdf
14111411 Designing a Framework Method for Secure Business Application Logic Integrity in e-Commerce Systems: http://ijns.femto.com.tw/contents/ijns-v12-n1/ijns-2011-v12-n1-p29-41.pdf"
1412 CWE-842,EN-Placement of User into Incorrect Group (Type: Base),The software or the administrator places a user into an incorrect group.,"If the incorrect group has more access or privileges than the intended group, the user might be able to bypass intended security policy to access unexpected resources or perform unexpected actions. The access-control system might not be able to detect malicious usage of this group membership.",,Unknown,
1413 CWE-843,EN-Access of Resource Using Incompatible Type (Type Confusion) (Type: Base),"The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.","When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1412 CWE-842,Placement of User into Incorrect Group (Type: Base),The software or the administrator places a user into an incorrect group.,"If the incorrect group has more access or privileges than the intended group, the user might be able to bypass intended security policy to access unexpected resources or perform unexpected actions. The access-control system might not be able to detect malicious usage of this group membership.",,Unknown,
1413 CWE-843,Access of Resource Using Incompatible Type (Type Confusion) (Type: Base),"The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.","When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
14141414 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
14151415 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,"Attacking Interoperability: http://www.azimuthsecurity.com/resources/bh2009_dowd_smith_dewey.pdf
14161416 The Art of Software Security Assessment: Chapter 7, ""Type Confusion"", Page 319."
1417 CWE-85,EN-Doubled Character XSS Manipulations (Type: Variant),The web application does not filter user-controlled input for executable script disguised using doubling of the involved characters.,"When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1417 CWE-85,Doubled Character XSS Manipulations (Type: Variant),The web application does not filter user-controlled input for executable script disguised using doubling of the involved characters.,"When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
14181418 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
14191419 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,
1420 CWE-86,EN-Improper Neutralization of Invalid Characters in Identifiers in Web Pages (Type: Variant),"The software does not neutralize or incorrectly neutralizes invalid characters or byte sequences in the middle of tag names, URI schemes, and other identifiers.","Some web browsers may remove these sequences, resulting in output that may have unintended control implications. For example, the software may attempt to remove a ""javascript:"" URI scheme, but a ""java%00script:"" URI may bypass this check and still be rendered as active javascript by some browsers, allowing XSS or other attacks.",,Unknown,
1421 CWE-87,EN-Improper Neutralization of Alternate XSS Syntax (Type: Variant),The software does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1420 CWE-86,Improper Neutralization of Invalid Characters in Identifiers in Web Pages (Type: Variant),"The software does not neutralize or incorrectly neutralizes invalid characters or byte sequences in the middle of tag names, URI schemes, and other identifiers.","Some web browsers may remove these sequences, resulting in output that may have unintended control implications. For example, the software may attempt to remove a ""javascript:"" URI scheme, but a ""java%00script:"" URI may bypass this check and still be rendered as active javascript by some browsers, allowing XSS or other attacks.",,Unknown,
1421 CWE-87,Improper Neutralization of Alternate XSS Syntax (Type: Variant),The software does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
14221422 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,
1423 CWE-88,EN-Argument Injection or Modification (Type: Base),"The software does not sufficiently delimit the arguments being passed to a component in another control sphere, allowing alternate arguments to be provided, leading to potentially security-relevant changes.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1423 CWE-88,Argument Injection or Modification (Type: Base),"The software does not sufficiently delimit the arguments being passed to a component in another control sphere, allowing alternate arguments to be provided, leading to potentially security-relevant changes.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
14241424 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,"Argument injection issues: http://www.securityfocus.com/archive/1/archive/1/460089/100/100/threaded
14251425 The Art of Software Security Assessment: Chapter 10, ""The Argument Array"", Page 567."
1426 CWE-9,EN-J2EE Misconfiguration: Weak Access Permissions for EJB Methods (Type: Variant),"If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the software system.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1426 CWE-9,J2EE Misconfiguration: Weak Access Permissions for EJB Methods (Type: Variant),"If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the software system.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
14271427 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,
1428 CWE-90,EN-Improper Neutralization of Special Elements used in an LDAP Query (LDAP Injection) (Type: Base),"The software constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1428 CWE-90,Improper Neutralization of Special Elements used in an LDAP Query (LDAP Injection) (Type: Base),"The software constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
14291429 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,Web Applications and LDAP Injection
1430 CWE-91,EN-XML Injection (aka Blind XPath Injection) (Type: Base),"The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.","Within XML, special elements could include reserved words or characters such as ""<"", "">"", """""", and ""&"", which could then be used to add new data or modify XML syntax.",,Unknown,"Blind XPath Injection: http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf
1430 CWE-91,XML Injection (aka Blind XPath Injection) (Type: Base),"The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.","Within XML, special elements could include reserved words or characters such as ""<"", "">"", """""", and ""&"", which could then be used to add new data or modify XML syntax.",,Unknown,"Blind XPath Injection: http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf
14311431 The Art of Software Security Assessment: Chapter 17, ""XML Injection"", Page 1069."
1432 CWE-912,EN-Hidden Functionality (Type: Class),"The software contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the software's users or administrators.","Hidden functionality can take many forms, such as intentionally malicious code, ""Easter Eggs"" that contain extraneous functionality such as games, developer-friendly shortcuts that reduce maintenance or support costs such as hard-coded accounts, etc. From a security perspective, even when the functionality is not intentionally malicious or damaging, it can increase the software's attack surface and expose additional weaknesses beyond what is already exposed by the intended functionality. Even if it is not easily accessible, the hidden functionality could be useful for attacks that modify the control flow of the application.",,Unknown,
1433 CWE-913,EN-Improper Control of Dynamically-Managed Code Resources (Type: Class),"The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.","Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.",,Unknown,
1434 CWE-914,EN-Improper Control of Dynamically-Identified Variables (Type: Base),The software does not properly restrict reading from or writing to dynamically-identified variables.,"Many languages offer powerful features that allow the programmer to access arbitrary variables that are specified by an input string. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can modify unintended variables that have security implications.",,Unknown,
1435 CWE-915,EN-Improperly Controlled Modification of Dynamically-Determined Object Attributes (Type: Base),"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.","If the object contains attributes that were only intended for internal use, then their unexpected modification could lead to a vulnerability.
1432 CWE-912,Hidden Functionality (Type: Class),"The software contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the software's users or administrators.","Hidden functionality can take many forms, such as intentionally malicious code, ""Easter Eggs"" that contain extraneous functionality such as games, developer-friendly shortcuts that reduce maintenance or support costs such as hard-coded accounts, etc. From a security perspective, even when the functionality is not intentionally malicious or damaging, it can increase the software's attack surface and expose additional weaknesses beyond what is already exposed by the intended functionality. Even if it is not easily accessible, the hidden functionality could be useful for attacks that modify the control flow of the application.",,Unknown,
1433 CWE-913,Improper Control of Dynamically-Managed Code Resources (Type: Class),"The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.","Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.",,Unknown,
1434 CWE-914,Improper Control of Dynamically-Identified Variables (Type: Base),The software does not properly restrict reading from or writing to dynamically-identified variables.,"Many languages offer powerful features that allow the programmer to access arbitrary variables that are specified by an input string. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can modify unintended variables that have security implications.",,Unknown,
1435 CWE-915,Improperly Controlled Modification of Dynamically-Determined Object Attributes (Type: Base),"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.","If the object contains attributes that were only intended for internal use, then their unexpected modification could lead to a vulnerability.
14361436 This weakness is sometimes known by the language-specific mechanisms that make it possible, such as mass assignment, autobinding, or object injection.",,Unknown,"Shocking News in PHP Exploitation: http://www.suspekt.org/downloads/POC2009-ShockingNewsInPHPExploitation.pdf
14371437 ""Two Security Vulnerabilities in the Spring Framework's MVC"" pdf (from 2008): http://blog.diniscruz.com/2011/07/two-security-vulnerabilities-in-spring.html
14381438 Two Security Vulnerabilities in the Spring Framework's MVC: http://o2platform.files.wordpress.com/2011/07/ounce_springframework_vulnerabilities.pdf
14451445 PHP Object Injection: https://www.owasp.org/index.php/PHP_Object_Injection
14461446 Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
14471447 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
1448 CWE-916,EN-Use of Password Hash With Insufficient Computational Effort (Type: Base),"The software generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1448 CWE-916,Use of Password Hash With Insufficient Computational Effort (Type: Base),"The software generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
14491449 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
14501450 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
14511451 The amount of CPU time required to compute the hash (""stretching"")
14671467 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
14681468 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
14691469 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1470 CWE-917,EN-Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection) (Type: Base),"The software constructs all or part of an expression language (EL) statement in a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1470 CWE-917,Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection) (Type: Base),"The software constructs all or part of an expression language (EL) statement in a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
14711471 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
14721472 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
14731473 The amount of CPU time required to compute the hash (""stretching"")
14771477 Relative to the number of all possible hashes that can be generated by the scheme, there is a low likelihood of producing the same hash for multiple different inputs (""collision resistance"")
14781478 Note that the security requirements for the software may vary depending on the environment and the value of the passwords. Different schemes might not provide all of these properties, yet may still provide sufficient security for the environment. Conversely, a solution might be very strong in preserving one property, which still being very weak for an attack against another property, or it might not be able to significantly reduce the efficiency of a massively-parallel attack.",,Unknown,"Expression Language Injection: http://www.mindedsecurity.com/fileshare/ExpressionLanguageInjection.pdf
14791479 Remote Code with Expression Language Injection: http://danamodio.com/application-security/discoveries/spring-remote-code-with-expression-language-injection/"
1480 CWE-918,EN-Server-Side Request Forgery (SSRF) (Type: Base),"The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,"SSRF vs. Business-critical applications: XXE tunneling in SAP: https://media.blackhat.com/bh-us-12/Briefings/Polyakov/BH_US_12_Polyakov_SSRF_Business_Slides.pdf
1480 CWE-918,Server-Side Request Forgery (SSRF) (Type: Base),"The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,"SSRF vs. Business-critical applications: XXE tunneling in SAP: https://media.blackhat.com/bh-us-12/Briefings/Polyakov/BH_US_12_Polyakov_SSRF_Business_Slides.pdf
14811481 SSRF vs. Business-critical Applications. Part 1: XXE Tunnelling in SAP NetWeaver: http://erpscan.com/wp-content/uploads/2012/08/SSRF-vs-Businness-critical-applications-whitepaper.pdf
14821482 Cross Site Port Attacks - XSPA - Part 1: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-1.html
14831483 Cross Site Port Attacks - XSPA - Part 2: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-2.html
14851485 SSRF attacks and sockets: smorgasbord of vulnerabilities: http://www.slideshare.net/d0znpp/ssrf-attacks-and-sockets-smorgasbord-of-vulnerabilities
14861486 SSRF bible. Cheatsheet: https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit?pli=1#
14871487 Web Portals: Gateway To Information, Or A Hole In Our Perimeter Defenses: http://www.shmoocon.org/2008/presentations/Web%20portals,%20gateway%20to%20information.ppt"
1488 CWE-92,EN-DEPRECATED: Improper Sanitization of Custom Special Characters (Type: Base),"This entry has been deprecated. It originally came from PLOVER, which sometimes defined ""other"" and ""miscellaneous"" categories in order to satisfy exhaustiveness requirements for taxonomies. Within the context of CWE, the use of a more abstract entry is preferred in mapping situations. CWE-75 is a more appropriate mapping.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,
1489 CWE-920,EN-Improper Restriction of Power Consumption (Type: Base),"The software operates in an environment in which power is a limited resource that cannot be automatically replenished, but the software does not properly restrict the amount of power that its operation consumes.","In environments such as embedded or mobile devices, power can be a limited resource such as a battery, which cannot be automatically replenished by the software itself, and the device might not always be directly attached to a reliable power source. If the software uses too much power too quickly, then this could cause the device (and subsequently, the software) to stop functioning until power is restored, or increase the financial burden on the device owner because of increased power costs.
1488 CWE-92,DEPRECATED: Improper Sanitization of Custom Special Characters (Type: Base),"This entry has been deprecated. It originally came from PLOVER, which sometimes defined ""other"" and ""miscellaneous"" categories in order to satisfy exhaustiveness requirements for taxonomies. Within the context of CWE, the use of a more abstract entry is preferred in mapping situations. CWE-75 is a more appropriate mapping.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,
1489 CWE-920,Improper Restriction of Power Consumption (Type: Base),"The software operates in an environment in which power is a limited resource that cannot be automatically replenished, but the software does not properly restrict the amount of power that its operation consumes.","In environments such as embedded or mobile devices, power can be a limited resource such as a battery, which cannot be automatically replenished by the software itself, and the device might not always be directly attached to a reliable power source. If the software uses too much power too quickly, then this could cause the device (and subsequently, the software) to stop functioning until power is restored, or increase the financial burden on the device owner because of increased power costs.
14901490 Normal operation of an application will consume power. However, in some cases, an attacker could cause the application to consume more power than intended, using components such as:
14911491 Display
14921492 CPU
14951495 Sound
14961496 Microphone
14971497 USB interface",,Unknown,
1498 CWE-921,EN-Storage of Sensitive Data in a Mechanism without Access Control (Type: Base),The software stores sensitive information in a file system or device that does not have built-in access control.,"While many modern file systems or devices utilize some form of access control in order to restrict access to data, not all storage mechanisms have this capability. For example, memory cards, floppy disks, CDs, and USB devices are typically made accessible to any user within the system. This can become a problem when sensitive data is stored in these mechanisms in a multi-user environment, because anybody on the system can read or write this data.
1498 CWE-921,Storage of Sensitive Data in a Mechanism without Access Control (Type: Base),The software stores sensitive information in a file system or device that does not have built-in access control.,"While many modern file systems or devices utilize some form of access control in order to restrict access to data, not all storage mechanisms have this capability. For example, memory cards, floppy disks, CDs, and USB devices are typically made accessible to any user within the system. This can become a problem when sensitive data is stored in these mechanisms in a multi-user environment, because anybody on the system can read or write this data.
14991499 On Android devices, external storage is typically globally readable and writable by other applications on the device. External storage may also be easily accessible through the mobile device's USB connection or physically accessible through the device's memory card port.",,Unknown,Security Tips: http://developer.android.com/training/articles/security-tips.html#StoringData
1500 CWE-922,EN-Insecure Storage of Sensitive Information (Type: Class),The software stores sensitive information without properly limiting read or write access by unauthorized actors.,"If read access is not properly restricted, then attackers can steal the sensitive information. If write access is not properly restricted, then attackers can modify and possibly delete the data, causing incorrect results and possibly a denial of service.",,Unknown,
1501 CWE-923,EN-Improper Authentication of Endpoint in a Communication Channel (Type: Class),"The software establishes a communication channel to (or from) an endpoint for privileged or protected operations, but it does not properly authenticate the endpoint to ensure it is associated with the identity of the intended actor.","Attackers might be able to spoof the intended endpoint from a different system or process, thus gaining the same level of access as the intended endpoint.
1500 CWE-922,Insecure Storage of Sensitive Information (Type: Class),The software stores sensitive information without properly limiting read or write access by unauthorized actors.,"If read access is not properly restricted, then attackers can steal the sensitive information. If write access is not properly restricted, then attackers can modify and possibly delete the data, causing incorrect results and possibly a denial of service.",,Unknown,
1501 CWE-923,Improper Authentication of Endpoint in a Communication Channel (Type: Class),"The software establishes a communication channel to (or from) an endpoint for privileged or protected operations, but it does not properly authenticate the endpoint to ensure it is associated with the identity of the intended actor.","Attackers might be able to spoof the intended endpoint from a different system or process, thus gaining the same level of access as the intended endpoint.
15021502 While this issue frequently involves authentication between network-based clients and servers, other types of communication channels and endpoints can have this weakness.",,Unknown,
1503 CWE-924,EN-Improper Enforcement of Message Integrity During Transmission in a Communication Channel (Type: Class),"The software establishes a communication channel with an endpoint and receives a message from that endpoint, but it does not sufficiently ensure that the message was not modified during transmission.",A man-in-the-middle (MITM) attacker might be able to modify the message and spoof the endpoint.,,Unknown,
1504 CWE-925,EN-Improper Verification of Intent by Broadcast Receiver (Type: Variant),"The Android application uses a Broadcast Receiver that receives an Intent but does not properly verify that the Intent came from an authorized source, e.g. by checking the action string.","Certain types of Intents, identified by action string, can only be broadcast by the operating system itself, not by third-party applications. However, when an application declares the ability for a component to receive broadcast messages, in most cases a malicious application can send an Intent with a non-reserved action string to that receiving component.",,Unknown,
1505 CWE-926,EN-Improper Restriction of Content Provider Export to Other Applications (Type: Variant),The Android application uses a Content Provider that does not properly restrict which applications can access the data that is offered by the Content Provider.,"Android's Content Provider mechanism can be used to share data with other applications or internally within the same application. If access to the Content Provider is not restricted to only the expected applications, then malicious applications might be able to access the sensitive data.
1503 CWE-924,Improper Enforcement of Message Integrity During Transmission in a Communication Channel (Type: Class),"The software establishes a communication channel with an endpoint and receives a message from that endpoint, but it does not sufficiently ensure that the message was not modified during transmission.",A man-in-the-middle (MITM) attacker might be able to modify the message and spoof the endpoint.,,Unknown,
1504 CWE-925,Improper Verification of Intent by Broadcast Receiver (Type: Variant),"The Android application uses a Broadcast Receiver that receives an Intent but does not properly verify that the Intent came from an authorized source, e.g. by checking the action string.","Certain types of Intents, identified by action string, can only be broadcast by the operating system itself, not by third-party applications. However, when an application declares the ability for a component to receive broadcast messages, in most cases a malicious application can send an Intent with a non-reserved action string to that receiving component.",,Unknown,
1505 CWE-926,Improper Restriction of Content Provider Export to Other Applications (Type: Variant),The Android application uses a Content Provider that does not properly restrict which applications can access the data that is offered by the Content Provider.,"Android's Content Provider mechanism can be used to share data with other applications or internally within the same application. If access to the Content Provider is not restricted to only the expected applications, then malicious applications might be able to access the sensitive data.
15061506 This weakness could be expressed in several different ways:
15071507 The Content Provider is only intended for internal use by the application, and thus does not need to be exported.
15081508 In Android before 4.2, the Content Provider is automatically exported unless it has been explicitly declared as NOT exported.
15091509 The Content Provider is intended for external use by some applications, but it does not properly limit access, e.g. by exporting with excessive permissions.",,Unknown,No description: http://developer.android.com/training/articles/security-tips.html#ContentProviders
1510 CWE-927,EN-Use of Implicit Intent for Sensitive Communication (Type: Variant),The Android application uses an implicit intent for transmitting sensitive data to other applications.,"Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Unknown,"Analyzing Inter-Application Communication in Android: http://www.cs.berkeley.edu/~afelt/intentsecurity-mobisys.pdf
1510 CWE-927,Use of Implicit Intent for Sensitive Communication (Type: Variant),The Android application uses an implicit intent for transmitting sensitive data to other applications.,"Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Unknown,"Analyzing Inter-Application Communication in Android: http://www.cs.berkeley.edu/~afelt/intentsecurity-mobisys.pdf
15111511 Security Tips: http://developer.android.com/training/articles/security-tips.html#ContentProviders"
1512 CWE-96,EN-Improper Neutralization of Directives in Statically Saved Code (Static Code Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1513 CWE-97,EN-Improper Neutralization of Server-Side Includes (SSI) Within a Web Page (Type: Variant),"The software generates a web page, but does not neutralize or incorrectly neutralizes user-controllable input that could be interpreted as a server-side include (SSI) directive.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1514 CWE-116,EN-Improper Encoding or Escaping of Output (Type: Class),"The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.","Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
1512 CWE-96,Improper Neutralization of Directives in Statically Saved Code (Static Code Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1513 CWE-97,Improper Neutralization of Server-Side Includes (SSI) Within a Web Page (Type: Variant),"The software generates a web page, but does not neutralize or incorrectly neutralizes user-controllable input that could be interpreted as a server-side include (SSI) directive.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1514 CWE-116,Improper Encoding or Escaping of Output (Type: Class),"The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.","Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
15151515 Most software follows a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, ""GET /index.html HTTP/1.1"" is a structured message containing a command (""GET"") with a single argument (""/index.html"") and metadata about which protocol version is being used (""HTTP/1.1"").
15161516 If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.",,Very High,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
15171517 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
15211521 Input Validation - Not That Important: http://manicode.blogspot.com/2008/08/input-validation-not-that-important.html
15221522 Preventing XSS with Correct Output Encoding: http://phed.org/2008/05/19/preventing-xss-with-correct-output-encoding/
15231523 Writing Secure Code: Chapter 11, ""Canonical Representation Issues"" Page 363"
1524 CWE-121,EN-Stack-based Buffer Overflow (Type: Variant),"A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,Very High,"Writing Secure Code: Chapter 5, ""Stack Overruns"" Page 129
1524 CWE-121,Stack-based Buffer Overflow (Type: Variant),"A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,Very High,"Writing Secure Code: Chapter 5, ""Stack Overruns"" Page 129
15251525 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
15261526 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
15271527 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
1528 CWE-134,EN-Uncontrolled Format String (Type: Base),"The software uses externally-controlled format strings in printf-style functions, which can lead to buffer overflows or data representation problems.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Very High,"Format String Vulnerabilities in Perl Programs: http://www.securityfocus.com/archive/1/418460/30/0/threaded
1528 CWE-134,Uncontrolled Format String (Type: Base),"The software uses externally-controlled format strings in printf-style functions, which can lead to buffer overflows or data representation problems.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Very High,"Format String Vulnerabilities in Perl Programs: http://www.securityfocus.com/archive/1/418460/30/0/threaded
15291529 Programming Language Format String Vulnerabilities: http://www.ddj.com/dept/security/197002914
15301530 Format String Attacks: http://www.thenewsh.com/~newsham/format-string-attacks.pdf
15311531 Writing Secure Code: Chapter 5, ""Format String Bugs"" Page 147
15321532 24 Deadly Sins of Software Security: ""Sin 6: Format String Problems."" Page 109
15331533 The Art of Software Security Assessment: Chapter 8, ""C Format Strings"", Page 422."
1534 CWE-256,EN-Plaintext Storage of a Password (Type: Variant),Storing a password in plaintext may result in a system compromise.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1535 CWE-257,EN-Storing Passwords in a Recoverable Format (Type: Base),"The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,
1536 CWE-258,EN-Empty Password in Configuration File (Type: Variant),Using an empty string as a password is insecure.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1537 CWE-259,EN-Use of Hard-coded Password (Type: Base),"The software contains a hard-coded password, which it uses for its own inbound authentication or for outbound communication to external components.","A hard-coded password typically leads to a significant authentication failure that can be difficult for the system administrator to detect. Once detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1534 CWE-256,Plaintext Storage of a Password (Type: Variant),Storing a password in plaintext may result in a system compromise.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1535 CWE-257,Storing Passwords in a Recoverable Format (Type: Base),"The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,
1536 CWE-258,Empty Password in Configuration File (Type: Variant),Using an empty string as a password is insecure.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1537 CWE-259,Use of Hard-coded Password (Type: Base),"The software contains a hard-coded password, which it uses for its own inbound authentication or for outbound communication to external components.","A hard-coded password typically leads to a significant authentication failure that can be difficult for the system administrator to detect. Once detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
15381538 Inbound: the software contains an authentication mechanism that checks for a hard-coded password.
15391539 Outbound: the software connects to another system or component, and it contains hard-coded password for connecting to that component.
15401540 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
15411541 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1542 CWE-309,EN-Use of Password System for Primary Authentication (Type: Base),"The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.","While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,Very High,
1543 CWE-74,EN-Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection) (Type: Class),"The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","Software has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Very High,
1544 CWE-77,EN-Improper Neutralization of Special Elements used in a Command (Command Injection) (Type: Class),"The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.","Command injection vulnerabilities typically occur when:
1542 CWE-309,Use of Password System for Primary Authentication (Type: Base),"The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.","While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,Very High,
1543 CWE-74,Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection) (Type: Class),"The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","Software has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Very High,
1544 CWE-77,Improper Neutralization of Special Elements used in a Command (Command Injection) (Type: Class),"The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.","Command injection vulnerabilities typically occur when:
15451545 1. Data enters the application from an untrusted source.
15461546 2. The data is part of a string that is executed as a command by the application.
15471547 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Very High,"Exploiting Software: How to Break Code
15481548 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171"
1549 CWE-798,EN-Use of Hard-coded Credentials (Type: Base),"The software contains hard-coded credentials, such as a password or cryptographic key, which it uses for its own inbound authentication, outbound communication to external components, or encryption of internal data.","Hard-coded credentials typically create a significant hole that allows an attacker to bypass the authentication that has been configured by the software administrator. This hole might be difficult for the system administrator to detect. Even if detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1549 CWE-798,Use of Hard-coded Credentials (Type: Base),"The software contains hard-coded credentials, such as a password or cryptographic key, which it uses for its own inbound authentication, outbound communication to external components, or encryption of internal data.","Hard-coded credentials typically create a significant hole that allows an attacker to bypass the authentication that has been configured by the software administrator. This hole might be difficult for the system administrator to detect. Even if detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
15501550 Inbound: the software contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials.
15511551 Outbound: the software connects to another system or component, and it contains hard-coded credentials for connecting to that component.
15521552 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
15531553 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"Writing Secure Code: Chapter 8, ""Key Management Issues"" Page 272
15541554 Top 25 Series - Rank 11 - Hardcoded Credentials: http://blogs.sans.org/appsecstreetfighter/2010/03/10/top-25-series-rank-11-hardcoded-credentials/
15551555 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
1556 CWE-89,EN-Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) (Type: Base),"The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1556 CWE-89,Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) (Type: Base),"The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
15571557 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Very High,"24 Deadly Sins of Software Security: ""Sin 1: SQL Injection."" Page 3
15581558 Writing Secure Code: Chapter 12, ""Database Input Issues"" Page 397
15591559 SQL Injection Prevention Cheat Sheet: http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
15681568 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
15691569 The Art of Software Security Assessment: Chapter 8, ""SQL Queries"", Page 431.
15701570 The Art of Software Security Assessment: Chapter 17, ""SQL Injection"", Page 1061."
1571 CWE-262,EN-Not Using Password Aging (Type: Variant),"If no mechanism is in place for managing password aging, users will have no incentive to update passwords in a timely manner.","This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1572 CWE-263,EN-Password Aging with Long Expiration (Type: Base),Allowing password aging to occur unchecked can result in the possibility of diminished password integrity.,"Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1573 CWE-768,ES-Incorrect Short Circuit Evaluation (Type: Variant),"The software contains a conditional statement with multiple logical expressions in which one of the non-leading expressions may produce side effects. This may lead to an unexpected state in the program after the execution of the conditional, because short-circuiting logic may prevent the side effects from occurring.",,"Usage of short circuit evaluation, though well-defined in the C standard, may alter control flow in a way that introduces logic errors that are difficult to detect, possibly causing errors later during the software's execution. If an attacker can discover such an inconsistency, it may be exploitable to gain arbitrary control over a system.
1574 If the first condition of an ""or"" statement is assumed to be true under normal circumstances, or if the first condition of an ""and"" statement is assumed to be false, then any subsequent conditional may contain its own logic errors that are not detected during code review or testing.
1575 Finally, the usage of short circuit evaluation may decrease the maintainability of the code.",Very Low,
1576 ,Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
1577 ,ES-Session Cookie without Secure flag set,"La cookie no tiene la marca de ""Secure"". Esto instruye al navegador que dicha cookie puede ser solo accedida por canales SSL.",,Si es posible se deberia habilitar la flag Secure para esta cookie,Low,
1578 ,ES-Session Cookie without HttpOnly flag Set,"La cookie de sesion no esta marcada como HTTPOnly, cuando una cookie es marcada de esta manera da instruccion al navegador que esa cookie puede ser accedida solamente por el servdor y no por script del lado del cliente. Es una importante proteccion de seguridad para las cookies de sesion",,Si es posible se deberia habilitar la flag HTTPOnly para esta cookie,Low,
1579 ,ES-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
1580 Se ha detectado un problema en las versiones de apache 1.3.0, 2.0.x hasta 2.0.64 y 2.2.X hasta 2.2.19 que mediante una herramienta automatizada un atacante usand una moderada cantidad de request puede causar un uso significativo de memoria y CPU en el servidor. Datos: http://seclists.org/fulldisclosure/2011/Aug/175.",,Actualizar version de apache,Medium,
1581 ,ES-Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
1582 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
1583 Disallow: /*AB/$
1584 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",Info,
1585 ,ES-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
1586 ,ES-Credentials en Texto Plano,Las Credenciales de usuario son trasmitidas por un canal sin cifrar y puede ser interceptada.,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
1587 ,ES-Parametro __VIEWSTATE sin encriptar,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
1588 <machineKey validation=""3DES""/>",,
1589 ,ES-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
1590
1591 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
1592 style=""border-width:0px;"" />
1593
1594 Siendo la respuesta THHvB
1595
1596 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
1597 ,"ES-Mensaje de error de la aplicacion
1598 (Application error message)","El server responde con mensajes de error internos que no deberián mostrarse, facilitando de esta manera informacion que puede ser sensible o util para un atacante. Pudiendo de esta manera obtener datos para mejorar su vector de ataque",,"Se recomienda deshabilitar los mensajes de error, para no proporcionar información de la tecnología o software implementado.
1599
1600 ",Low,
1601 ,ES-Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1602 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,Medium,
1603 ,ES-Input de Contraseña con Autocompletar,"Un form de login con autocompletar sugiere un problema de seguridad, sobretodo para los usuarios que utilizan el servicio desde computadoras publicas.",,"Se recomienta establecer el input con Autocomplete OFF:
1571 CWE-262,Not Using Password Aging (Type: Variant),"If no mechanism is in place for managing password aging, users will have no incentive to update passwords in a timely manner.","This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1572 CWE-263,Password Aging with Long Expiration (Type: Base),Allowing password aging to occur unchecked can result in the possibility of diminished password integrity.,"Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1573 ,Session Cookie without Secure flag set,"This cookie does not have the Secure flag set. When a cookie is set with the Secure flag, it instructs the browser that the cookie can only be accessed over secure SSL channels. This is an important security protection for session cookies.",,"If possible, you should set the Secure flag for this cookie.",low,
1574 ,Session Cookie without HttpOnly flag Set,"This cookie does not have the HTTPOnly flag set. When a cookie is set with the HTTPOnly flag, it instructs the browser that the cookie can only be accessed by the server and not by client-side scripts. This is an important security protection for session cookies.",,"If possible, you should set the HTTPOnly flag for this cookie.",Low,
1575 ,Application error message,"This page contains an error/warning message that may disclose sensitive information.The message can also contain the location of the file that produced the unhandled exception.
1576
1577 The error messages may disclose sensitive information. This information can be used to launch further attacks.",,Review the source code for this script. The application need to show generic errors.,,
1578 ,Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1579 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,,
1580 ,Input Password with Autocomplete Enable,"Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. If an attacker gain access to a computer its possible of get credentials back.",,"You should include the attribute Autocomplete OFF:
16041581 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
1605 ,ES-Archivos de Backup,"Los archivos de Backup pueden contener codigo fuente de script, archivos de configuracion u otra informacion sensible que puede ayudar a un atacante a conocer el servidor y preparar ataques mas avanzados o especificos.",,Remover el/los archivo(s) si no son requeridos en el servidor en produccion. Como un paso adicional es recomendado implementar una politica de seguridad para no permitir la creacion de archivos de backup en directorios accesibles desde la web.,,
1606 ,ES-Possible sensitive directories,"Un posible directorio sensible fue encotnrado. Este directorio no esta directamente linkeado en el servidor Web.Se chekeo usando nombres comunes para directorios de configuracion, backups, bajadas de bases de datos, paginas de administracion, archivos temporales, etc. Usar nombres comunes de directorios para almacenar este tipo de informacion facilita a usuarios maliciosos buscar archivos sensibles.",,"Se recomienda llamar a estos directorios de manera no estandard, por ejemplo:
1607 config-->c0nfig05
1608 backup-->b4ccup
1609 Aunque es aun mas recomendabl, de ser posible, no dejar directorios de backup, configuracion, etc accesibles directamente desde la web",,
1610 ,ES-Slow HTTP Denial of Service Attack,"Los ataques conocidos como ""Slowloris"" y ""Slow HTTP POST DoS"" se basan en el hecho de que el protocolo HTTP, por diseño, requiere que las consultas esten completamente recividas por el servidor antes de poder ser procesadas. Si la consulta HTTP no esta completa, o si la tranferencia es muy lenta, el servidor mantiene recursos ocupados esperando el resto de la informacion. Si el servidor mantiene demasiados recursos ocupados, esto crea una denegacion de servicio.",,Es importante establecer los tiempos de espera del servidor. Se adjunta link de recomendacion para evitar este tipo de ataques: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1611 ,ES-Clickjacking,"No se encuentra ningún tipo de impedimento para evitar que la web sea embebida dentro de un iframe. Esta restricción es importante ya que un atacante podría engañar a un usuario autenticado a realizar operaciones mediante un engaño llamado Clickjacking donde la víctima se le presenta una web, posiblemente con algun juego, utilizando algunos engaños de interfaz la victima podria ser engañada a aprobar una venta. Ref:http://javascript.info/tutorial/clickjacking",,"Todos los browsers modernos son capaces de interpretar los valores seteados en X-Frame-Options, si los mismos son incluidos en el Header del servidor.",Low,
1612 ,"ES-XSS Cross Site Scripting
1613 (Secuencias de comandos en sitios cruzados)","Es posible injectar tags html y código javascript malicioso, por una falta en la comprobación de los datos ingresados en los parameros. De esta forma, un atacante podría ejecutar código que le permita obtener las cookies del usuario atacado, y de esa forma, tomar control de su cuenta.",,"Recomendamos filtrar todos los parámetros en búsqueda de posibles injecciones, y escapar todos los datos de entrada que se vayan a mostrar en la respuesta.",High,
1614 ,ES-SSL 2.0 Obsolete Protocol,"El servicio remoto encripta el trafico utilizando una version obsoleta del protocolo SSL con errores y debilidades conocidas. Un atacante puede explotar estas vulneravilidades y conducir a un ataque de ""man in the middle"" o desencriptar la comunicaciones entre el servicio afectado y los clientes.",,Se recomienda desactivar SSL 2.0 y usar SSL 3.0 o TLS 1.0 en su lugar.,High,
1615 ,"ES-OPTIONS method is enabled
1616 (Metodo OPTIONS activado)",El metodo HTTP OPTIONS esta activado en el servidor. El metodo OPTIONS provee una lista de los metodos que son soportados por el servidor web. El metodo OPTIONS puede exponer informasion sensible que puede ayudar a un usuario malicioso a preparar ataques mas avanzados,,Es recomendado desactivar el metodo OPTIONS en un servidor en produccion.,Low,
1617 ,ES-TLS1/SSLv3 Renegotiation Vulnerability,"Una vulnerabilidad en la manera que el protocol SSL and TLS acepta pedidos renegociaciones pueden permitir a un atacante inyectar texto plano en ect plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
1582 ,Backup Files,"Backup files can contain script sources, configuration files or other sensitive information that may help an malicious user to prepare more advanced attacks",,"Remove the file(s) if they are not required on your website. As an additional step, it is recommended to implement a security policy within your organization to disallow creation of backup files in directories accessible from the web.",,
1583 ,Sesintive directory,"A possible sensitive directory has been found. This directory is not directly linked from the website.This check looks for common sensitive resources like backup directories, database dumps, administration pages, temporary directories. Each one of these directories could help an attacker to learn more about his target.",,,,
1584 ,Slow HTTP Denial of Service Attack,"Slowloris and Slow HTTP POST DoS attacks rely on the fact that the HTTP protocol, by design, requires requests to be completely received by the server before they are processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. If the server keeps too many resources busy, this creates a denial of service.",,It's important to configure the timout values on the Webserver. Here is a link to a guide on how to prevent this kind of attack: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1585 ,Clickjacking,"It might be possible for a web page controlled by an attacker to load the content of this response within an iframe on the attacker's page. This may enable a ""clickjacking"" attack, in which the attacker's page overlays the target application's interface with a different interface provided by the attacker. By inducing victim users to perform actions such as mouse clicks and keystrokes, the attacker can cause them to unwittingly carry out actions within the application that is being targeted. This technique allows the attacker to circumvent defenses against cross-site request forgery, and may result in unauthorized actions. Ref:http://javascript.info/tutorial/clickjacking",,"To effectively prevent framing attacks, the application should return a response header with the name X-Frame-Options and the value DENY to prevent framing altogether, or the value SAMEORIGIN to allow framing only by pages on the same origin as the response itself.",Low,
1586 ,OPTIONS method is enabled,"HTTP OPTIONS method is enabled on this web server. The OPTIONS method provides a list of the methods that are supported by the web server, it represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
1587 The OPTIONS method may expose sensitive information that may help an malicious user to prepare more advanced attacks.",,It's recommended to disable OPTIONS Method on the web server.,Low,
1588 ,TLS1/SSLv3 Renegotiation Vulnerability,"A vulnerability in the way SSL and TLS protocols allow renegotiation requests may allow an attacker to inject plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
16181589 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
1619 ,ES-File Inclusion,Es posible que un atacante remoto incluya un archivo de recursos locales o remotos y / o la ejecución de código de script arbitrario con los privilegios del servidor web.,,"Editar el código fuente para asegurarse de que la entrada esté correctamente validada. Cuando es posible, se recomienda hacer una lista de nombres de archivos aceptados y restringir la entrada a la lista.
1620
1621 En PHP, la opción allow_url_fopen normalmente permite a un programador para abrir, incluir o utilizan de alguna manera un archivo remoto a través de una URL en lugar de una ruta de archivo local. Se recomienda desactivar esta opción de php.ini.",,
1622 CWE-319,"ES-Credenciales enviadas por un canal en texto plano
1623 (User Credentials Sent in Clear Text)","Las credenciales de usuario se transmiten sobre un canal sin cifrar. Esta información siempre debe ser transferida a través de un canal cifrado (HTTPS) para evitar ser interceptados por usuarios maliciosos.
1624
1625 Una tercera persona puede ser capaz de leer las credenciales de usuario mediante la interceptación de una conexión no cifrada de HTTP.",,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",Medium,
1626 ,ES-URL Redirection,"Este script es vulnerable a los ataques de redireccion por URL
1627
1628 La redireccion por URL es comunmente usado para pishing y suplantacion de identidad, ya que confunde al usuario a que sitio esta ingresando realmente. Un atacante puede redireccionar una visita desde un sitio valido hasta un servidor preparado por el, para poder hacer ataques como por ejemplo de pishin o distribucion de malware.",,"El script debe filtrar los sitios destinos del redirect, manteniendolo siempre dentro de los dominios validos.",,
1629 ,ES-Apache Server Status Enabled,"Server Status es una opcion de debug que muestra informacion sensible del servidor, como numero de peticiones, url de las peticiones, uso de memoria, threads, etc",,"Es recomendable desactivar esta opcion en servidores en produccion, o de ser necesaria la utilizacion de la misma, securizar la carpeta con contraseña o renombrarla para que no sea de facil ubicacion",,
1630 ,ES-Microsoft IIS tilde directory enumeration,"Es posible detectar nombres cortos de archivosy directorios cuyo nombrado sea en formato 8.3 en Windows usando vectores en varias versiones de Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1631 ,ES-SQL Injection,"Debido al incorrecto filtrado de parámetros es posible ejecutar comandos SQL en la base de datos situada en el servidor mediante manipulación de parámetros. Un atacante podría utilizar esta técnica para extraer/modificar/eliminar el contenido de la base de datos, el único limitante son los privilegios del usuario utilizado por la web application aunque en muchos casos es posible, gracias a una inyeccion de SQL, es posible catapultar un acceso al sistema operativo.",,"Se debe modificar la aplicación para filtrar caracteres en los campos de input antes de ser enviados como consulta al servidor de base de datos.
1632 Es importante que se sigan buenas prácticas de programación, en todos los sitios desarrollados, y sobre todos los parámetros, y no solo sobre aquellos que sean vulnerables actualmente.
1633 Guía de cómo evitar estos ataques (en inglés): https://www.owasp.org/index.php/Guide_to_SQL_Injection",Very High,
1634 ,ES-ASP.NET debugging enabled,"El modo depuracion de ASP.NET esta activado en el servidor. Es recomendado desactivar este modo en servidores en produccion. Por defecto en la instalacion de IIS este modo esta desactivado, si fue activado para diagnosticar errores es conveniente luego desactivarlo.",,"Es posible que el modo debug muestre datos sensibles del servidor.
1635 Mas informacion de como desactivar el modo debug:
1636 http://support.microsoft.com/default.aspx?scid=kb;es-us;815157",,
1637 ,ES-Unicode tranfsormation Issues,"La pagina es vulnerable a varias tranformaciones de Unicode como ""Best-Fit Mappings"", ""Overlong byte sequences"" y ""Ill-formed sequences"".
1638 Best-Fit Mappings ocurre cuando el caracter X es tranformado por un totalmente diferente caracter Y. En general, best-fit mappings occure cuando el caracter es transcodeado entre Unicode y otro encodificado.
1639
1640 ************************************
1641
1642 ""Overlong byte sequences"" (no la forma corta) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
1643 0xC0 0x8A
1644 0xE0 0x80 0x8A
1645 0xF0 0x80 0x80 0x8A
1646 0xF8 0x80 0x80 0x80 0x8A
1647 0xFC 0x80 0x80 0x80 0x80 0x8A
1648
1649 Ill-Formed Subsequences As REQUIRED by UNICODE 3.0, and noted in the Unicode Technical Report #36, if a leading byte is followed by an invalid successor byte, then it should NOT consume it.
1650
1651
1652 Software vulnerabilities arise when Best-Fit mappings occur. For example, characters can be manipulated to bypass string handling filters, such as cross-site scripting (XSS) or SQL Injection filters, WAF's, and IDS devices. Overlong UTF-8 sequence could be abused to bypass UTF-8 substring tests that look only for the shortest possible encoding.",,"Se debe identificar el origen de esta tranformacion Unicode y reparar el problema. Se deja links a paginas con informacion:
1653 Links with more information:
1654 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
1655 http://www.cl.cam.ac.uk/~mgk25/unicode.html
1656 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
1657 http://www.unicode.org/reports/tr36/",,
1658 ,"ES-File Upload XSS
1659 (Subida dearchivo de secuencias de comandos de sitios curzados)","El Script es vulnerable a XSS (Cross-site scripting). La aplicacion permite la carga de archivos y se subio un archivo conteniendo lenguaje HTML. Cuando este tipo de archivos es permitido en la carga, Lugo se pueden ejecutar o linkear, mostrando codigo o acciones malociosas en dicha web.
1660
1661 Usuarios maliciosos pueden inyectar: JavaScript, VBScript, ActiveX, HTML o Flash en esta aplicacion vulnerable y engañar a un usuario para obtener informacion de el, tambien se puede robar datos de la sesion, asi como las cookies de la misma. Dependiendo del codigo que se pueda ejecutar, tambien se puede ganar acceso al wevidor web, archivos de configuracion o hasta ejecucion de binarios en el sistema operativo host.",,"Se deben restringir los tipos de archivos aceptados en el sistema de Carga: chekear la extension y solo aceptar ciertos tipos de archivos. Se recomienda una Whitelist en lugar de Un blacklist (es mejor especificar listado unico de extensiones permitidas, sobre un listado de denegadas). Tambien se debe chekear doble extensiones como .php.png. Chekear archivos sin nombre como "".htaccess"" (en ASP.NET, se debe chekear archivos de configuracion como web.config). Cambiar los permisos sobre la carpeta upload (de carga) para que los archivos no puedan ser ejecutados ahi. Si es posible, renombre los archivos que son subidos al servidor.
1662 Links con mas informacion:
1663 https://www.owasp.org/index.php/Unrestricted_File_Upload
1664 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
1665 ,ES-jQuery cross site scripting,"Esta pagina esta usando una version obsoleta de jQuery la cual es vulnerable a Cross Site Scripting. Muchos sitios estan utilisando la seleccion de elementos usando location.hash lo que permite la ejecucion de scripts en la pagina. El problema fue solucionado en la vercion jQuery 1.6.3 o superior.
1666 Usuarios malociosos pueden inyectar JavaScript, VBScript, ActiveX, HTML o Flash en la aplicacion vulnerable, pudiendo asi engañar a un usuario para sacarle informacion sensible.",,"Update to the latest version of jQuery.
1667 More info: http://ma.la/jquery_xss/
1668 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
1669 ,ES-Host Header Attack,"Un atacante puede manipular el header Host y causar que la aplicacion se comporte de maneras inesperadas. Programadores aveces creen en el header host y programas el codigo basado en el: (_SERVER[""HTTP_HOST""] in PHP). Esto tambien se refleja en portales como joombla o wordpress donde los plugins y ejecucion de script, ejemplos:
1670
1671 <link href=""http://_SERVER['HOST']"" (Joomla)
1672
1673 ...haciendo un apend de keys secretas y tokens:
1674 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery y otros)
1675 ....e importante directamente scripts:
1676 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)",,"La aplicacion web deberia usar una variable ""SERVER_NAME"" en lugar de basarse en le Host header.",High,
1677 ,ES-Login Page password-guessing attack,"Un problema común con el que se encuentran los programadores web son los ataques de fuerza bruta de logins. Un ataque de fuerza bruta es un intento de adivinar la contraseña por sistemáticamente probar todas las posibles combinaciones de números, letras y símbolos hasta descubrir la convencional correcta. Este ataque se mejora utilizando diccionarios con palabras comunes y combinaciones de las mismas
1678
1679 Esta pagina de Login no tiene ninguna protección contra este ataque ya que se probaron 20 logins inválidos y el servidor no bloqueo el acceso para seguir intentando. Tampoco dispone de ninguna protección para evitar los intentos de login automáticos (como un captcha).",,"Es recomendable implementar algun tipo de bloqueo de intentos de login tras un numero de fallos en los intentos.
1680 Mas información:
1681 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
1682 ,ES-Error page web server version disclosure (Pagina de error mostrando version de servidor ),Pidiendo una pagina que no existe el servidor responde con un error. En esta pagina de error se encuentran datos que contienen version del servidor web y/o modulos activados en este. Dicha informacion puede ser usada para mejorar las tacticas del atacante sabiendo a que se enfrenta,,Se debe configurar paginas de error customizadas evitando mostrar esta informacion.,Low,
1683 ,ES-Weak SSL,"El servidor esta utiizando un cifrado SSL dèbil.
1684
1685 Weak SSL ciphers (SSL2 on port 443):
1686
1687 SSL2_CK_RC4_128_EXPORT40_WITH_MD5 - Low strength
1688 SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 - Low strength
1689 SSL2_CK_DES_64_CBC_WITH_MD5 - Low strength
1690
1691 Weak SSL ciphers (SSL3 on port 443):
1692
1693 SSL3_CK_RSA_RC4_40_MD5 - Low strength
1694 SSL3_CK_RSA_RC2_40_MD5 - Low strength
1695 SSL3_CK_RSA_DES_40_CBC_SHA - Low strength
1696 SSL3_CK_RSA_DES_64_CBC_SHA - Low strength
1697 SSL3_CK_EDH_RSA_DES_40_CBC_SHA - Low strength
1698 SSL3_CK_EDH_RSA_DES_64_CBC_SHA - Low strength
1699
1700 Weak SSL ciphers (TLS1 on port 443):
1701
1702 TLS1_CK_RSA_EXPORT_WITH_RC4_40_MD5 - Low strength
1703 TLS1_CK_RSA_EXPORT_WITH_RC2_CBC_40_MD5 - Low strength
1704 TLS1_CK_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
1705 TLS1_CK_RSA_WITH_DES_CBC_SHA - Low strength
1706 TLS1_CK_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
1707 TLS1_CK_DHE_RSA_WITH_DES_CBC_SHA - Low strength",,Reconfigurar el servidor para encriptado mas fuerte.,,
1708 ,ES-CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) es un exploit contra las cookies secretas del servidor sobre conexiones usando protocolos HTTPS y SPDY que tambien esten usando compresion de datos. Cuando se recupera el contenido de la cookie de autentificacion, permite a un atacante robar la sesion, permitiendo iniciar otros ataques.
1709
1710 CRIME es un ataque del lado cliente, pero el servidor puede proteger al cliente rechazando la combinacion de estas opciones. Para CRIME, la debilidad es la compresion Deflate.",,"CRIME puede ser combatido previniendo el uso de compresion, tanto del lado del cliente, desactivando la compresion de las peticiones HTTPS, o del lado del servidor previniendo el uso de compresion de datos en las transacciones que utilicen el protocolo TLS.
1711
1712 Referencias WEB.
1713 http://blogs.cisco.com/security/breach-crime-and-blackhat/
1714 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
1715 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",High,
1716 ,ES-Transaccion Insegura de HTTPS a HTTP en el form POST,La pagina segura (https) contiene un form que realiza el post sobre una pagina insegura (http). Esto puede confundir al usuario y hacerle creer que su datos son enviados encriptados cuando en realidad no.,,El destino del FORM debe apuntar a una pagina segura (https),,
1717 ,ES-Trace Method is Enabled (Metodo TRACE activado),"El metodo Trace esta habilitado en el servidor. En precencia de otras vulnerabilidades cross-domain en los navegadores web, informacion sensible del campo header puede ser leida desde cualquier dominio que soporte metodo HTTP TRACE.
1718
1719 Un atacante poria abusar de la funcionabilidad HTTP TRACE para ganar acceso a la informacion de los headers HTTP como las cookies y datos de autenticacion.",,"Se recomienda desactivar el metodo TRACE en el servidor web.
1720
1721 Referencias WEB:
1722 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
1723 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",Low,
1724 ,ES-Public Key SSL < 2048 bits (Certificado de llave Publica SSL menor de 2048 Bits),"El certificado SSL usado por el servidor contiene una llave publica de menos de 2048 bits de largo
1725
1726 Los nuevos estandares de de la Industria de Certificados para SSL (SSL Certificates Industry) seteados por Certification Authority/Browser (CA/B) Forum requiere que los certificados expedidos despues de enero 1 del 2014. Deben ser al menos de 2048-bit largo. Con el incremento del poder de procesamiento de las computadoras, cualquier certificado menor de 2048-bit es riesgoso de ser comprometido por personas mal intecionadas con poder de procesamiento.",,"Si se tiene cualquier certificado de 1024-bito certificados con menos de 2048-bit de largo, sera necesario que se migre a 2048-bit.
1727
1728 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
1729 ,ES-Ruby on Rails CookieStore session cookie persistence,"Ruby on Rails contiene un fallo en su diseño que podria permitir a atacantes facilitar el acceso a las aplicaciones. El problema esta en mecanicsmo de la CookieStore en guardar la cookie en el lado del cliente, mientras no guarda la entrada correspondiente en el lado del servidor. Cuando la aplicacion termina la sesion, Ruby on Rails no tiene manera de trackear esto y verdaderamente invalidad la cookie con la configuracion por defecto. Esto significa que persiste ""de por vida"" y puede ser usada para acceder a aplicaciones inclusive cuando se piensa que se termino la sesion.",,"Actualmente, no se conocen actualizaciones o parches para corregir esta vulnerabilidad. Si es posible migrar temporalmente implementando un sistema de autenticacion mas seguro (e.g. ActiveRecordStore).",,
1730 ,EN-Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
1731 ,EN-Session Cookie without Secure flag set,"This cookie does not have the Secure flag set. When a cookie is set with the Secure flag, it instructs the browser that the cookie can only be accessed over secure SSL channels. This is an important security protection for session cookies.",,"If possible, you should set the Secure flag for this cookie.",low,
1732 ,EN-Session Cookie without HttpOnly flag Set,"This cookie does not have the HTTPOnly flag set. When a cookie is set with the HTTPOnly flag, it instructs the browser that the cookie can only be accessed by the server and not by client-side scripts. This is an important security protection for session cookies.",,"If possible, you should set the HTTPOnly flag for this cookie.",Low,
1733 ,EN-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
1734 Se ha detectado un problema en las versiones de apache 1.3.0, 2.0.x hasta 2.0.64 y 2.2.X hasta 2.2.19 que mediante una herramienta automatizada un atacante usand una moderada cantidad de request puede causar un uso significativo de memoria y CPU en el servidor. Datos: http://seclists.org/fulldisclosure/2011/Aug/175.",,Actualizar version de apache,,
1735 ,EN-Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
1736 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
1737 Disallow: /*AB/$
1738 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",,
1739 ,EN-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
1740 ,EN-Credentials in Plain Text,La pagina de login viaja sobre texto plano,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
1741 ,EN-Unencrypted __VIEWSTATE parameter,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
1742 <machineKey validation=""3DES""/>",,
1743 ,EN-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
1744
1745 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
1746 style=""border-width:0px;"" />
1747
1748 Siendo la respuesta THHvB
1749
1750 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
1751 ,EN-Application error message,"This page contains an error/warning message that may disclose sensitive information.The message can also contain the location of the file that produced the unhandled exception.
1752
1753 The error messages may disclose sensitive information. This information can be used to launch further attacks.",,Review the source code for this script. The application need to show generic errors.,,
1754 ,EN-Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1755 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,,
1756 ,EN-Input Password with Autocomplete Enable,"Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. If an attacker gain access to a computer its possible of get credentials back.",,"You should include the attribute Autocomplete OFF:
1757 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
1758 ,Backup FilesEN-,"Backup files can contain script sources, configuration files or other sensitive information that may help an malicious user to prepare more advanced attacks",,"Remove the file(s) if they are not required on your website. As an additional step, it is recommended to implement a security policy within your organization to disallow creation of backup files in directories accessible from the web.",,
1759 ,EN-Sesintive directory,"A possible sensitive directory has been found. This directory is not directly linked from the website.This check looks for common sensitive resources like backup directories, database dumps, administration pages, temporary directories. Each one of these directories could help an attacker to learn more about his target.",,,,
1760 ,EN-Slow HTTP Denial of Service Attack,"Slowloris and Slow HTTP POST DoS attacks rely on the fact that the HTTP protocol, by design, requires requests to be completely received by the server before they are processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. If the server keeps too many resources busy, this creates a denial of service.",,It's important to configure the timout values on the Webserver. Here is a link to a guide on how to prevent this kind of attack: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1761 ,EN-Clickjacking,"It might be possible for a web page controlled by an attacker to load the content of this response within an iframe on the attacker's page. This may enable a ""clickjacking"" attack, in which the attacker's page overlays the target application's interface with a different interface provided by the attacker. By inducing victim users to perform actions such as mouse clicks and keystrokes, the attacker can cause them to unwittingly carry out actions within the application that is being targeted. This technique allows the attacker to circumvent defenses against cross-site request forgery, and may result in unauthorized actions. Ref:http://javascript.info/tutorial/clickjacking",,"To effectively prevent framing attacks, the application should return a response header with the name X-Frame-Options and the value DENY to prevent framing altogether, or the value SAMEORIGIN to allow framing only by pages on the same origin as the response itself.",Low,
1762 ,EN-OPTIONS method is enabled,"HTTP OPTIONS method is enabled on this web server. The OPTIONS method provides a list of the methods that are supported by the web server, it represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
1763 The OPTIONS method may expose sensitive information that may help an malicious user to prepare more advanced attacks.",,It's recommended to disable OPTIONS Method on the web server.,Low,
1764 ,EN-TLS1/SSLv3 Renegotiation Vulnerability,"A vulnerability in the way SSL and TLS protocols allow renegotiation requests may allow an attacker to inject plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
1765 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
1766 ,EN-Email address found,One or more email addresses have been found on this page. The majority of spam comes from email addresses harvested off the internet. The spam-bots (also known as email harvesters and email extractors) are programs that scour the internet looking for email addresses on any website they come across. Spambot programs look for strings like [email protected] and then record any addresses found.,,,,
1767 ,EN-File Inclusion,It is possible for a remote attacker to include a file from local or remote resources and/or execute arbitrary script code with the privileges of the webserver.,,"Edit the source code to ensure that input is properly validated. Where is possible, it is recommended to make a list of accepted filenames and restrict the input to that list.
1590 ,Email address found,One or more email addresses have been found on this page. The majority of spam comes from email addresses harvested off the internet. The spam-bots (also known as email harvesters and email extractors) are programs that scour the internet looking for email addresses on any website they come across. Spambot programs look for strings like [email protected] and then record any addresses found.,,,,
1591 ,File Inclusion,It is possible for a remote attacker to include a file from local or remote resources and/or execute arbitrary script code with the privileges of the webserver.,,"Edit the source code to ensure that input is properly validated. Where is possible, it is recommended to make a list of accepted filenames and restrict the input to that list.
17681592
17691593 For PHP, the option allow_url_fopen would normally allow a programmer to open, include or otherwise use a remote file using a URL rather than a local file path. It is recommended to disable this option from php.ini.",,
1770 ,EN-User Credentials Sent in Clear Text,"Vulnerability description
1594 ,User Credentials Sent in Clear Text,"Vulnerability description
17711595 User credentials are transmitted over an unencrypted channel. This information should always be transferred via an encrypted channel (HTTPS) to avoid being intercepted by malicious users.
17721596
17731597 The impact of this vulnerability
17741598 A third party may be able to read the user credentials by intercepting an unencrypted HTTP connection.",,"Because user credentials are considered sensitive information, should always be transferred to the server over an encrypted connection (HTTPS).",,
1775 ,EN-URL Redirection,"This script is possibly vulnerable to URL redirection attacks.
1599 ,URL Redirection,"This script is possibly vulnerable to URL redirection attacks.
17761600
17771601 URL redirection is sometimes used as a part of phishing attacks that confuse visitors about which web site they are visiting.
17781602
17791603 The impact of this vulnerability
17801604 A remote attacker can redirect users from your website to a specified URL. This problem may assist an attacker to conduct phishing attacks, trojan distribution, spammers.",,Your script should properly sanitize user input.,,
1781 ,EN-Microsoft IIS tilde directory enumeration,"It is possible to detect short names of files and directories which have an 8.3 file naming scheme equivalent in Windows by using some vectors in several versions of Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1782 ,EN-SQL Injection,"SQL injection is a vulnerability that allows an attacker to alter back-end SQL statements by manipulating the user input. An SQL injection occurs when web applications accept user input that is directly placed into a SQL statement and doesn't properly filter out dangerous characters.
1605 ,Microsoft IIS tilde directory enumeration,"It is possible to detect short names of files and directories which have an 8.3 file naming scheme equivalent in Windows by using some vectors in several versions of Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1606 ,SQL Injection,"SQL injection is a vulnerability that allows an attacker to alter back-end SQL statements by manipulating the user input. An SQL injection occurs when web applications accept user input that is directly placed into a SQL statement and doesn't properly filter out dangerous characters.
17831607
17841608 This is one of the most common application layer attacks currently being used on the Internet. Despite the fact that it is relatively easy to protect against, there is a large number of web applications vulnerable.
17851609
17901614 Certain SQL Servers such as Microsoft SQL Server contain stored and extended procedures (database server functions). If an attacker can obtain access to these procedures it may be possible to compromise the entire machine.",,"Your script should filter metacharacters from user input.
17911615 Check detailed information for more information about fixing this vulnerability.
17921616 Detailed information",,
1793 ,EN-ASP.NET debugging enabled,"ASP.NET debugging is enabled on this application. It is recommended to disable debug mode before deploying a production application. By default, debugging is disabled, and although debugging is frequently enabled to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.",,"It may be possible to disclose sensitive information about the web sever the ASP.NET application.
1617 ,ASP.NET debugging enabled,"ASP.NET debugging is enabled on this application. It is recommended to disable debug mode before deploying a production application. By default, debugging is disabled, and although debugging is frequently enabled to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.",,"It may be possible to disclose sensitive information about the web sever the ASP.NET application.
17941618 More information on how to fix it:
17951619 http://support.microsoft.com/default.aspx?scid=kb;en-us;815157",,
1796 ,EN-Unicode tranformation Issues,"This page is vulnerable to various Unicode transformation issues such as Best-Fit Mappings, Overlong byte sequences, Ill-formed sequences.
1620 ,Unicode tranformation Issues,"This page is vulnerable to various Unicode transformation issues such as Best-Fit Mappings, Overlong byte sequences, Ill-formed sequences.
17971621 Best-Fit Mappings occurs when a character X gets transformed to an entirely different character Y. In general, best-fit mappings occur when characters are transcoded between Unicode and another encoding.
17981622
17991623 Overlong byte sequences (non-shortest form) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
18121636 http://www.cl.cam.ac.uk/~mgk25/unicode.html
18131637 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
18141638 http://www.unicode.org/reports/tr36/",,
1815 ,EN-File Upload XSS,"This script is possibly vulnerable to XSS (Cross-site scripting). The web application allows file upload and Acunetix WVS was able to upload a file containing HTML content. When HTML files are allowed, XSS payload can be injected in the file uploaded. Check Attack details for more information about this attack.
1639 ,File Upload XSS,"This script is possibly vulnerable to XSS (Cross-site scripting). The web application allows file upload and Acunetix WVS was able to upload a file containing HTML content. When HTML files are allowed, XSS payload can be injected in the file uploaded. Check Attack details for more information about this attack.
18161640
18171641 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Restrict file types accepted for upload: check the file extension and only allow certain files to be uploaded. Use a whitelist approach instead of a blacklist. Check for double extensions such as .php.png. Check for files without a filename like .htaccess (on ASP.NET, check for configuration files like web.config). Change the permissions on the upload folder so the files within it are not executable. If possible, rename the files that are uploaded.
18181642
18191643 https://www.owasp.org/index.php/Unrestricted_File_Upload
18201644 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
1821 ,EN-Possible virtual host found,"Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name.
1645 ,Possible virtual host found,"Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name.
18221646
18231647 This web server is responding differently when the Host header is manipulated and various common virtual hosts are tested. This could indicate there is a Virtual Host present.",,Consult the virtual host configuration and check if this virtual host should be publicly accessible,,
1824 ,EN-Host header attack,"An attacker can manipulate the Host header as seen by the web application and cause the application to behave in unexpected ways.
1648 ,Host header attack,"An attacker can manipulate the Host header as seen by the web application and cause the application to behave in unexpected ways.
18251649 Developers often resort to the exceedingly untrustworthy HTTP Host header (_SERVER[""HTTP_HOST""] in PHP).
18261650 Even otherwise-secure applications trust this value enough to write it to the page without HTML-encoding it with code equivalent to:
18271651
18341658 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)
18351659
18361660 Host header *********evilhostDx5oMrAd.com was reflected inside a A tag (href attribute).",,"The web application should use the SERVER_NAME instead of the Host header. It should also create a dummy vhost that catches all requests with unrecognized Host headers. This can also be done under Nginx by specifying a non-wildcard SERVER_NAME, and under Apache by using a non-wildcard serverName and turning the UseCanonicalName directive on. Consult references for detailed information.",,
1837 ,EN-jQuery cross site scripting,"This page is using an older version of jQuery that is vulnerable to a Cross Site Scripting vulnerability. Many sites are using to select elements using location.hash that allows someone to inject script into the page. This problem was fixed in jQuery 1.6.3 and up.
1661 ,jQuery cross site scripting,"This page is using an older version of jQuery that is vulnerable to a Cross Site Scripting vulnerability. Many sites are using to select elements using location.hash that allows someone to inject script into the page. This problem was fixed in jQuery 1.6.3 and up.
18381662 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Update to the latest version of jQuery.
18391663 More info: http://ma.la/jquery_xss/
18401664 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
1841 ,EN-Login Page password-guessing attack,"A common threat web developers face is a password-guessing attack known as a brute force attack. A brute-force attack is an attempt to discover a password by systematically trying every possible combination of letters, numbers, and symbols until you discover the one correct combination that works.
1665 ,Login Page password-guessing attack,"A common threat web developers face is a password-guessing attack known as a brute force attack. A brute-force attack is an attempt to discover a password by systematically trying every possible combination of letters, numbers, and symbols until you discover the one correct combination that works.
18421666
18431667 This login page doesn't have any protection against password-guessing attacks (brute force attacks). It's recommended to implement some type of account lockout after a defined number of incorrect password attempts. Consult Web references for more information about fixing this problem.
18441668
18451669 The scanner tested 10 invalid credentials and no account lockout was detected.",,"It's recommended to implement some type of account lockout after a defined number of incorrect password attempts.
18461670 More info:
18471671 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
1848 ,EN-Error page web server version disclosure,"By requesting a page that doesn't exist, an error page was returned. This error page contains the web server version number and a list of modules enabled on this server. This information can be used to conduct further attacks. Possible sensitive information disclosure.",,"If you are using Apache, you can setup a custom 404 page by following the instructions provided in the References section.",,
1849 ,EN-SSL weak ciphers,"The remote host supports the use of SSL ciphers that offer either weak encryption or no encryption at all.
1672 ,Error page web server version disclosure,"By requesting a page that doesn't exist, an error page was returned. This error page contains the web server version number and a list of modules enabled on this server. This information can be used to conduct further attacks. Possible sensitive information disclosure.",,"If you are using Apache, you can setup a custom 404 page by following the instructions provided in the References section.",,
1673 ,SSL weak ciphers,"The remote host supports the use of SSL ciphers that offer either weak encryption or no encryption at all.
18501674 This vulnerability affects Server.",,Reconfigure the affected application to avoid use of weak ciphers.,,
1851 ,EN-CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) is a security exploit against secret web cookies over connections using the HTTPS and SPDY protocols that also use data compression. When used to recover the content of secret authentication cookies, it allows an attacker to perform session hijacking on an authenticated web session, allowing the launching of further attacks.
1675 ,CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) is a security exploit against secret web cookies over connections using the HTTPS and SPDY protocols that also use data compression. When used to recover the content of secret authentication cookies, it allows an attacker to perform session hijacking on an authenticated web session, allowing the launching of further attacks.
18521676
18531677 CRIME is a client-side attack, but the server can protect the client by refusing to use the feature combinations which can be attacked. For CRIME, the weakness is Deflate compression. This alert is issued if the server accepts Deflate compression.
18541678
18571681 Web references
18581682 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
18591683 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",,
1860 ,EN-Insecure transition from HTTPS to HTTP in form post,"This secure (https) page contains a form that is posting to an insecure (http) page. This could confuse users who may think their data is encrypted when in fact it's not.
1684 ,Insecure transition from HTTPS to HTTP in form post,"This secure (https) page contains a form that is posting to an insecure (http) page. This could confuse users who may think their data is encrypted when in fact it's not.
18611685 Impact: Possible information disclosure.",,The form target should point to a secure (https) page.,,
1862 ,EN-TRACE method is enabled,"HTTP TRACE method is enabled on this web server. In the presence of other cross-domain vulnerabilities in web browsers, sensitive header information could be read from any domains that support the HTTP TRACE method.
1686 ,TRACE method is enabled,"HTTP TRACE method is enabled on this web server. In the presence of other cross-domain vulnerabilities in web browsers, sensitive header information could be read from any domains that support the HTTP TRACE method.
18631687
18641688 Attackers may abuse HTTP TRACE functionality to gain access to information in HTTP headers such as cookies and authentication data.",,"Disable TRACE Method on the web server.
18651689
18661690 Web references
18671691 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
18681692 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",,
1869 ,EN-SSL certificate public key less than 2048 bit,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,"If you have any 1024-bit certificates or certificates with less than 2048-bit key length, you will need to migrate to 2048-bit key length.
1693 ,SSL certificate public key less than 2048 bit,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,"If you have any 1024-bit certificates or certificates with less than 2048-bit key length, you will need to migrate to 2048-bit key length.
18701694
18711695 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
1872 ,EN-Ruby on Rails CookieStore session cookie persistence,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",,"Currently, there are no known upgrades or patches to correct this vulnerability. It is possible to temporarily mitigate the flaw by implementing the following workaround: switch to a more secure authentication management systems (e.g. ActiveRecordStore).",,
1873 ,EN-Remote Code Execution - ms_08_067 netapi,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,,High,
1874 ,EN-Windows Print Spooler Components Vulnerability - MS13-001,"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
1696 ,Ruby on Rails CookieStore session cookie persistence,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",,"Currently, there are no known upgrades or patches to correct this vulnerability. It is possible to temporarily mitigate the flaw by implementing the following workaround: switch to a more secure authentication management systems (e.g. ActiveRecordStore).",,
1697 ,Remote Code Execution - ms_08_067 netapi,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,,High,
1698 ,Windows Print Spooler Components Vulnerability - MS13-001,"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
18751699 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,
1876 ,ES-Credenciales Repetidas,Existen multiples credeciales repetidas para un mismo acceso.,"Tener credenciales repetidas de un mismo servidor o acceso, posibilita a un atacante tener mayor impacto, pues utilizando un mismo password puede ingresar a distintos servicios o áreas",Evitar utilizar mismas credenciales en distintos servicios,High,
1877 ,ES-Ftp Anonimo,Es servicio de FTP posee el usuario : anonymous,"Los servidores FTP anónimos ofrecen sus servicios libremente a todos los usuarios, permiten acceder a sus archivos sin necesidad de tener un 'USER ID' o una cuenta de usuario. Es la manera más cómoda fuera del servicio web de permitir que todo el mundo tenga acceso a cierta información sin que para ello el administrador de un sistema tenga que crear una cuenta para cada usuario.
1878
1879 Si un servidor posee servicio 'FTP anonymous' solamente con teclear la palabra «anonymous», cuando pregunte por tu usuario tendrás acceso a ese sistema. No se necesita ninguna contraseña preestablecida, aunque tendrás que introducir una sólo para ese momento, normalmente se suele utilizar la dirección de correo electrónico propia.",Evitar usuario anonimo,Medium,
1880 ,ES-Credenciales débiles Tomcat,"Se detectaron credenciales por defecto en servidores Tomcat, ejecutándose con privilegios elevados.
1881 Un atacante que intente loguearse con una lista de usuarios por defecto podría comprometer el servicio.
1882 En este caso en particular el usuario “admin” es muy común en servidores Tomcat, y cuenta con privilegios para ejecutar código, por lo que debe ser protegido con una contraseña fuerte.",,Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.,High,
1883 ,ES-Wpad Spoofing,"En los ambientes Windows ante una falla a resolver un nombre de host,
1884 realizan una segunda búsqueda utilizando NetBios. La naturaleza de este
1885 pedido realizado utilizando broadcast es inseguro si no se tienen
1886 recaudos.
1887
1888 Un atacante podría utilizar esta vulnerabilidad para
1889 registrar el dominio WPAD en netbios con el fin de redirigir y modificar
1890 el tráfico de las workstations con las que comparte el segmento de red.
1891 Este ataque podría derivar en la captura de credenciales o hashes que
1892 le brinden acceso a sistemas críticos.",,"Deshabilitar la configuración automática de proxy en los equipos
1893 windows, y registrar el nombre de domino wpad, para que ningún equipo de
1894 la red pueda impersonarlo.",High,
1895 ,ES-Servicio de Telnet,"Las credenciales de usuario se transmiten sobre un canal sin cifrar (servicio telnet).
1896 Un atacante capaz de interceptar el tráfico entre los hosts y el usuario remoto, será capaz de obtener las credenciales utilizadas.",,"Reemplazar los servicios que permiten el envío de credenciales en texto plano, por aquellos que lo hacen de forma cifrada. En este caso, existen diferentes alternativas para reemplazar los servicios de administración remota, como por ejemplo ssh o rdp.",Medium,
1897 ,ES-Tokens cacheados,"Fue posible impersonar diferentes usuarios de dominio, incluido un administrador de dominio, a través de los tokens de acceso cacheados en el servidor.",,"No existe un parche para resolver este tipo de situaciones, ya que los tokens de acceso son propios de la arquitectura de Windows. Sin embargo es posible implementar algunas medidas a nivel operativo para mitigar en gran parte el impacto del cacheo de tokens. Recomendamos:
1898 > Asegurarse que usuarios con altos privilegios (especialmente administradores) tengan una cuenta específica para tareas de administración y otra para loguearse en sus sistemas.
1899 > Ejecutar aquellas tareas que requieran mayores privilegios utilizando la aplicación “RunAs”.
1900 > Asegurarse que los Domain Admins sólo sean utilizados para administrar el dominio. Crear diferentes cuentas de dominio y asignarle autorización administrativa solo para la unidad de negocio correspondiente.
1901 > Asegurarse que las cuentas administrativas de ambientes de desarrollo y test sean diferentes a las de los sistemas críticos de producción.
1902 > Ejecutar los servicios necesarios para el correcto funcionamiento de la unidad de negocio en un equipo diferente al Controlador de Dominio.
1903 > Utilizar la opción de Active Directory “Account is sensitive and cannot be delegated” (sólo aplica a los logueos interactivos, pero ayuda a reforzar la seguridad de la cuenta).
1904
1905 Referencias:
1906 http://carnal0wnage.attackresearch.com/2008/05/token-passing-with-incognito-part-2.html
1907 http://pentestmonkey.net/uncategorized/from-local-admin-to-domain-admin
1908 http://www.offensive-security.com/metasploit-unleashed/Fun_With_Incognito",High,
1909 ,ES-Denegacion de Servicios(DOS),"un ataque de denegación de servicios, también llamado ataque DoS (de las siglas en inglés Denial of Service) o DDoS (de Distributed Denial of Service), es un ataque a un sistema de computadoras o red que causa que un servicio o recurso sea inaccesible a los usuarios legítimos. Normalmente provoca la pérdida de la conectividad de la red por el consumo del ancho de banda de la red de la víctima o sobrecarga de los recursos computacionales del sistema de la víctima",,La forma de prevenirlo: https://www.owasp.org/index.php/Denial_of_Service,High,
1910 ,ES-Revelacion de Informacion (Information Disclosure),Se puede obtener una información sensible del usuario. Esto podría ayudar a un atacante a tener control de una base de datos ó permitirle escalar hacia otro vector de ataque.,,"Determinar si esta información debería ser accesible desde la red, sin estar protegida por credenciales.",Medium,
1911 ,ES-Sitio sin Informar,,,/reclamaciones/home/index. ,,
1912 ,ES-Listado de Directorios,Muestra directorios que no deberian ser publicos,,Evitar que dichos directorios sean publicos,Medium,
1913 ,ES-Shell,"Una shell es parte de codigo programado en (PHP,Python,Ruby,etc) que una vez que es subido al host victima, puede ser utilizado para subir, bajar, borrar archivos.",,"Evitar entradas que posibiliten subir imagenes o codigo al servidor, sin ser adecuadamente controlado",,
1914 ,ES-Path Disclosure,Permite ver la ruta a archivos u aplicaciones que no deberian ser mostradas,,"Puede solucionarse desactivando los mensajes de error :
1915 En PHP modificando el archivo php.ini ( display_errors = 'off' )
1916 En Apache modificando el archivo httpd.conf ( php_flag display_errors off)",,
1917 ,ES-File Upload,Es posible subir código o imagenes sin ser fitradas adecuadamente.,,Evitar campos para subir archivos que no sean correctamente filtrados,,
1918 ,ES-Metodo Put habilitado (Put File Allow),"Sube, carga o realiza un upload de un recurso especificado (archivo), es el camino más eficiente para subir archivos a un servidor.",,"Evitar que el metodo PUT se encuentre con libre acceso a cualquier tipo de usuario, restringir acceso.",,
1919 ,ES-Leer Archivos (Read files),,,,,
1920 ,ES-Usuarios por defecto(default users),"Se debe evitar utilizar usuarios y contraseñas por defecto, pues el sistema puede quedar suseptible a un ataque de fuerza bruta o de diccionario.",,Cambiar usuarios y contraseñas de acuerdo a las politicas de la empresa,,
1921 ,ES-Sslstrip Attack,"Dado que la página no esta utilizando https para proteger sus credenciales, el panel de ingreso esta implementedo mediante http, y no https, es posible modificar los recursos obtenidos, si el atacante logra intereceptar la comunicación entre ambos sitios. ",,"Cargar todos los recursos a través de https, para los recursos externos recomendamos incluir los mismo de la siguiente manera src=""//dominio.com/recurso.js"" de esta manera el navegador automaticamete incluye el protocolo http o https segun la conexion inicial que genera.",High,
1922 ,ES-Enumerar Usuarios,,,,Medium,
1923 ,ES-Login User HTTP,"Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Utilizar HTTPS para autenticar usuarios,Medium,
1924 ,ES-Falta de Control de Acceso,Se puede acceder a parte del sitio sin una sesion valida,,Validar correctamente la sesiones del sitio verifiquen que el usuario poseen una sesion valida,Medium,
1925 ,ES-Cookie Reutilization,La cookie puede ser modificada y reutilizada para hacer nuevas consultas o impersonar usuarios,,Evitar ,Medium,
1926 ,ES-Credenciales Debiles md5,"Se detecto que dentro del request se envía el nombre de usuario y la contraseña hasheada. Si bien la contraseña utiliza una funcion de md5, lo hace sin salt para protegerla.
1927 Con lo cual un atacante que la intercepte, puede decifrar el md5 para luego obtener la contraseña en texto plano junto con el usuario para acceder al sistema.",,"Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.
1928 Se recomienda un cifrado mas robusto con la funcion salt",High,
1929 ,ES-CSRF,"Un ataque CSRF fuerza al navegador web validado de una víctima a enviar una petición a una aplicación web vulnerable, la cual entonces realiza la acción elegida a través de la víctima. Al contrario que en los ataques XSS, los cuales explotan la confianza que un usuario tiene en un sitio en particular, el cross site request forgery explota la confianza que un sitio tiene en un usuario en particular.",,"Recomendamos la imprementacion de un feature anti-csrf con el fin de autenticar todoslos request,en particual aquellas peticiones sensibles como por ejemplo el cambiode contraseñas y asignacion de roles (dar permisos de administrador a un usuario). El framework de ASP.net cuenta con este feature llamado viewstate (https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Viewstate_.28ASP.NET.29)",Medium,
1930 ,ES-SSL weak ciphers (Cifrado debil),El servidor remoto soporta el uso de SSL pero ofrece una encriptacion debil,,Reconfigurar el servidor web con un nivel de encriptacion mayor,Medium,
1931 ,EN-Android Debugging Activated,The Application has enabled Debugging in it's manifiest. This feature allows an attacker to debug native code and sensitive information could be retrived using this vector,,Set to false debuging features in production releases,,
1932 ,EN-Flash Crossdomain policy,The application publishes a Flash cross-domain policy which allows access from any domain.,,The policy must include the domains which are allowed by the Flash cross-domain policy,Medium,
1933 ,EN-Session Token in URL,The Session token is included in the URL. This could leak the session token,,Session tokens should only be included using safe channels,Medium,
1934 ,ES-Token de Session en URL,"Información sensible dentro de las URLs puede ser guardado en distintas lugares, por ejemplo en la información del navegador del usuario, en el webserver, o en cualquier proxy o reverse proxy. Las URLs se pueden ver en las pantallas, puede ser guardadas como favoritos o pueden ser enviada entre los usuarios. Esta información puede ser obtenida también como referer, en el histórico de la ultima pagina desde donde se ingresa a otra pagina. Guardar la sesiones en las URLs incrementa que esa información sea captura por un atacante para luego impersonarse como un usuario valido.",,La aplicación debería utilizar otros mecanismos para el envió de las sessiones como cookies o campos ocultos enviados a traves de métodos de POST ,Medium,
1935 ,ES-Autenticacion sin HTTPS,"La aplicación web no utiliza HTTPS para la autenticación de usuarios al sistema. Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Siempre utilizar HTTPS para autenticar usuarios,High,
1936 ,Es-Version Obsoleta / Desactualizada,"El servidor se encuentra utilizando una versión de Apache Tomcat MUY desactualizada (Apache Tomcat/4.1.31), la cual es vulnerable a multiples vulnerabilidades publicas. Actualmente la ultima versión estable es la 8.0.9 ",,"Recomendación actualizar y desactivar los mensajes de error del servidor, que puedan brindar información extra a un atacante",Medium,
1937 ,ES-Numero de Tarjeta en Texto Plano,"La respuesta del servidor, contiene el numero de tarjeta de crédito y otra información sensible que debería evitarse enviar en texto plano.",,Utilizar HTTPS en todo el sitio en donde la información sensible pueda ser expuesta.,High,
1938 ,ES-Server Version Discloure,El servidor web responde con la version del sistema facilitando a un atacante saber contra que se enfrenta,,"Filtrar en las respuestas del servidor, cualquier dato que demuestre la version del servidor y del sistema operativo del mismo",Low,
1939 ,EN-Insecure crossdomain.xml file,"The browser security model normally prevents web content from one domain from accessing data from another domain. This is commonly known as the ""same origin policy"". URL policy files grant cross-domain permissions for reading data. They permit operations that are not permitted by default. The URL policy file is located, by default, in the root directory of the target server, with the name crossdomain.xml (for example, at www.example.com/crossdomain.xml).
1700 ,Android Debugging Activated,The Application has enabled Debugging in it's manifiest. This feature allows an attacker to debug native code and sensitive information could be retrived using this vector,,Set to false debuging features in production releases,,
1701 ,Flash Crossdomain policy,The application publishes a Flash cross-domain policy which allows access from any domain.,,The policy must include the domains which are allowed by the Flash cross-domain policy,Medium,
1702 ,Session Token in URL,The Session token is included in the URL. This could leak the session token,,Session tokens should only be included using safe channels,Medium,
1703 ,Insecure crossdomain.xml file,"The browser security model normally prevents web content from one domain from accessing data from another domain. This is commonly known as the ""same origin policy"". URL policy files grant cross-domain permissions for reading data. They permit operations that are not permitted by default. The URL policy file is located, by default, in the root directory of the target server, with the name crossdomain.xml (for example, at www.example.com/crossdomain.xml).
19401704
19411705 When a domain is specified in crossdomain.xml file, the site declares that it is willing to allow the operators of any servers in that domain to obtain any document on the server where the policy file resides. The crossdomain.xml file deployed on this website opens the server to all domains (use of a single asterisk ""*"" as a pure wildcard is supported) like so:
19421706 <cross-domain-policy>
19461710
19471711 Using an insecure cross-domain policy file could expose your site to various attacks.",,"Carefully evaluate which sites will be allowed to make cross-domain calls. Consider network topology and any authentication mechanisms that will be affected by the configuration or implementation of the cross-domain policy.
19481712 ",Medium,
1949 ,ES-Archivo crossdomain.xml inseguro,"El modelo de seguridad del navegador normalmente previene el contenido web de ser accedido desde otro dominio. Esto comunmente es conocido como ""same origin policy"" (""politica del mismo origen""). Lo politica de archivos URL garantiza acceso cross-dominio para leer datos. Permiten operaciones que no son permitidas por defecto. La politica de acceso de archivo URL esta localizado, por defecto, en el directorio raiz del servidor destino, con el nombre crossdomain.xml (por ejemplo en www.ejemplo.com/crossdomain.xml).
1950
1951 Cuando un dominio es especificado en el archivo crossdomain.xml, el sitio declara que esta dispuesto a dar acceso a operadores de cualqueir server en ese dominio para obtener cualquier documento donde la regla reside. El archivo crossdomain.xml desplegado en este servidor web abre el servidor a todos los dominios (uso de un unico asterisco ""*"" de comodin es soportado) Como por ejemplo:
1952 <cross-domain-policy>
1953 <allow-access-from domain=""*"" />
1954 </cross-domain-policy>
1955
1956 Esta practica es correcta para servidores publicos, pero no deberia ser usada en servidores que se encuentran tras un firewall porque puede permitir acceso a areas protejidas. No deberia ser usada para sitios que requieren autenticacion en forma de contraseñas o cookies. ",,"Detenidamente evaluar que sitios deben tener permitido el acceso cross-dominio. Considerar la topologia de red y todos los mecanismos de autenticacion afectados por la configuracion o implementacion de la politica cross-domain.
1957 ",Medium,
1958 ,EN-BREACH attack,"This web application is potentially vulnerable to the BREACH attack.
1713 ,BREACH attack,"This web application is potentially vulnerable to the BREACH attack.
19591714 An attacker with the ability to:
19601715 Inject partial chosen plaintext into a victim's requests
19611716 Measure the size of encrypted traffic
19831738 Rate-limiting the requests
19841739
19851740 More information http://breachattack.com/",,
1986 ,ES-Archivos de backup en servidor de producción,"La aplicación web tiene multiples archivos de buckup disponibles para ser descargados, los cuales brindan información de la tecnología que se utiliza en el sitio, así como código fuente de las aplicaciones, nombres de usuarios, rutas de acceso y multiple información sensible del mismo.",,"Es recomendable aplicar buenas politicas deprotección de información sensible, evitando exponer buckups y otra información del sitio web",Very High,
1987 ,ES-Exposición de información a través del listado de directorios,"Estos directorios no deberian estar publicos, pues exponen información sensible del tipo de tecnología utilizada, código de programación, información sobre rutas de acceso a distintos lugares, particularmente en este caso podemos listar toda la información del servidor sin ningun tipo de restricción",,Siempre evitar que se puedan listar directorios de manera externa y sin permisos,High,
1988 ,ES-Archivos con información sensible,"Es posible acceder a archivos con información sensible, podemos ver el ""log error"" y dentro de este rutas de acceso, nombres de usuario, etc . Con lo cual un atacante con tiempo podría intentar obtener credeciales de un servicio ssh, ftp,o similar para luego crackearlo.
1989 ",,Evitar exponer toda información sensible del sistema,High,
1990 ,ES-Revelación de IP interno,"La aplicación expone ip/s interno, con lo cual si por algun vector de ataque un atacante logra acceder al servidor o servicio podría continuar la explotación por dicho vector",,Evitar exponer toda información sensible y privada del sistemadel sistema,Low,
1991 ,ES-Archivos e información de desarollo en ambientes productivos,"Podemos ver código de programacion, con ejemplos concretos del funcionamiento interno y
1992 de la lógica utilizada a la hora de programar, dejando en evidencia
1993 informacion como nombres de usuarios, email, dni, telefonos, etc ",,Evitar exponer toda información sensible y privada del sistemadel sistema,High,
1994 ,ES-Sentencias SQL sin Prepared Statement,Se detecto que se utilizan una mala implementacion de sentencias SQL concatenando las variables manualmente pudiendo un atacante realizar ataques de SQL Injection,,"Utilizar para la sentencia de SQL Prepared Statement
1995 Reference:
1996 https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet#Prepared_Statement_Examples",High,
1997 ,ES-Mysql lectura y escritura de archivos,Es posible utilizar mysql server para la lectura y escritura de archivos en el servidor,,"Seguir los siguientes lineamientos para el hardening de Mysql Server
1998 https://www.owasp.org/index.php/Testing_for_MySQL#Read_from_a_File",High,
1999 ,ES-Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
2000 ,ES-Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
2001 ,EN-Internal IP Address Disclosure,A string matching an internal IPv4 address was found on this page. This may disclose information about the IP addressing scheme of the internal network. This information can be used to conduct further attacks.,,Prevent this information from being displayed to the user,Low,
2002 ,ES-Internal IP Address Disclosure,Una cadena coincidente con una direccion interna de IPv4 fue encontrada en esta pagina. Esto lleva a divulgar informacion sensible acerca del esquema de la red interna. Esta informacion puede ser usada para generar ataques especificos.,,Se recomienda prevenir que esta informacion sea mostrada al usuario,Low,
2003 ,EN-ASP.NET MAC disabled,"By default, the serialized value is signed by the server to prevent tampering by the user; however, this behavior can be disabled by setting the Page.EnableViewStateMac property to false. If this is done, then an attacker can modify the contents of the ViewState and cause arbitrary data to be deserialized and processed by the server. If the ViewState contains any items that are critical to the server's processing of the request, then this may result in a security exposure.",,Set the Page.EnableViewStateMac property to true on any pages where the ViewState is not currently signed.,Low,
2004 ,ES-Cisco ASA Error,"El Cisco ASA es vulnerable a un Information Leak (CVE-2014-3392), un atacante podria obtener credenciales em base a un error.",,Actualizar a la ultima version del firmware del CISCO ASA,High,
2005 ,ES-Listado de directorios,"Evitar listar directorios, muchas veces a partir de aqui se pueden realizar distintos vectores de ataques, por claves almacenadas en archivos ocultos o por tener acceso a archivos de configuracion. ",,"Evitar listar directorios, es recomendable que se desabiliten o se resguarden con algun tipo de autenticacion.",Low,
2006 ,EN-Cifrado Debil (SSL weak ciphers),"El host remoto es compatible con el uso de sistemas de cifrado SSL que ofrecen ya sea cifrado debil o sin cifrado en absoluto.
2007 Esta vulnerabilidad afecta Server.",,Vuelva a configurar la aplicacion afectada para evitar el uso de cifrados debiles.,Medium,
1741 ,Internal IP Address Disclosure,A string matching an internal IPv4 address was found on this page. This may disclose information about the IP addressing scheme of the internal network. This information can be used to conduct further attacks.,,Prevent this information from being displayed to the user,Low,
1742 ,ASP.NET MAC disabled,"By default, the serialized value is signed by the server to prevent tampering by the user; however, this behavior can be disabled by setting the Page.EnableViewStateMac property to false. If this is done, then an attacker can modify the contents of the ViewState and cause arbitrary data to be deserialized and processed by the server. If the ViewState contains any items that are critical to the server's processing of the request, then this may result in a security exposure.",,Set the Page.EnableViewStateMac property to true on any pages where the ViewState is not currently signed.,Low,
0 cwe,name,desc_summary,description,resolution,exploitation,references
1 CWE-119,EN-Improper Restriction of Operations within the Bounds of a Memory Buffer (Type: Class),"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
2 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127; Chapter 14, ""Prevent I18N Buffer Overruns"" Page 441
3 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
4 Safe C String Library v1.0.3: http://www.zork.org/safestr/
5 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
6 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
7 PaX: http://en.wikipedia.org/wiki/PaX
8 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
9 The Art of Software Security Assessment: Chapter 5, ""Memory Corruption"", Page 167.
10 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
11 CWE-123,EN-Write-what-where Condition (Type: Base),"Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
12 CWE-129,EN-Improper Validation of Array Index (Type: Base),"The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,High,"Writing Secure Code: Chapter 5, ""Array Indexing Errors"" Page 144
13 Top 25 Series - Rank 14 - Improper Validation of Array Index: http://blogs.sans.org/appsecstreetfighter/2010/03/12/top-25-series-rank-14-improper-validation-of-array-index/
14 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
15 PaX: http://en.wikipedia.org/wiki/PaX
16 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
17 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
18 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
19 CWE-194,EN-Unexpected Sign Extension (Type: Base),"The software performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.",This can happen in signed and unsigned cases.,,High,"C Language Issues for Application Security: http://www.informit.com/articles/article.aspx?p=686170&seqNum=6
20 Integral Security: http://www.ddj.com/security/193501774"
21 CWE-20,EN-Improper Input Validation (Type: Class),The product does not validate or incorrectly validates input that can affect the control flow or data flow of a program.,"When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution.",,High,"Input Validation with ESAPI - Very Important: http://manicode.blogspot.com/2008/08/input-validation-with-esapi.html
22 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
23 Hacking Exposed Web Applications, Second Edition: Input Validation Attacks
24 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
25 The importance of input validation: http://searchsoftwarequality.techtarget.com/tip/0,289483,sid92_gci1214373,00.html
26 Writing Secure Code: Chapter 10, ""All Input Is Evil!"" Page 341"
27 CWE-200,EN-Information Exposure (Type: Class),An information exposure is the intentional or unintentional disclosure of information to an actor that is not explicitly authorized to have access to that information.,"The information either
28 is regarded as sensitive within the product's own functionality, such as a private message; or
29 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
30 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,High,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
31 CWE-209,EN-Information Exposure Through an Error Message (Type: Base),"The software generates an error message that includes sensitive information about its environment, users, or associated data.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,High,"Information Leakage: http://www.webappsec.org/projects/threat/classes/information_leakage.shtml
32 Secure Programming with Static Analysis: Section 9.2, page 326.
33 Writing Secure Code: Chapter 16, ""General Good Practices."" Page 415
34 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
35 24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
36 Top 25 Series - Rank 16 - Information Exposure Through an Error Message: http://software-security.sans.org/blog/2010/03/17/top-25-series-rank-16-information-exposure-through-an-error-message
37 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
38 CWE-234,EN-Failure to Handle Missing Parameter (Type: Variant),"If too few arguments are sent to a function, the function will still pop the expected number of arguments from the stack. Potentially, a variable number of arguments could be exhausted in a function as well.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,High,
39 CWE-242,EN-Use of Inherently Dangerous Function (Type: Base),The program calls a function that can never be guaranteed to work safely.,"Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.",,High,"Herb Schildt's C++ Programming Cookbook: Chapter 5. Working with I/O
40 Writing Secure Code: Chapter 5, ""gets and fgets"" Page 163"
41 CWE-243,EN-Creation of chroot Jail Without Changing Working Directory (Type: Variant),"The program uses the chroot() system call to create a jail, but does not change the working directory afterward. This does not prevent access to files outside of the jail.","Improper use of chroot() may allow attackers to escape from the chroot jail. The chroot() function call does not change the process's current working directory, so relative paths may still refer to file system resources outside of the chroot jail after chroot() has been called.",,High,
42 CWE-268,EN-Privilege Chaining (Type: Base),"Two distinct privileges, roles, capabilities, or rights can be combined in a way that allows an entity to perform unsafe actions that would not be allowed without that combination.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,High,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
43 CWE-271,EN-Privilege Dropping / Lowering Errors (Type: Class),The software does not drop privileges before passing control of a resource to an actor that does not have those privileges.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,High,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
44 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
45 CWE-285,EN-Improper Authorization (Type: Class),The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
46 When access control checks are not applied consistently - or not at all - users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
47 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
48 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
49 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
50 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
51 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39.
52 The Art of Software Security Assessment: Chapter 11, ""ACL Inheritance"", Page 649."
53 CWE-291,EN-Reliance on IP Address for Authentication (Type: Variant),The software uses an IP address for authentication.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
54 CWE-292,EN-DEPRECATED (Duplicate): Trusting Self-reported DNS Name (Type: Variant),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
55 CWE-293,EN-Using Referer Field for Authentication (Type: Variant),"The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.","IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,"The Art of Software Security Assessment: Chapter 17, ""Referer Request Header"", Page 1030."
56 CWE-294,EN-Authentication Bypass by Capture-replay (Type: Base),A capture-replay flaw exists when the design of the software makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes).,"Capture-replay attacks are common and can be difficult to defeat without cryptography. They are a subset of network injection attacks that rely on observing previously-sent valid commands, then changing them slightly if necessary and resending the same commands to the server.",,High,
57 CWE-297,EN-Improper Validation of Certificate with Host Mismatch (Type: Variant),"The software communicates with a host that provides a certificate, but the software does not properly ensure that the certificate is actually associated with that host.","Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the software is interacting with. If the certificate's host-specific data is not properly checked - such as the Common Name (CN) in the Subject or the Subject Alternative Name (SAN) extension of an X.509 certificate - it may be possible for a redirection or spoofing attack to allow a malicious host with a valid certificate to provide data, impersonating a trusted host. In order to ensure data integrity, the certificate must be valid and it must pertain to the site that is being accessed.
58 Even if the software attempts to check the hostname, it is still possible to incorrectly check the hostname. For example, attackers could create a certificate with a name that begins with a trusted name followed by a NUL byte, which could cause some string-based comparisons to only examine the portion that contains the trusted name.",,High,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
59 Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
60 Secure programming with the OpenSSL API, Part 2: Secure handshake: http://www.ibm.com/developerworks/library/l-openssl2/index.html
61 An Introduction to OpenSSL Programming (Part I): http://www.rtfm.com/openssl-examples/part1.pdf
62 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
63 CWE-308,EN-Use of Single-factor Authentication (Type: Base),The use of single-factor authentication can lead to unnecessary risk of compromise when compared with the benefits of a dual-factor authentication scheme.,"While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,High,
64 CWE-321,EN-Use of Hard-coded Cryptographic Key (Type: Base),The use of a hard-coded cryptographic key significantly increases the possibility that encrypted data may be recovered.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
65 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,High,
66 CWE-322,EN-Key Exchange without Entity Authentication (Type: Base),The software performs a key exchange with an actor without verifying the identity of that actor.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347
67 The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
68 CWE-323,"EN-Reusing a Nonce, Key Pair in Encryption (Type: Base)",Nonces should be used for the present occasion and only once.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,
69 CWE-360,EN-Trust of System Event Data (Type: Base),Security based on event locations are insecure and can be spoofed.,"Events are a messaging system which may provide control data to programs listening for events. Events often do not have any type of authentication framework to allow them to be verified from a trusted source. Any application, in Windows, on a given desktop can send a message to any window on the same desktop. There is no authentication framework for these messages. Therefore, any message can be used to manipulate any process on the desktop if the process does not check the validity and safeness of those messages.",,High,
70 CWE-378,EN-Creation of Temporary File With Insecure Permissions (Type: Base),"Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,High,
71 CWE-416,EN-Use After Free (Type: Base),"Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
72 Error conditions and other exceptional circumstances.
73 Confusion over which part of the program is responsible for freeing the memory.
74 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
75 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,High,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
76 CWE-457,EN-Use of Uninitialized Variable (Type: Variant),"The code uses a variable that has not been initialized, leading to unpredictable or unintended results.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,High,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
77 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
78 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
79 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
80 CWE-467,EN-Use of sizeof() on a Pointer Type (Type: Variant),"The code calls sizeof() on a malloced pointer type, which always returns the wordsize/8. This can produce an unexpected result if the programmer intended to determine how much memory has been allocated.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High,EXP01-A. Do not take the sizeof a pointer to determine the size of a type: https://www.securecoding.cert.org/confluence/display/seccode/EXP01-A.+Do+not+take+the+sizeof+a+pointer+to+determine+the+size+of+a+type
81 CWE-486,EN-Comparison of Classes by Name (Type: Variant),"The program compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,High,
82 CWE-493,EN-Critical Public Variable Without Final Modifier (Type: Variant),"The product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.","If a field is non-final and public, it can be changed once the value is set by any function that has access to the class which contains the field. This could lead to a vulnerability if other parts of the program make assumptions about the contents of that field.",,High,
83 CWE-499,EN-Serializable Class Containing Sensitive Data (Type: Variant),"The code contains a class with sensitive data, but the class does not explicitly deny serialization. The data can be accessed by serializing the class through another class.","Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,High,
84 CWE-500,EN-Public Static Field Not Marked Final (Type: Variant),"An object contains a public static field that is not marked final, which might allow it to be modified in unexpected ways.",Public static variables can be read without an accessor and changed without a mutator by any classes in the application.,,High,
85 CWE-515,EN-Covert Storage Channel (Type: Base),A covert storage channel transfers information through the setting of bits by one program and the reading of those bits by another. What distinguishes this case from that of ordinary operation is that the bits are used to convey encoded information.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,High,
86 CWE-639,EN-Authorization Bypass Through User-Controlled Key (Type: Base),The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.,"Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system. One manifestation of this weakness would be if a system used sequential or otherwise easily guessable session ids that would allow one user to easily switch to another user's session and read/modify their data.",,High,
87 CWE-640,EN-Weak Password Recovery Mechanism for Forgotten Password (Type: Base),"The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.","It is common for an application to have a mechanism that provides a means for a user to gain access to their account in the event they forget their password. Very often the password recovery mechanism is weak, which has the effect of making it more likely that it would be possible for a person other than the legitimate system user to gain access to that user's account.
88 This weakness may be that the security question is too easy to guess or find an answer to (e.g. because it is too common). Or there might be an implementation weakness in the password recovery mechanism code that may for instance trick the system into e-mailing the new password to an e-mail account other than that of the user. There might be no throttling done on the rate of password resets so that a legitimate user can be denied service by an attacker if an attacker tries to recover their password in a rapid succession. The system may send the original password to the user rather than generating a new temporary password. In summary, password recovery functionality, if not carefully designed and implemented can often become the system's weakest link that can be misused in a way that would allow an attacker to gain unauthorized access to the system. Weak password recovery schemes completely undermine a strong password authentication scheme.",,High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
89 CWE-642,EN-External Control of Critical State Data (Type: Class),"The software stores security-critical state information about its users, or the software itself, in a location that is accessible to unauthorized actors.","If an attacker can modify the state information without detection, then it could be used to perform unauthorized actions or access unexpected resources, since the application programmer does not expect that the state can be changed.
90 State information can be stored in various locations such as a cookie, in a hidden web form field, input parameter or argument, an environment variable, a database record, within a settings file, etc. All of these locations have the potential to be modified by an attacker. When this state information is used to control security or determine resource usage, then it may create a vulnerability. For example, an application may perform authentication, then save the state in an ""authenticated=true"" cookie. An attacker may simply create this cookie in order to bypass the authentication.",,High,"Top 10 2007-Insecure Direct Object Reference: http://www.owasp.org/index.php/Top_10_2007-A4
91 HMAC: http://en.wikipedia.org/wiki/Hmac
92 24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75"
93 CWE-643,EN-Improper Neutralization of Data within XPath Expressions (XPath Injection) (Type: Base),"The software uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,"XPath Injection: http://www.webappsec.org/projects/threat/classes/xpath_injection.shtml
94 The Art of Software Security Assessment: Chapter 17, ""XPath Injection"", Page 1070."
95 CWE-644,EN-Improper Neutralization of HTTP Headers for Scripting Syntax (Type: Variant),"The application does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.","An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.
96 If an application does not neutralize user controlled data being placed in the header of an HTTP response coming from the server, the header may contain a script that will get executed in the client's browser context, potentially resulting in a cross site scripting vulnerability or possibly an HTTP response splitting attack. It is important to carefully control data that is being placed both in HTTP response header and in the HTTP response body to ensure that no scripting syntax is present, taking various encodings into account.",,High,
97 CWE-645,EN-Overly Restrictive Account Lockout Mechanism (Type: Base),"The software contains an account lockout protection mechanism, but the mechanism is too restrictive and can be triggered too easily. This allows attackers to deny service to legitimate users by causing their accounts to be locked out.","Account lockout is a security feature often present in applications as a countermeasure to the brute force attack on the password based authentication mechanism of the system. After a certain number of failed login attempts, the users' account may be disabled for a certain period of time or until it is unlocked by an administrator. Other security events may also possibly trigger account lockout. However, an attacker may use this very security feature to deny service to legitimate system users. It is therefore important to ensure that the account lockout security mechanism is not overly restrictive.",,High,
98 CWE-646,EN-Reliance on File Name or Extension of Externally-Supplied File (Type: Variant),"The software allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.","An application might use the file name or extension of of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a "".php.gif"" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.",,High,
99 CWE-647,EN-Use of Non-Canonical URL Paths for Authorization Decisions (Type: Variant),The software defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.,"If an application defines policy namespaces and makes authorization decisions based on the URL, but it does not require or convert to a canonical URL before making the authorization decision, then it opens the application to attack. For example, if the application only wants to allow access to http://www.example.com/mypage, then the attacker might be able to bypass this restriction using equivalent URLs such as:
100 http://WWW.EXAMPLE.COM/mypage
101 http://www.example.com/%6Dypage (alternate encoding)
102 http://192.168.1.1/mypage (IP address)
103 http://www.example.com/mypage/ (trailing /)
104 http://www.example.com:80/mypage
105 Therefore it is important to specify access control policy that is based on the path information in some canonical form with all alternate encodings rejected (which can be accomplished by a default deny rule).",,High,
106 CWE-649,EN-Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking (Type: Base),"The software uses obfuscation or encryption of inputs that should not be mutable by an external actor, but the software does not use integrity checks to detect if those inputs have been modified.","When an application relies on obfuscation or incorrectly applied / weak encryption to protect client-controllable tokens or parameters, that may have an effect on the user state, system state, or some decision made on the server. Without protecting the tokens/parameters for integrity, the application is vulnerable to an attack where an adversary blindly traverses the space of possible values of the said token/parameter in order to attempt to gain an advantage. The goal of the attacker is to find another admissible value that will somehow elevate his or her privileges in the system, disclose information or change the behavior of the system in some way beneficial to the attacker. If the application does not protect these critical tokens/parameters for integrity, it will not be able to determine that these values have been tampered with. Measures that are used to protect data for confidentiality should not be relied upon to provide the integrity service.",,High,
107 CWE-650,EN-Trusting HTTP Permission Methods on the Server Side (Type: Variant),"The server contains a protection mechanism that assumes that any URI that is accessed using HTTP GET will not cause a state change to the associated resource. This might allow attackers to bypass intended access restrictions and conduct resource modification and deletion attacks, since some applications allow GET to modify state.","An application may disallow the HTTP requests to perform DELETE, PUT and POST operations on the resource representation, believing that it will be enough to prevent unintended resource alterations. Even though the HTTP GET specification requires that GET requests should not have side effects, there is nothing in the HTTP protocol itself that prevents the HTTP GET method from performing more than just query of the data. For instance, it is a common practice with REST based Web Services to have HTTP GET requests modifying resources on the server side. Whenever that happens however, the access control needs to be properly enforced in the application. No assumptions should be made that only HTTP DELETE, PUT, and POST methods have the power to alter the representation of the resource being accessed in the request.",,High,
108 CWE-652,EN-Improper Neutralization of Data within XQuery Expressions (XQuery Injection) (Type: Base),"The software uses external input to dynamically construct an XQuery expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,
109 CWE-676,EN-Use of Potentially Dangerous Function (Type: Base),"The program invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,High,"Security Development Lifecycle (SDL) Banned Function Calls: http://msdn.microsoft.com/en-us/library/bb288454.aspx
110 Writing Secure Code: Chapter 5, ""Safe String Handling"" Page 156, 160
111 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
112 CWE-682,EN-Incorrect Calculation (Type: Class),The software performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management..,"When software performs a security-critical calculation incorrectly, it might lead to incorrect resource allocations, incorrect privilege assignments, or failed comparisons among other things. Many of the direct results of an incorrect calculation can lead to even larger problems such as failed protection mechanisms or even arbitrary code execution.",,High,"SafeInt: http://safeint.codeplex.com/
113 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
114 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
115 CWE-78,EN-Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) (Type: Base),"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component..","This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage.
116 There are at least two subtypes of OS command injection:
117 The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system(""nslookup [HOSTNAME]"") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing.
118 The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use ""exec([COMMAND])"" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line.
119 From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.",,High,"Exploiting Software: How to Break Code
120 Meta-Character Vulnerabilities: http://www.cs.purdue.edu/homes/cs390s/slides/week09.pdf
121 OS Commanding: http://projects.webappsec.org/OS-Commanding
122 The World Wide Web Security FAQ: http://www.w3.org/Security/Faq/wwwsf4.html
123 Security Issues in Perl Scripts: http://www.cgisecurity.com/lib/sips.html
124 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171
125 Top 25 Series - Rank 9 - OS Command Injection: http://blogs.sans.org/appsecstreetfighter/2010/02/24/top-25-series-rank-9-os-command-injection/
126 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
127 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
128 The Art of Software Security Assessment: Chapter 8, ""Shell Metacharacters"", Page 425."
129 CWE-784,EN-Reliance on Cookies without Validation and Integrity Checking in a Security Decision (Type: Variant),"The application uses a protection mechanism that relies on the existence or values of a cookie, but it does not properly ensure that the cookie is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Attackers can bypass protection mechanisms such as authorization and authentication by modifying the cookie to contain an expected value.",,High,"Unforgivable Vulnerabilities: http://cve.mitre.org/docs/docs-2007/unforgivable.pdf
130 Writing Secure Code: Chapter 13, ""Sensitive Data in Cookies and Fields"" Page 435"
131 CWE-862,EN-Missing Authorization (Type: Class),The software does not perform an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
132 When access control checks are not applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
133 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
134 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
135 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
136 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
137 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
138 CWE-863,EN-Incorrect Authorization (Type: Class),"The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
139 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
140 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
141 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
142 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
143 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
144 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
145 CWE-99,EN-Improper Control of Resource Identifiers (Resource Injection) (Type: Base),"The software receives input from an upstream component, but it does not restrict or incorrectly restricts the input before it is used as an identifier for a resource that may be outside the intended sphere of control.",This may enable an attacker to access or modify otherwise protected system resources.,,High,
146 CWE-120,EN-Buffer Copy without Checking Size of Input (Classic Buffer Overflow) (Type: Base),"The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127
147 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
148 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
149 Safe C String Library v1.0.3: http://www.zork.org/safestr/
150 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
151 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
152 PaX: http://en.wikipedia.org/wiki/PaX
153 Top 25 Series - Rank 3 - Classic Buffer Overflow: http://software-security.sans.org/blog/2010/03/02/top-25-series-rank-3-classic-buffer-overflow/
154 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
155 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
156 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
157 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189.
158 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
159 CWE-122,EN-Heap-based Buffer Overflow (Type: Variant),"A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Heap Overruns"" Page 138
160 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
161 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
162 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
163 CWE-131,EN-Incorrect Calculation of Buffer Size (Type: Base),"The software does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,High to Very High,"SafeInt: http://safeint.codeplex.com/
164 Top 25 Series - Rank 18 - Incorrect Calculation of Buffer Size: http://software-security.sans.org/blog/2010/03/19/top-25-series-rank-18-incorrect-calculation-of-buffer-size
165 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
166 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
167 PaX: http://en.wikipedia.org/wiki/PaX
168 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
169 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
170 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
171 The Art of Software Security Assessment: Chapter 8, ""Incrementing Pointers Incorrectly"", Page 401."
172 CWE-22,EN-Improper Limitation of a Pathname to a Restricted Directory (Path Traversal) (Type: Class),"The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
173 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,High to Very High,"Writing Secure Code: Chapter 11, ""Directory Traversal and Using Parent Paths (..)"" Page 370
174 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
175 Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
176 Top 25 Series - Rank 7 - Path Traversal: http://blogs.sans.org/appsecstreetfighter/2010/03/09/top-25-series-rank-7-path-traversal/
177 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
178 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
179 CWE-311,EN-Missing Encryption of Sensitive Data (Type: Base),The software does not encrypt sensitive or critical information before storage or transmission.,"The lack of proper data encryption passes up the guarantees of confidentiality, integrity, and accountability that properly implemented encryption conveys.",,High to Very High,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
180 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253
181 Top 25 Series - Rank 10 - Missing Encryption of Sensitive Data: http://blogs.sans.org/appsecstreetfighter/2010/02/26/top-25-series-rank-10-missing-encryption-of-sensitive-data/
182 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
183 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf"
184 CWE-464,EN-Addition of Data Structure Sentinel (Type: Base),The accidental addition of a data-structure sentinel can cause serious programming logic problems.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High to Very High,
185 CWE-67,EN-Improper Handling of Windows Device Names (Type: Variant),"The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a Windows device name such as AUX or CON. This typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file.","Not properly handling virtual filenames (e.g. AUX, CON, PRN, COM1, LPT1) can result in different types of vulnerabilities. In some cases an attacker can request a device via injection of a virtual filename in a URL, which may cause an error that leads to a denial of service or an error page that reveals sensitive information. A software system that allows device names to bypass filtering runs the risk of an attacker injecting malicious code in a file with the name of a device.",,High to Very High,"Writing Secure Code
186 The Art of Software Security Assessment: Chapter 11, ""Device Files"", Page 666."
187 CWE-73,EN-External Control of File Name or Path (Type: Class),The software allows user input to control or influence paths or file names that are used in filesystem operations.,"This could allow an attacker to access or modify system files or other files that are critical to the application.
188 Path manipulation errors occur when the following two conditions are met:
189 1. An attacker can specify a path used in an operation on the filesystem.
190 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
191 For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.",,High to Very High,OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
192 CWE-76,EN-Improper Neutralization of Equivalent Special Elements (Type: Base),"The software properly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.","The software may have a fixed list of special characters it believes is complete. However, there may be alternate encodings, or representations that also have the same meaning. For example, the software may filter out a leading slash (/) to prevent absolute path names, but does not account for a tilde (~) followed by a user name, which on some *nix systems could be expanded to an absolute pathname. Alternately, the software might filter a dangerous ""-e"" command-line switch when calling an external program, but it might not account for ""--exec"" or other switches that have the same semantics.",,High to Very High,
193 CWE-79,EN-Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) (Type: Base),The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.,"Cross-site scripting (XSS) vulnerabilities occur when:
194 1. Untrusted data enters a web application, typically from a web request.
195 2. The web application dynamically generates a web page that contains this untrusted data.
196 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
197 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
198 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
199 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
200 There are three main kinds of XSS:
201 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
202 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
203 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
204 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
205 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,High to Very High,"XSS Attacks
206 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31
207 24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63
208 Cross-site scripting: http://en.wikipedia.org/wiki/Cross-site_scripting
209 Writing Secure Code: Chapter 13, ""Web-Specific Input Issues"" Page 413
210 XSS (Cross Site Scripting) Cheat Sheet: http://ha.ckers.org/xss.html
211 Mitigating Cross-site Scripting With HTTP-only Cookies: http://msdn.microsoft.com/en-us/library/ms533046.aspx
212 Anti-XSS 3.0 Beta and CAT.NET Community Technology Preview now Live!: http://blogs.msdn.com/cisg/archive/2008/12/15/anti-xss-3-0-beta-and-cat-net-community-technology-preview-now-live.aspx
213 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
214 XSS Defense HOWTO: http://blog.modsecurity.org/2008/07/do-you-know-how.html
215 Web Application Firewall: http://www.owasp.org/index.php/Web_Application_Firewall
216 Web Application Firewall Evaluation Criteria: http://www.webappsec.org/projects/wafec/v1/wasc-wafec-v1.0.html
217 Firefox Implements httpOnly And is Vulnerable to XMLHTTPRequest
218 XMLHttpRequest allows reading HTTPOnly cookies: https://bugzilla.mozilla.org/show_bug.cgi?id=380418
219 Apache Wicket: http://wicket.apache.org/
220 XSS (Cross Site Scripting) Prevention Cheat Sheet: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet
221 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
222 Top 25 series - Rank 1 - Cross Site Scripting: http://blogs.sans.org/appsecstreetfighter/2010/02/22/top-25-series-rank-1-cross-site-scripting/
223 The Art of Software Security Assessment: Chapter 17, ""Cross Site Scripting"", Page 1071."
224 CWE-80,EN-Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as ""<"", "">"", and ""&"" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.","This may allow such characters to be treated as control characters, which are executed client-side in the context of the user's session. Although this can be classified as an injection problem, the more pertinent issue is the improper conversion of such special characters to respective context-appropriate entities before displaying them to the user.",,High to Very High,
225 CWE-98,EN-Improper Control of Filename for Include/Require Statement in PHP Program (PHP Remote File Inclusion) (Type: Base),"The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in ""require,"" ""include,"" or similar functions.","In certain versions and configurations of PHP, this can allow an attacker to specify a URL to a remote location from which the software will obtain the code to execute. In other cases in association with path traversal, the attacker can specify a local file that may contain executable statements that can be parsed by PHP.",,High to Very High,"Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
226 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
227 A Study in Scarlet: http://www.cgisecurity.com/lib/studyinscarlet.txt
228 Suhosin: http://www.hardened-php.net/suhosin/
229 Top 25 Series - Rank 13 - PHP File Inclusion: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-13-php-file-inclusion/"
230 CWE-188,EN-Reliance on Data/Memory Layout (Type: Base),"The software makes invalid assumptions about how protocol data or memory is organized at a lower level, resulting in unintended program behavior.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Structure Padding"", Page 284."
231 CWE-197,EN-Numeric Truncation Error (Type: Base),Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.,"When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Truncation"", Page 259."
232 CWE-252,EN-Unchecked Return Value (Type: Base),"The software does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341.
233 Writing Secure Code: Chapter 20, ""Checking Returns"" Page 624
234 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
235 ERR10-CPP. Check for error conditions: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR10-CPP.+Check+for+error+conditions"
236 CWE-253,EN-Incorrect Check of Function Return Value (Type: Base),"The software incorrectly checks a return value from a function, which prevents the software from detecting errors or exceptional conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Return Value Testing and Interpretation"", Page 340."
237 CWE-296,EN-Improper Following of a Certificates Chain of Trust (Type: Base),"The software does not follow, or incorrectly follows, the chain of trust for a certificate back to a trusted root certificate, resulting in incorrect trust of any resource that is associated with that certificate.","If a system does not follow the chain of trust of a certificate to a root server, the certificate loses all usefulness as a metric of trust. Essentially, the trust gained from a certificate is derived from a chain of trust -- with a reputable trusted entity at the end of that list. The end user must trust that reputable source, and this reputable source must vouch for the resource in question through the medium of the certificate.
238 In some cases, this trust traverses several entities who vouch for one another. The entity trusted by the end user is at one end of this trust chain, while the certificate-wielding resource is at the other end of the chain. If the user receives a certificate at the end of one of these trust chains and then proceeds to check only that the first link in the chain, no real trust has been derived, since the entire chain must be traversed back to a trusted source to verify the certificate.
239 There are several ways in which the chain of trust might be broken, including but not limited to:
240 Any certificate in the chain is self-signed, unless it the root.
241 Not every intermediate certificate is checked, starting from the original certificate all the way up to the root certificate.
242 An intermediate, CA-signed certificate does not have the expected Basic Constraints or other important extensions.
243 The root certificate has been compromised or authorized to the wrong party.",,Low,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
244 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
245 CWE-298,EN-Improper Validation of Certificate Expiration (Type: Variant),"A certificate expiration is not validated or is incorrectly validated, so trust may be assigned to certificates that have been abandoned due to age.","When the expiration of a certificate is not taken into account, no trust has necessarily been conveyed through it. Therefore, the validity of the certificate cannot be verified and all benefit of the certificate is lost.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
246 CWE-324,EN-Use of a Key Past its Expiration Date (Type: Base),"The product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key.","While the expiration of keys does not necessarily ensure that they are compromised, it is a significant concern that keys which remain in use for prolonged periods of time have a decreasing probability of integrity. For this reason, it is important to replace keys within a period of time proportional to their strength.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
247 CWE-379,EN-Creation of Temporary File in Directory with Incorrect Permissions (Type: Base),The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Low,"The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538."
248 CWE-462,EN-Duplicate Key in Associative List (Alist) (Type: Base),Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.,"A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.",,Low,
249 CWE-479,EN-Signal Handler Use of a Non-reentrant Function (Type: Variant),The program defines a signal handler that calls a non-reentrant function.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
250 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
251 CWE-480,EN-Use of Incorrect Operator (Type: Base),"The programmer accidentally uses the wrong operator, which changes the application logic in security-relevant ways.","Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
252 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
253 CWE-481,EN-Assigning instead of Comparing (Type: Variant),The code uses an operator for assignment when the intention was to perform a comparison.,"In many languages the compare statement is very close in appearance to the assignment statement and are often confused. This bug is generally the result of a typo and usually causes obvious problems with program execution. If the comparison is in an if statement, the if statement will usually evaluate the value of the right-hand side of the predicate.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
254 CWE-482,EN-Comparing instead of Assigning (Type: Variant),The code uses an operator for comparison when the intention was to perform an assignment.,"In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
255 CWE-483,EN-Incorrect Block Delimitation (Type: Variant),"The code does not explicitly delimit a block that is intended to contain 2 or more statements, creating a logic error.","In some languages, braces (or other delimiters) are optional for blocks. When the delimiter is omitted, it is possible to insert a logic error in which a statement is thought to be in a block but is not. In some cases, the logic error can have security implications.",,Low,
256 CWE-641,EN-Improper Restriction of Names for Files and Other Resources (Type: Base),"The application constructs the name of a file or other resource using input from an upstream component, but does not restrict or incorrectly restricts the resulting name.","This may produce resultant weaknesses. For instance, if the names of these resources contain scripting characters, it is possible that a script may get executed in the client's browser if the application ever displays the name of the resource on a dynamically generated web page. Alternately, if the resources are consumed by some application parser, a specially crafted name can exploit some vulnerability internal to the parser, potentially resulting in execution of arbitrary code on the server machine. The problems will vary based on the context of usage of such malformed resource names and whether vulnerabilities are present in or assumptions are made by the targeted technology that would make code execution possible.",,Low,
257 CWE-648,EN-Incorrect Use of Privileged APIs (Type: Base),The application does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.,"When an application contains certain functions that perform operations requiring an elevated level of privilege, the caller of a privileged API must be careful to:
258 ensure that assumptions made by the APIs are valid, such as validity of arguments
259 account for known weaknesses in the design/implementation of the API
260 call the API from a safe context
261 If the caller of the API does not follow these requirements, then it may allow a malicious user or process to elevate their privilege, hijack the process, or steal sensitive data.
262 For instance, it is important to know if privileged APIs do not shed their privileges before returning to the caller or if the privileged function might make certain assumptions about the data, context or state information passed to it by the caller. It is important to always know when and how privileged APIs can be called in order to ensure that their elevated level of privilege cannot be exploited.",,Low,
263 CWE-762,EN-Mismatched Memory Management Routines (Type: Variant),"The application attempts to return a memory resource to the system, but it calls a release function that is not compatible with the function that was originally used to allocate that resource.","This weakness can be generally described as mismatching memory management routines, such as:
264 The memory was allocated on the stack (automatically), but it was deallocated using the memory management routine free() (CWE-590), which is intended for explicitly allocated heap memory.
265 The memory was allocated explicitly using one set of memory management functions, and deallocated using a different set. For example, memory might be allocated with malloc() in C++ instead of the new operator, and then deallocated with the delete operator.
266 When the memory management functions are mismatched, the consequences may be as severe as code execution, memory corruption, or program crash. Consequences and ease of exploit will vary depending on the implementation of the routines and the object being managed.",,Low,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
267 Valgrind: http://valgrind.org/"
268 CWE-783,EN-Operator Precedence Logic Error (Type: Variant),The program uses an expression in which operator precedence causes incorrect logic to be used.,"While often just a bug, operator precedence logic errors can have serious consequences if they are used in security-critical code, such as making an authentication decision.",,Low,"EXP00-C. Use parentheses for precedence of operation: https://www.securecoding.cert.org/confluence/display/seccode/EXP00-C.+Use+parentheses+for+precedence+of+operation
269 The Art of Software Security Assessment: Chapter 6, ""Precedence"", Page 287."
270 CWE-789,EN-Uncontrolled Memory Allocation (Type: Variant),"The product allocates memory based on an untrusted size value, but it does not validate or incorrectly validates the size, allowing arbitrary amounts of memory to be allocated.","This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Low,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
271 CWE-333,EN-Improper Handling of Insufficient Entropy in TRNG (Type: Variant),True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Low to Medium,
272 CWE-367,EN-Time-of-check Time-of-use (TOCTOU) Race Condition (Type: Base),"The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. This can cause the software to perform invalid actions when the resource is in an unexpected state.","This weakness can be security-relevant when an attacker can influence the state of the resource between check and use. This can happen with shared resources such as files, memory, or even variables in multithreaded programs.",,Low to Medium,"Portably Solving File TOCTTOU Races with Hardness Amplification: http://www.usenix.org/events/fast08/tech/tsafrir.html
273 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
274 The Art of Software Security Assessment: Chapter 9, ""TOCTOU"", Page 527."
275 CWE-404,EN-Improper Resource Shutdown or Release (Type: Base),The program does not release or incorrectly releases a resource before it is made available for re-use.,"When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
276 CWE-407,EN-Algorithmic Complexity (Type: Base),"An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Low to Medium,Algorithmic Complexity Attacks: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/index.html
277 CWE-415,EN-Double Free (Type: Variant),"The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.","When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
278 The Art of Software Security Assessment: Chapter 7, ""Double Frees"", Page 379."
279 CWE-59,EN-Improper Link Resolution Before File Access (Link Following) (Type: Base),"The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.","Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Low to Medium,"The Art of Software Security Assessment: Chapter 9, ""Symbolic Link Attacks"", Page 518."
280 CWE-601,EN-URL Redirection to Untrusted Site (Open Redirect) (Type: Variant),"A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.","An http parameter may contain a URL value and could cause the web application to redirect the request to the specified URL. By modifying the URL value to a malicious site, an attacker may successfully launch a phishing scam and steal user credentials. Because the server name in the modified link is identical to the original site, phishing attempts have a more trustworthy appearance.",,Low to Medium,"Exploitable Redirects on the Web: Identification, Prevalence, and Defense: http://www.cs.indiana.edu/cgi-pub/cshue/research/woot08.pdf
281 Open redirect vulnerabilities: definition and prevention: http://www.net-security.org/dl/insecure/INSECURE-Mag-17.pdf
282 Top 25 Series - Rank 23 - Open Redirect: http://software-security.sans.org/blog/2010/03/25/top-25-series-rank-23-open-redirect
283 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
284 CWE-749,EN-Exposed Dangerous Method or Function (Type: Base),"The software provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.","This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
285 The exposure can occur in a few different ways:
286 1) The function/method was never intended to be exposed to outside actors.
287 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Low to Medium,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
288 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp"
289 CWE-755,EN-Improper Handling of Exceptional Conditions (Type: Class),The software does not handle or incorrectly handles an exceptional condition.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
290 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Low to Medium,
291 CWE-766,EN-Critical Variable Declared Public (Type: Variant),The software declares a critical variable or field to be public when intended security policy requires it to be private.,"When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Low to Medium,
292 CWE-767,EN-Access to Critical Private Variable via Public Method (Type: Variant),The software defines a public method that reads or modifies a private variable.,"If an attacker modifies the variable to contain unexpected values, this could violate assumptions from other parts of the code. Additionally, if an attacker can read the private variable, it may expose sensitive information or make it easier to launch further attacks.",,Low to Medium,
293 CWE-776,EN-Improper Restriction of Recursive Entity References in DTDs (XML Entity Expansion) (Type: Variant),"The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.","If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.",,Low to Medium,"Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD: http://www.securityfocus.com/archive/1/303509
294 XML security: Preventing XML bombs: http://searchsoftwarequality.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid92_gci1168442,00.html?asrc=SS_CLA_302%20%20558&psrc=CLT_92#
295 Dismantling an XML-Bomb: http://blog.didierstevens.com/2008/09/23/dismantling-an-xml-bomb/
296 XML Entity Expansion: http://projects.webappsec.org/XML-Entity-Expansion
297 Tip: Configure SAX parsers for secure processing: http://www.ibm.com/developerworks/xml/library/x-tipcfsx.html
298 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
299 Preventing Entity Expansion Attacks in JAXB: http://blog.bdoughan.com/2011/03/preventing-entity-expansion-attacks-in.html"
300 CWE-777,EN-Regular Expression without Anchors (Type: Variant),"The software uses a regular expression to perform neutralization, but the regular expression is not anchored and may allow malicious or malformed data to slip through.","When performing tasks such as whitelist validation, data is examined and possibly modified to ensure that it is well-formed and adheres to a list of safe values. If the regular expression is not anchored, malicious or malformed data may be included before or after any string matching the regular expression. The type of malicious data that is allowed will depend on the context of the application and which anchors are omitted from the regular expression.",,Low to Medium,
301 CWE-779,EN-Logging of Excessive Data (Type: Base),"The software logs too much information, making log files hard to process and possibly hindering recovery efforts or forensic analysis after an attack.","While logging is a good practice in general, and very high levels of logging are appropriate for debugging stages of development, too much logging in a production environment might hinder a system administrator's ability to detect anomalous conditions. This can provide cover for an attacker while attempting to penetrate a system, clutter the audit trail for forensic analysis, or make it more difficult to debug problems in a production environment.",,Low to Medium,
302 CWE-781,EN-Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code (Type: Variant),"The software defines an IOCTL that uses METHOD_NEITHER for I/O, but it does not validate or incorrectly validates the addresses that are provided.","When an IOCTL uses the METHOD_NEITHER option for I/O control, it is the responsibility of the IOCTL to validate the addresses that have been supplied to it. If validation is missing or incorrect, attackers can supply arbitrary memory addresses, leading to code execution or a denial of service.",,Low to Medium,"Exploiting Common Flaws in Drivers: http://reversemode.com/index.php?option=com_content&task=view&id=38&Itemid=1
303 Remote and Local Exploitation of Network Drivers: https://www.blackhat.com/presentations/bh-usa-07/Bulygin/Presentation/bh-usa-07-bulygin.pdf
304 Windows driver vulnerabilities: the METHOD_NEITHER odyssey: http://www.net-security.org/dl/insecure/INSECURE-Mag-18.pdf
305 Buffer Descriptions for I/O Control Codes: http://msdn.microsoft.com/en-us/library/ms795857.aspx
306 Using Neither Buffered Nor Direct I/O: http://msdn.microsoft.com/en-us/library/cc264614.aspx
307 Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
308 No description: http://www.piotrbania.com/all/articles/ewdd.pdf"
309 CWE-782,EN-Exposed IOCTL with Insufficient Access Control (Type: Variant),"The software implements an IOCTL with functionality that should be restricted, but it does not properly enforce access control for the IOCTL.","When an IOCTL contains privileged functionality and is exposed unnecessarily, attackers may be able to access this functionality by invoking the IOCTL. Even if the functionality is benign, if the programmer has assumed that the IOCTL would only be accessed by a trusted process, there may be little or no validation of the incoming data, exposing weaknesses that would never be reachable if the attacker cannot call the IOCTL directly.
310 The implementations of IOCTLs will differ between operating system types and versions, so the methods of attack and prevention may vary widely.",,Low to Medium,Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
311 CWE-117,EN-Improper Output Neutralization for Logs (Type: Base),The software does not neutralize or incorrectly neutralizes output that is written to logs.,"This can allow an attacker to forge log entries or inject malicious content into logs.
312 Log forging vulnerabilities occur when:
313 Data enters an application from an untrusted source.
314 The data is written to an application or system log file.",,Medium,"Exploiting Software: How to Break Code
315 The night the log was forged: http://doc.novsu.ac.ru/oreilly/tcpip/puis/ch10_05.htm
316 OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007"
317 CWE-124,EN-Buffer Underwrite (Buffer Underflow) (Type: Base),The software writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Medium,"Buffer UNDERFLOWS: What do you know about it?: http://seclists.org/vuln-dev/2004/Jan/0022.html
318 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
319 CWE-128,EN-Wrap-around Error (Type: Base),"Wrap around errors occur whenever a value is incremented past the maximum value for its type and therefore ""wraps around"" to a very small, negative, or undefined value.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Medium,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
320 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
321 CWE-170,EN-Improper Null Termination (Type: Base),The software does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Medium,
322 CWE-190,EN-Integer Overflow or Wraparound (Type: Base),"The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.","An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.",,Medium,"An overview of common programming security vulnerabilities and possible solutions: http://fort-knox.org/thesis.pdf
323 Basic Integer Overflows: http://www.phrack.org/issues.html?issue=60&id=10#article
324 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
325 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
326 SafeInt: http://safeint.codeplex.com/
327 Top 25 Series - Rank 17 - Integer Overflow Or Wraparound: http://software-security.sans.org/blog/2010/03/18/top-25-series-rank-17-integer-overflow-or-wraparound
328 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
329 CWE-196,EN-Unsigned to Signed Conversion Error (Type: Variant),An unsigned-to-signed conversion error takes place when a large unsigned primitive is used as a signed value.,It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Medium,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
330 CWE-202,EN-Exposure of Sensitive Data Through Data Queries (Type: Variant),"When trying to keep information confidential, an attacker can often infer some of the information by using statistics.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Medium,
331 CWE-250,EN-Execution with Unnecessary Privileges (Type: Class),"The software performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.","New weaknesses can be exposed because running with extra privileges, such as root or Administrator, can disable the normal security checks being performed by the operating system or surrounding environment. Other pre-existing weaknesses can turn into security vulnerabilities if they occur while operating at raised privileges.
332 Privilege management functions can behave in some less-than-obvious ways, and they have different quirks on different platforms. These inconsistencies are particularly pronounced if you are transitioning from one non-root user to another. Signal handlers and spawned processes run at the privilege of the owning process, so if a process is running as root when a signal fires or a sub-process is executed, the signal handler or sub-process will operate with root privileges.",,Medium,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
333 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
334 Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
335 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm
336 24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
337 The Art of Software Security Assessment: Chapter 9, ""Privilege Vulnerabilities"", Page 477."
338 CWE-269,EN-Improper Privilege Management (Type: Base),"The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Medium,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
339 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
340 CWE-273,EN-Improper Check for Dropped Privileges (Type: Base),The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,
341 CWE-276,EN-Incorrect Default Permissions (Type: Variant),"The software, upon installation, sets incorrect permissions for an object that exposes it to an unintended actor.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,"The Art of Software Security Assessment: Chapter 3, ""Insecure Defaults"", Page 69."
342 CWE-299,EN-Improper Check for Certificate Revocation (Type: Variant),"The software does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.","An improper check for certificate revocation is a far more serious flaw than related certificate failures. This is because the use of any revoked certificate is almost certainly malicious. The most common reason for certificate revocation is compromise of the system in question, with the result that no legitimate servers will be using a revoked certificate, unless they are sorely out of sync.",,Medium,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
343 CWE-301,EN-Reflection Attack in an Authentication Protocol (Type: Variant),Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.,"A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Insufficient Validation"", Page 38."
344 CWE-329,EN-Not Using a Random IV with CBC Mode (Type: Variant),Not using a random initialization Vector (IV) with Cipher Block Chaining (CBC) Mode causes algorithms to be susceptible to dictionary attacks.,"This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Initialization Vectors"", Page 42."
345 CWE-332,EN-Insufficient Entropy in PRNG (Type: Variant),"The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
346 CWE-338,EN-Use of Cryptographically Weak PRNG (Type: Base),"The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG is not cryptographically strong.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Medium,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
347 CWE-353,EN-Missing Support for Integrity Check (Type: Base),"The software uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.","If integrity check values or ""checksums"" are omitted from a protocol, there is no way of determining if data has been corrupted in transmission. The lack of checksum functionality in a protocol removes the first application-level check of data that can be used. The end-to-end philosophy of checks states that integrity checks should be performed at the lowest level that they can be completely implemented. Excluding further sanity checks and input validation performed by applications, the protocol's checksum is the most important level of checksum, since it can be performed more completely than at any previous level and takes into account entire messages, as opposed to single packets.",,Medium,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
348 CWE-354,EN-Improper Validation of Integrity Check Value (Type: Base),"The software does not validate or incorrectly validates the integrity check values or ""checksums"" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.",Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.,,Medium,
349 CWE-362,EN-Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) (Type: Class),"The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.","This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
350 A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
351 A race condition violates these properties, which are closely related:
352 Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
353 Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
354 A race condition exists when an ""interfering code sequence"" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single ""x++"" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
355 The interfering code sequence could be ""trusted"" or ""untrusted."" A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
356 volatile - Multithreaded Programmer's Best Friend: http://www.ddj.com/cpp/184403766
357 Thread-safe webapps using Spring: http://www.javalobby.org/articles/thread-safe/index.jsp
358 Prevent race conditions: http://www.ibm.com/developerworks/library/l-sprace.html
359 Race Conditions, Files, and Security Flaws; or the Tortoise and the Hare Redux: http://www.cs.ucdavis.edu/research/tech-reports/1995/CSE-95-9.pdf
360 Secure Programming for Linux and Unix HOWTO: http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html
361 Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
362 On Race Vulnerabilities in Web Applications: http://security.dico.unimi.it/~roberto/pubs/dimva08-web.pdf
363 Avoiding Race Conditions and Insecure File Operations: http://developer.apple.com/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html
364 Top 25 Series - Rank 25 - Race Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/26/top-25-series-rank-25-race-conditions/
365 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
366 CWE-364,EN-Signal Handler Race Condition (Type: Base),The software uses a signal handler that introduces a race condition.,"Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
367 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
368 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
369 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
370 Shared state between a signal handler and other signal handlers
371 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
372 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
373 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
374 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
375 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
376 Avoiding shared state
377 Using synchronization in the signal handler
378 Using synchronization in the regular code
379 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
380 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html
381 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
382 The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
383 CWE-365,EN-Race Condition in Switch (Type: Base),"The code contains a switch statement in which the switched variable can be modified while the switch is still executing, resulting in unexpected behavior.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
384 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
385 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
386 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
387 Shared state between a signal handler and other signal handlers
388 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
389 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
390 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
391 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
392 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
393 Avoiding shared state
394 Using synchronization in the signal handler
395 Using synchronization in the regular code
396 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
397 CWE-366,EN-Race Condition within a Thread (Type: Base),"If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
398 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
399 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
400 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
401 Shared state between a signal handler and other signal handlers
402 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
403 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
404 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
405 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
406 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
407 Avoiding shared state
408 Using synchronization in the signal handler
409 Using synchronization in the regular code
410 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
411 The Art of Software Security Assessment: Chapter 13, ""Race Conditions"", Page 759."
412 CWE-369,EN-Divide By Zero (Type: Base),The product divides a value by zero.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Medium,"No description: http://www.cprogramming.com/tutorial/exceptions.html
413 No description: http://msdn.microsoft.com/en-us/library/ms173160(VS.80).aspx"
414 CWE-370,EN-Missing Check for Certificate Revocation after Initial Check (Type: Base),"The software does not check the revocation status of a certificate after its initial revocation check, which can cause the software to perform privileged actions even after the certificate is revoked at a later time.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
415 CWE-374,EN-Passing Mutable Objects to an Untrusted Method (Type: Base),"Sending non-cloned mutable data as an argument may result in that data being altered or deleted by the called function, thereby putting the calling function into an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"Does Java pass by reference or pass by value?: http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
416 Java: The Complete Reference, J2SE 5th Edition"
417 CWE-375,EN-Returning a Mutable Object to an Untrusted Caller (Type: Base),"Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function, thereby putting the class in an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,
418 CWE-385,EN-Covert Timing Channel (Type: Base),"Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
419 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
420 CWE-390,EN-Detection of Error Condition Without Action (Type: Class),"The software detects a specific error, but takes no actions to handle the error.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
421 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
422 CWE-391,EN-Unchecked Error Condition (Type: Base),Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
423 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
424 CWE-401,EN-Improper Release of Memory Before Removing Last Reference (Memory Leak) (Type: Base),"The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.",This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Medium,How to Break Software Security
425 CWE-460,EN-Improper Cleanup on Thrown Exception (Type: Variant),"The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Medium,
426 CWE-468,EN-Incorrect Pointer Scaling (Type: Base),"In C and C++, one may often accidentally refer to the wrong memory due to the semantics of when math operations are implicitly scaled.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
427 CWE-469,EN-Use of Pointer Subtraction to Determine Size (Type: Base),"The application subtracts one pointer from another in order to determine size, but this calculation can be incorrect if the pointers do not exist in the same memory chunk.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,
428 CWE-476,EN-NULL Pointer Dereference (Type: Base),"A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Medium,
429 CWE-484,EN-Omitted Break Statement in Switch (Type: Base),"The program omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.",This can lead to critical code executing in situations where it should not.,,Medium,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
430 CWE-487,EN-Reliance on Package-level Scope (Type: Variant),"Java packages are not inherently closed; therefore, relying on them for code security is not a good practice.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,Medium,
431 CWE-492,EN-Use of Inner Class Containing Sensitive Data (Type: Variant),Inner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
432 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Medium,
433 CWE-494,EN-Download of Code Without Integrity Check (Type: Base),The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Medium,"Introduction to Code Signing: http://msdn.microsoft.com/en-us/library/ms537361(VS.85).aspx
434 Authenticode: http://msdn.microsoft.com/en-us/library/ms537359(v=VS.85).aspx
435 Code Signing Guide: http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html
436 Secure Software Updates: Disappointments and New Challenges: http://prisms.cs.umass.edu/~kevinfu/papers/secureupdates-hotsec06.pdf
437 24 Deadly Sins of Software Security: ""Sin 18: The Sins of Mobile Code."" Page 267
438 Top 25 Series - Rank 20 - Download of Code Without Integrity Check: http://blogs.sans.org/appsecstreetfighter/2010/04/05/top-25-series-rank-20-download-code-integrity-check/
439 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
440 CWE-498,EN-Cloneable Class Containing Sensitive Information (Type: Variant),"The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.","Cloneable classes are effectively open classes, since data cannot be hidden in them. Classes that do not explicitly deny cloning can be cloned by any other class without running the constructor.",,Medium,
441 CWE-502,EN-Deserialization of Untrusted Data (Type: Variant),The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.,"It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security -- which is a dangerous security assumption.
442 Data that is untrusted can not be trusted to be well-formed.",,Medium,"Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
443 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
444 CWE-532,EN-Information Exposure Through Log Files (Type: Variant),Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Medium,
445 CWE-602,EN-Client-Side Enforcement of Server-Side Security (Type: Base),The software is composed of a server that relies on the client to implement a mechanism that is intended to protect the server.,"When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms resulting in potentially unexpected interactions between the client and server. The consequences will vary, depending on what the mechanisms are trying to protect.",,Medium,"Writing Secure Code: Chapter 23, ""Client-Side Security Is an Oxymoron"" Page 687"
446 CWE-665,EN-Improper Initialization (Type: Base),"The software does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.","This can have security implications when the associated resource is expected to have certain properties or values, such as a variable that determines whether a user has been authenticated or not.",,Medium,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
447 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
448 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
449 CWE-754,EN-Improper Check for Unusual or Exceptional Conditions (Type: Class),The software does not check or improperly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
450 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Medium,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341
451 The Art of Software Security Assessment: Chapter 1, ""Exceptional Conditions,"" Page 22
452 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
453 Top 25 Series - Rank 15 - Improper Check for Unusual or Exceptional Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/15/top-25-series-rank-15-improper-check-for-unusual-or-exceptional-conditions/"
454 CWE-778,EN-Insufficient Logging (Type: Base),"When a security-critical event occurs, the software either does not record the event or omits important details about the event when logging it.","When security-critical events are not logged properly, such as a failed login attempt, this can make malicious behavior more difficult to detect and may hinder forensic analysis after an attack succeeds.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
455 CWE-780,EN-Use of RSA Algorithm without OAEP (Type: Variant),"The software uses the RSA algorithm but does not incorporate Optimal Asymmetric Encryption Padding (OAEP), which might weaken the encryption.",Padding schemes are often used with cryptographic algorithms to make the plaintext less predictable and complicate attack efforts. The OAEP scheme is often used with RSA to nullify the impact of predictable common text.,,Medium,"RSA Problem: http://people.csail.mit.edu/rivest/RivestKaliski-RSAProblem.pdf
456 Optimal Asymmetric Encryption Padding: http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding"
457 CWE-908,EN-Use of Uninitialized Resource (Type: Base),The software uses a resource that has not been properly initialized.,This can have security implications when the associated resource is expected to have certain properties or values.,,Medium,Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
458 CWE-909,EN-Missing Initialization of Resource (Type: Base),The software does not initialize a critical resource.,"Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.",,Medium,
459 CWE-910,EN-Use of Expired File Descriptor (Type: Base),The software uses or accesses a file descriptor after it has been closed.,"After a file descriptor for a particular file or device has been released, it can be reused. The code might not write to the original file, since the reused file descriptor might reference a different file or device.",,Medium,
460 CWE-911,EN-Improper Update of Reference Count (Type: Base),"The software uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.","Reference counts can be used when tracking how many objects contain a reference to a particular resource, such as in memory management or garbage collection. When the reference count reaches zero, the resource can be de-allocated or reused because there are no more objects that use it. If the reference count accidentally reaches zero, then the resource might be released too soon, even though it is still in use. If all objects no longer use the resource, but the reference count is not zero, then the resource might not ever be released.",,Medium,Windows Kernel Reference Count Vulnerabilities - Case Study: http://j00ru.vexillium.org/dump/zn_slides.pdf
461 CWE-94,EN-Improper Control of Generation of Code (Code Injection) (Type: Class),"The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution.
462 Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Medium,"24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63"
463 CWE-95,EN-Improper Neutralization of Directives in Dynamically Evaluated Code (Eval Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. ""eval"").","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Medium,"No description: http://www.rubycentral.com/book/taint.html
464 The Art of Software Security Assessment: Chapter 18, ""Inline Evaluation"", Page 1095."
465 CWE-287,EN-Improper Authentication (Type: Class),"When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Medium to High,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
466 Top 10 2007-Broken Authentication and Session Management: http://www.owasp.org/index.php/Top_10_2007-A7
467 Guide to Authentication: http://www.owasp.org/index.php/Guide_to_Authentication
468 Authentication: http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx
469 Writing Secure Code: Chapter 4, ""Authentication"" Page 109"
470 CWE-306,EN-Missing Authentication for Critical Function (Type: Variant),The software does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.,"Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Medium to High,"The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authentication,"" Page 36
471 Top 25 Series - Rank 19 - Missing Authentication for Critical Function: http://blogs.sans.org/appsecstreetfighter/2010/02/23/top-25-series-rank-19-missing-authentication-for-critical-function/
472 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
473 CWE-319,EN-Cleartext Transmission of Sensitive Information (Type: Base),The software transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.,"Many communication channels can be ""sniffed"" by attackers during data transmission. For example, network traffic can often be sniffed by any attacker who has access to a network interface. This significantly lowers the difficulty of exploitation by attackers.",,Medium to High,"Top 10 2007-Insecure Communications: http://www.owasp.org/index.php/Top_10_2007-A9
474 Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
475 24 Deadly Sins of Software Security: ""Sin 22: Failing to Protect Network Traffic."" Page 337
476 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
477 CWE-327,EN-Use of a Broken or Risky Cryptographic Algorithm (Type: Base),The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.,The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.,,Medium to High,"Applied Cryptography: http://www.schneier.com/book-applied.html
478 Handbook of Applied Cryptography: http://www.cacr.math.uwaterloo.ca/hac/
479 Avoiding bogus encryption products: Snake Oil FAQ: http://www.faqs.org/faqs/cryptography-faq/snake-oil/
480 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
481 Microsoft Scraps Old Encryption in New Code: http://www.eweek.com/c/a/Security/Microsoft-Scraps-Old-Encryption-in-New-Code/
482 Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
483 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315
484 Top 25 Series - Rank 24 - Use of a Broken or Risky Cryptographic Algorithm: http://blogs.sans.org/appsecstreetfighter/2010/03/25/top-25-series-rank-24-use-of-a-broken-or-risky-cryptographic-algorithm/
485 The Art of Software Security Assessment: Chapter 2, ""Insufficient or Obsolete Encryption"", Page 44."
486 CWE-330,EN-Use of Insufficiently Random Values (Type: Class),The software may use insufficiently random numbers or values in a security context that depends on unpredictable numbers.,"When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium to High,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
487 Building Secure Software: How to Avoid Security Problems the Right Way
488 Writing Secure Code: Chapter 8, ""Using Poor Random Numbers"" Page 259
489 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
490 CWE-400,EN-Uncontrolled Resource Consumption (Resource Exhaustion) (Type: Base),"The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.","Limited resources include memory, file system storage, database connection pool entries, or CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
491 Resource exhaustion problems have at least two common causes:
492 Error conditions and other exceptional circumstances
493 Confusion over which part of the program is responsible for releasing the resource",,Medium to High,"Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
494 Resource exhaustion: http://cr.yp.to/docs/resources.html
495 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
496 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
497 CWE-434,EN-Unrestricted Upload of File with Dangerous Type (Type: Base),The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Medium to High,"Dynamic File Uploads, Security and You: http://shsc.info/FileUploadSecurity
498 8 Basic Rules to Implement Secure File Uploads: http://blogs.sans.org/appsecstreetfighter/2009/12/28/8-basic-rules-to-implement-secure-file-uploads/
499 Top 25 Series - Rank 8 - Unrestricted Upload of Dangerous File Type: http://blogs.sans.org/appsecstreetfighter/2010/02/25/top-25-series-rank-8-unrestricted-upload-of-dangerous-file-type/
500 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
501 The Art of Software Security Assessment: Chapter 17, ""File Uploading"", Page 1068."
502 CWE-64,EN-Windows Shortcut Following (.LNK) (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the file is a Windows shortcut (.LNK) whose target is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.",The shortcut (file with the .lnk extension) can permit an attacker to read/write a file that they originally did not have permissions to access.,,Medium to High,
503 CWE-681,EN-Incorrect Conversion between Numeric Types (Type: Base),"When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Medium to High,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
504 CWE-732,EN-Incorrect Permission Assignment for Critical Resource (Type: Class),The software specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Medium to High,"The Art of Software Security Assessment: Chapter 9, ""File Permissions."" Page 495.
505 Building Secure Software: How to Avoid Security Problems the Right Way: Chapter 8, ""Access Control."" Page 194.
506 Top 25 Series - Rank 21 - Incorrect Permission Assignment for Critical Response: http://software-security.sans.org/blog/2010/03/24/top-25-series-rank-21-incorrect-permission-assignment-for-critical-response
507 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm"
508 CWE-770,EN-Allocation of Resources Without Limits or Throttling (Type: Base),"The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on how many resources can be allocated, in violation of the intended security policy for that actor.","Command injection vulnerabilities typically occur when:
509 1. Data enters the application from an untrusted source.
510 2. The data is part of a string that is executed as a command by the application.
511 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Medium to High,"Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
512 Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
513 Resource exhaustion: http://cr.yp.to/docs/resources.html
514 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
515 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517
516 Top 25 Series - Rank 22 - Allocation of Resources Without Limits or Throttling: http://blogs.sans.org/appsecstreetfighter/2010/03/23/top-25-series-rank-22-allocation-of-resources-without-limits-or-throttling/
517 The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
518 CWE-771,EN-Missing Reference to Active Allocated Resource (Type: Base),"The software does not properly maintain a reference to a resource that has been allocated, which prevents the resource from being reclaimed.","This does not necessarily apply in languages or frameworks that automatically perform garbage collection, since the removal of all references may act as a signal that the resource is ready to be reclaimed.",,Medium to High,
519 CWE-772,EN-Missing Release of Resource after Effective Lifetime (Type: Base),"The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.","When a resource is not released after use, it can allow attackers to cause a denial of service.",,Medium to High,
520 CWE-773,EN-Missing Reference to Active File Descriptor or Handle (Type: Variant),"The software does not properly maintain references to a file descriptor or handle, which prevents that file descriptor/handle from being reclaimed.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,
521 CWE-774,EN-Allocation of File Descriptors or Handles Without Limits or Throttling (Type: Variant),"The software allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
522 CWE-775,EN-Missing Release of File Descriptor or Handle after Effective Lifetime (Type: Variant),"The software does not release a file descriptor or handle after its effective lifetime has ended, i.e., after the file descriptor/handle is no longer needed.","When a file descriptor or handle is not released after use (typically by explicitly closing it), attackers can cause a denial of service by consuming all available file descriptors/handles, or otherwise preventing other system processes from obtaining their own file descriptors/handles.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""File Descriptor Leaks"", Page 582."
523 CWE-804,EN-Guessable CAPTCHA (Type: Base),"The software uses a CAPTCHA challenge, but the challenge can be guessed or automatically recognized by a non-human actor.","An automated attacker could bypass the intended protection of the CAPTCHA challenge and perform actions at a higher frequency than humanly possible, such as launching spam attacks.
524 There can be several different causes of a guessable CAPTCHA:
525 An audio or visual image that does not have sufficient distortion from the unobfuscated source image.
526 A question is generated that with a format that can be automatically recognized, such as a math question.
527 A question for which the number of possible answers is limited, such as birth years or favorite sports teams.
528 A general-knowledge or trivia question for which the answer can be accessed using a data base, such as country capitals or popular actors.
529 Other data associated with the CAPTCHA may provide hints about its contents, such as an image whose filename contains the word that is used in the CAPTCHA.",,Medium to High,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
530 CWE-805,EN-Buffer Access with Incorrect Length Value (Type: Base),"The software uses a sequential operation to read or write a buffer, but it uses an incorrect length value that causes it to access memory that is outside of the bounds of the buffer.","When the length value exceeds the size of the destination, a buffer overflow could occur.",,Medium to High,"Writing Secure Code: Chapter 6, ""Why ACLs Are Important"" Page 171
531 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
532 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
533 PaX: http://en.wikipedia.org/wiki/PaX
534 Top 25 Series - Rank 12 - Buffer Access with Incorrect Length Value: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-12-buffer-access-with-incorrect-length-value/
535 Safe C String Library v1.0.3: http://www.zork.org/safestr/
536 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
537 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
538 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
539 CWE-806,EN-Buffer Access Using Size of Source Buffer (Type: Variant),"The software uses the size of a source buffer when reading from or writing to a destination buffer, which may cause it to access memory that is outside of the bounds of the buffer.","When the size of the destination is smaller than the size of the source, a buffer overflow could occur.",,Medium to High,"Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
540 Safe C String Library v1.0.3: http://www.zork.org/safestr/
541 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
542 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
543 PaX: http://en.wikipedia.org/wiki/PaX
544 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx"
545 CWE-807,EN-Reliance on Untrusted Inputs in a Security Decision (Type: Base),"The application uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.","Developers may assume that inputs such as cookies, environment variables, and hidden form fields cannot be modified. However, an attacker could change these inputs using customized clients or other attacks. This change might not be detected. When security decisions such as authentication and authorization are made based on the values of these inputs, attackers can bypass the security of the software.
546 Without sufficient encryption, integrity checking, or other mechanism, any input that originates from an outsider cannot be trusted.",,Medium to High,"Top 25 Series - Rank 6 - Reliance on Untrusted Inputs in a Security Decision: http://blogs.sans.org/appsecstreetfighter/2010/03/05/top-25-series-rank-6-reliance-on-untrusted-inputs-in-a-security-decision/
547 HMAC: http://en.wikipedia.org/wiki/Hmac
548 Understanding ASP.NET View State: http://msdn.microsoft.com/en-us/library/ms972976.aspx
549 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
550 CWE-93,EN-Improper Neutralization of CRLF Sequences (CRLF Injection) (Type: Base),"The software uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.","Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Medium to High,CRLF Injection: http://marc.info/?l=bugtraq&m=102088154213630&w=2
551 CWE-102,EN-Struts: Duplicate Validation Forms (Type: Variant),"The application uses multiple validation forms with the same name, which might cause the Struts Validator to validate a form that the programmer does not expect.","If two validation forms have the same name, the Struts Validator arbitrarily chooses one of the forms to use for input validation and discards the other. This decision might not correspond to the programmer's expectations, possibly leading to resultant weaknesses. Moreover, it indicates that the validation logic is not up-to-date, and can indicate that other, more subtle validation errors are present.",,Unknown,
552 CWE-103,EN-Struts: Incomplete validate() Method Definition (Type: Variant),"The application has a validator form that either does not define a validate() method, or defines a validate() method but does not call super.validate().","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
553 CWE-104,EN-Struts: Form Bean Does Not Extend Validation Class (Type: Variant),"If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
554 CWE-105,EN-Struts: Form Field Without Validator (Type: Variant),"The application has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
555 CWE-106,EN-Struts: Plug-in Framework not in Use (Type: Variant),"When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
556 CWE-107,EN-Struts: Unused Validation Form (Type: Variant),An unused validation form indicates that validation logic is not up-to-date.,It is easy for developers to forget to update validation logic when they remove or rename action form mappings. One indication that validation logic is not being properly maintained is the presence of an unused validation form.,,Unknown,
557 CWE-108,EN-Struts: Unvalidated Action Form (Type: Variant),Every Action Form must have a corresponding validation form.,"If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
558 CWE-109,EN-Struts: Validator Turned Off (Type: Variant),"Automatic filtering via a Struts bean has been turned off, which disables the Struts Validator and custom validation logic. This exposes the application to other weaknesses related to insufficient input validation.","If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
559 CWE-11,EN-ASP.NET Misconfiguration: Creating Debug Binary (Type: Variant),Debugging messages help attackers learn about the system and plan a form of attack.,ASP .NET applications can be configured to produce debug binaries. These binaries give detailed debugging messages and should not be used in production environments. Debug binaries are meant to be used in a development or testing environment and can pose a security risk if they are deployed to production.,,Unknown,
560 CWE-110,EN-Struts: Validator Without Form Field (Type: Variant),Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.,It is easy for developers to forget to update validation logic when they make changes to an ActionForm class. One indication that validation logic is not being properly maintained is inconsistencies between the action form and the validation form.,,Unknown,
561 CWE-111,EN-Direct Use of Unsafe JNI (Type: Base),"When a Java application uses the Java Native Interface (JNI) to call code written in another programming language, it can expose the application to weaknesses in that code, even if those weaknesses cannot occur in Java.","Many safety features that programmers may take for granted simply do not apply for native code, so you must carefully review all such code for potential problems. The languages used to implement native code may be more susceptible to buffer overflows and other attacks. Native code is unprotected by the security features enforced by the runtime environment, such as strong typing and array bounds checking.",,Unknown,"Fortify Descriptions: http://vulncat.fortifysoftware.com
562 The Java(TM) Tutorial: The Java Native Interface: http://java.sun.com/docs/books/tutorial/native1.1/"
563 CWE-112,EN-Missing XML Validation (Type: Base),The software accepts XML from an untrusted source but does not validate the XML against the proper schema.,"Most successful attacks begin with a violation of the programmer's assumptions. By accepting an XML document without validating it against a DTD or XML schema, the programmer leaves a door open for attackers to provide unexpected, unreasonable, or malicious input.",,Unknown,
564 CWE-113,EN-Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Response Splitting) (Type: Base),"The software receives data from an upstream component, but does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.","Including unvalidated data in an HTTP header allows an attacker to specify the entirety of the HTTP response rendered by the browser. When an HTTP request contains unexpected CR (carriage return, also given by %0d or \r) and LF (line feed, also given by %0a or \n) characters the server may respond with an output stream that is interpreted as two different HTTP responses (instead of one). An attacker can control the second response and mount attacks such as cross-site scripting and cache poisoning attacks.
565 HTTP response splitting weaknesses may be present when:
566 Data enters a web application through an untrusted source, most frequently an HTTP request.
567 The data is included in an HTTP response header sent to a web user without being validated for malicious characters.",,Unknown,"OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007
568 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31"
569 CWE-114,EN-Process Control (Type: Base),Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.,"Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
570 CWE-115,EN-Misinterpretation of Input (Type: Base),"The software misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.","Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
571 CWE-118,EN-Improper Access of Indexable Resource (Range Error) (Type: Class),"The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.","This can allow an attacker to forge log entries or inject malicious content into logs.
572 Log forging vulnerabilities occur when:
573 Data enters an application from an untrusted source.
574 The data is written to an application or system log file.",,Unknown,
575 CWE-12,EN-ASP.NET Misconfiguration: Missing Custom Error Page (Type: Variant),An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.,"Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
576 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,Unknown,"19 Deadly Sins of Software Security
577 ASP.NET Misconfiguration: Missing Custom Error Handling: http://www.owasp.org/index.php/ASP.NET_Misconfiguration:_Missing_Custom_Error_Handling"
578 CWE-125,EN-Out-of-bounds Read (Type: Base),"The software reads data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
579 CWE-126,EN-Buffer Over-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.,This typically occurs when the pointer or its index is incremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in exposure of sensitive information or possibly a crash.,,Unknown,
580 CWE-127,EN-Buffer Under-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations prior to the targeted buffer.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,
581 CWE-13,EN-ASP.NET Misconfiguration: Password in Configuration File (Type: Variant),Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource making them an easy target for attackers.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,"How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI: http://msdn.microsoft.com/en-us/library/ms998280.aspx
582 How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA: http://msdn.microsoft.com/en-us/library/ms998283.aspx
583 .NET Framework Developer's Guide - Securing Connection Strings: http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx"
584 CWE-130,EN-Improper Handling of Length Parameter Inconsistency (Type: Variant),"The software parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
585 CWE-132,EN-DEPRECATED (Duplicate): Miscalculated Null Termination (Type: Base),This entry has been deprecated because it was a duplicate of CWE-170. All content has been transferred to CWE-170.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
586 CWE-135,EN-Incorrect Calculation of Multi-Byte String Length (Type: Base),The software does not correctly calculate the length of strings that can contain wide or multi-byte characters.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,"Writing Secure Code: Chapter 5, ""Unicode and ANSI Buffer Size Mismatches"" Page 153"
587 CWE-138,EN-Improper Neutralization of Special Elements (Type: Class),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as control elements or syntactic markers when they are sent to a downstream component.","Most languages and protocols have their own special elements such as characters and reserved words. These special elements can carry control implications. If software does not prevent external control or influence over the inclusion of such special elements, the control flow of the program may be altered from what was intended. For example, both Unix and Windows interpret the symbol < (""less than"") as meaning ""read input from a file"".",,Unknown,
588 CWE-14,EN-Compiler Removal of Code to Clear Buffers (Type: Base),"Sensitive memory is cleared according to the source code, but compiler optimizations leave the memory untouched when it is not read from again, aka ""dead store removal.""","This compiler optimization error occurs when:
589 1. Secret data are stored in memory.
590 2. The secret data are scrubbed from memory by overwriting its contents.
591 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322
592 When scrubbing secrets in memory doesn't work: http://cert.uni-stuttgart.de/archive/bugtraq/2002/11/msg00046.html
593 Some Bad News and Some Good News: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure10102002.asp
594 GNU GCC: Optimizer Removes Code Necessary for Security: http://www.derkeiler.com/Mailing-Lists/securityfocus/bugtraq/2002-11/0257.html"
595 CWE-140,EN-Improper Neutralization of Delimiters (Type: Base),The software does not neutralize or incorrectly neutralizes delimiters.,"This compiler optimization error occurs when:
596 1. Secret data are stored in memory.
597 2. The secret data are scrubbed from memory by overwriting its contents.
598 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,
599 CWE-141,EN-Improper Neutralization of Parameter/Argument Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as parameter or argument delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408.
600 The Art of Software Security Assessment: Chapter 10, ""IFS"", Page 604."
601 CWE-142,EN-Improper Neutralization of Value Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as value delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
602 CWE-143,EN-Improper Neutralization of Record Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as record delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
603 CWE-144,EN-Improper Neutralization of Line Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as line delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
604 CWE-145,EN-Improper Neutralization of Section Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as section delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.
605 One example of a section delimiter is the boundary string in a multipart MIME message. In many cases, doubled line delimiters can serve as a section delimiter.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
606 CWE-146,EN-Improper Neutralization of Expression/Command Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as expression or command delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
607 CWE-147,EN-Improper Neutralization of Input Terminators (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as input terminators when they are sent to a downstream component.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
608 CWE-148,EN-Improper Neutralization of Input Leaders (Type: Variant),"The application does not properly handle when a leading character or sequence (""leader"") is missing or malformed, or if multiple leaders are used when only one should be allowed.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
609 CWE-149,EN-Improper Neutralization of Quoting Syntax (Type: Variant),"Quotes injected into an application can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
610 CWE-15,EN-External Control of System or Configuration Setting (Type: Base),One or more system settings or configuration elements can be externally controlled by a user.,"Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.",,Unknown,
611 CWE-150,"EN-Improper Neutralization of Escape, Meta, or Control Sequences (Type: Variant)","The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
612 CWE-151,EN-Improper Neutralization of Comment Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as comment delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
613 CWE-152,EN-Improper Neutralization of Macro Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as macro symbols when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
614 CWE-153,EN-Improper Neutralization of Substitution Characters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as substitution characters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
615 CWE-154,EN-Improper Neutralization of Variable Name Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as variable name delimiters when they are sent to a downstream component.","As data is parsed, an injected delimiter may cause the process to take unexpected actions that result in an attack. Example: ""$"" for an environment variable.",,Unknown,
616 CWE-155,EN-Improper Neutralization of Wildcards or Matching Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as wildcards or matching symbols when they are sent to a downstream component.","As data is parsed, an injected element may cause the process to take unexpected actions.",,Unknown,
617 CWE-156,EN-Improper Neutralization of Whitespace (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as whitespace when they are sent to a downstream component.","This can include space, tab, etc.",,Unknown,
618 CWE-157,EN-Failure to Sanitize Paired Delimiters (Type: Variant),"The software does not properly handle the characters that are used to mark the beginning and ending of a group of entities, such as parentheses, brackets, and braces.","This can include space, tab, etc.",,Unknown,
619 CWE-158,EN-Improper Neutralization of Null Byte or NUL Character (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component.","As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL Character Injection"", Page 411."
620 CWE-159,EN-Failure to Sanitize Special Element (Type: Class),Weaknesses in this attack-focused category do not properly filter and interpret special elements in user-controlled input which could cause adverse effect on the software behavior and integrity.,"As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,
621 CWE-160,EN-Improper Neutralization of Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
622 CWE-161,EN-Improper Neutralization of Multiple Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
623 CWE-162,EN-Improper Neutralization of Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
624 CWE-163,EN-Improper Neutralization of Multiple Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
625 CWE-164,EN-Improper Neutralization of Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
626 CWE-165,EN-Improper Neutralization of Multiple Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
627 CWE-166,EN-Improper Handling of Missing Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an expected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
628 CWE-167,EN-Improper Handling of Additional Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an additional unexpected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
629 CWE-168,EN-Improper Handling of Inconsistent Special Elements (Type: Base),The software does not handle when an inconsistency exists between two or more special characters or reserved words.,"An example of this problem would be if paired characters appear in the wrong order, or if the special characters are not properly nested.",,Unknown,
630 CWE-172,EN-Encoding Error (Type: Class),"The software does not properly encode or decode the data, resulting in unexpected values.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
631 CWE-173,EN-Improper Handling of Alternate Encoding (Type: Variant),The software does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
632 CWE-174,EN-Double Decoding of the Same Data (Type: Variant),"The software decodes the same input twice, which can limit the effectiveness of any protection mechanism that occurs in between the decoding operations.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
633 CWE-175,EN-Improper Handling of Mixed Encoding (Type: Variant),The software does not properly handle when the same input uses several different (mixed) encodings.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
634 CWE-176,EN-Improper Handling of Unicode Encoding (Type: Variant),The software does not properly handle when an input contains Unicode encoding.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Sets and Unicode"", Page 446."
635 CWE-177,EN-Improper Handling of URL Encoding (Hex Encoding) (Type: Variant),The software does not properly handle when all or part of an input has been URL encoded.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
636 CWE-178,EN-Improper Handling of Case Sensitivity (Type: Base),"The software does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.","Improperly handled case sensitive data can lead to several possible consequences, including:
637 case-insensitive passwords reducing the size of the key space, making brute force attacks easier
638 bypassing filters or access controls using alternate names
639 multiple interpretation errors using alternate names.",,Unknown,
640 CWE-179,EN-Incorrect Behavior Order: Early Validation (Type: Base),"The software validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification.","Software needs to validate data at the proper time, after data has been canonicalized and cleansed. Early validation is susceptible to various manipulations that result in dangerous inputs that are produced by canonicalization and cleansing.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Escaping Metacharacters"", Page 439."
641 CWE-180,EN-Incorrect Behavior Order: Validate Before Canonicalize (Type: Base),"The software validates input before it is canonicalized, which prevents the software from detecting data that becomes invalid after the canonicalization step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
642 CWE-181,EN-Incorrect Behavior Order: Validate Before Filter (Type: Base),"The software validates data before it has been filtered, which prevents the software from detecting data that becomes invalid after the filtering step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
643 CWE-182,EN-Collapse of Data into Unsafe Value (Type: Base),"The software filters data in a way that causes it to be reduced or ""collapsed"" into an unsafe value that violates an expected security property.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
644 CWE-183,EN-Permissive Whitelist (Type: Base),"An application uses a ""whitelist"" of acceptable values, but the whitelist includes at least one unsafe value, leading to resultant weaknesses.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
645 CWE-184,EN-Incomplete Blacklist (Type: Base),"An application uses a ""blacklist"" of prohibited values, but the blacklist is incomplete.","If an incomplete blacklist is used as a security mechanism, then the software may allow unintended values to pass into the application logic.",,Unknown,"Exploiting Software: How to Break Code
646 Blacklist defenses as a breeding ground for vulnerability variants: http://seclists.org/fulldisclosure/2006/Feb/0040.html
647 The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
648 CWE-185,EN-Incorrect Regular Expression (Type: Class),The software specifies a regular expression in a way that causes data to be improperly matched or compared.,"When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,"Writing Secure Code: Chapter 10, ""Using Regular Expressions for Checking Input"" Page 350"
649 CWE-186,EN-Overly Restrictive Regular Expression (Type: Base),"A regular expression is overly restrictive, which prevents dangerous values from being detected.","When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,
650 CWE-187,EN-Partial Comparison (Type: Base),"The software performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Unknown,
651 CWE-191,EN-Integer Underflow (Wrap or Wraparound) (Type: Base),"The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.",This can happen in signed and unsigned cases.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119"
652 CWE-193,EN-Off-by-one Error (Type: Base),"A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.",This can happen in signed and unsigned cases.,,Unknown,"Third Generation Exploits: http://www.blackhat.com/presentations/bh-europe-01/halvar-flake/bh-europe-01-halvarflake.ppt
653 Off-by-one errors: a brief explanation: http://marc.theaimsgroup.com/?l=secprog&m=108379742110553&w=2
654 The Frame Pointer Overwrite: http://kaizo.org/mirrors/phrack/phrack55/P55-08
655 Exploiting Software: How to Break Code (The buffer overflow chapter)
656 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
657 The Art of Software Security Assessment: Chapter 5, ""Off-by-One Errors"", Page 180."
658 CWE-195,EN-Signed to Unsigned Conversion Error (Type: Variant),"A signed-to-unsigned conversion error takes place when a signed primitive is used as an unsigned value, usually as a size variable.",It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
659 CWE-198,EN-Use of Incorrect Byte Ordering (Type: Base),"The software receives input from an upstream component, but it does not account for byte ordering (e.g. big-endian and little-endian) when processing the input, causing an incorrect number or value to be used.","When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Unknown,
660 CWE-201,EN-Information Exposure Through Sent Data (Type: Variant),The accidental exposure of sensitive information through sent data refers to the transmission of data which are either sensitive in and of itself or useful in the further exploitation of the system through standard data channels.,"The information either
661 is regarded as sensitive within the product's own functionality, such as a private message; or
662 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
663 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,Unknown,
664 CWE-203,EN-Information Exposure Through Discrepancy (Type: Class),"The product behaves differently or sends different responses in a way that exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Unknown,
665 CWE-204,EN-Response Discrepancy Information Exposure (Type: Base),The software provides different responses to incoming requests in a way that allows an actor to determine system state information that is outside of that actor's control sphere.,"This issue frequently occurs during authentication, where a difference in failed-login messages could allow an attacker to determine if the username is valid or not. These exposures can be inadvertent (bug) or intentional (design).",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
666 CWE-205,EN-Information Exposure Through Behavioral Discrepancy (Type: Base),The product's actions indicate important differences based on (1) the internal state of the product or (2) differences from other products in the same class.,"For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
667 CWE-206,EN-Information Exposure of Internal State Through Behavioral Inconsistency (Type: Variant),"Two separate operations in a product cause the product to behave differently in a way that is observable to an attacker and reveals security-relevant information about the internal state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
668 CWE-207,EN-Information Exposure Through an External Behavioral Inconsistency (Type: Variant),"The product behaves differently than other products like it, in a way that is observable to an attacker and exposes security-relevant information about which product is being used.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
669 CWE-208,EN-Information Exposure Through Timing Discrepancy (Type: Base),"Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
670 CWE-210,EN-Information Exposure Through Self-generated Error Message (Type: Base),The software identifies an error condition and creates its own diagnostic or error messages that contain sensitive information.,"The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
671 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
672 CWE-211,EN-Information Exposure Through Externally-generated Error Message (Type: Base),"The software performs an operation that triggers an external diagnostic or error message that is not directly generated by the software, such as an error generated by the programming language interpreter that the software uses. The error can contain sensitive system information.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,
673 CWE-212,EN-Improper Cross-boundary Removal of Sensitive Data (Type: Base),"The software uses a resource that contains sensitive data, but it does not properly remove that data before it stores, transfers, or shares the resource with actors in another control sphere.","Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
674 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
675 CWE-213,EN-Intentional Information Exposure (Type: Base),A product's design or configuration explicitly requires the publication of information that could be regarded as sensitive by an administrator.,"Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
676 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
677 CWE-214,EN-Information Exposure Through Process Environment (Type: Variant),"A process is invoked with sensitive arguments, environment variables, or other elements that can be seen by other processes on the operating system.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
678 CWE-215,EN-Information Exposure Through Debug Information (Type: Variant),The application contains debugging code that can expose sensitive information to untrusted parties.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
679 CWE-216,EN-Containment Errors (Container Errors) (Type: Class),"This tries to cover various problems in which improper data are included within a ""container.""","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
680 CWE-217,EN-DEPRECATED: Failure to Protect Stored Data from Modification (Type: Base),This weakness has been deprecated because it incorporated and confused multiple weaknesses. The issues formerly covered in this weakness can be found at CWE-766 and CWE-767.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
681 CWE-218,EN-DEPRECATED (Duplicate): Failure to provide confidentiality for stored data (Type: Base),This weakness has been deprecated because it was a duplicate of CWE-493. All content has been transferred to CWE-493.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
682 CWE-219,EN-Sensitive Data Under Web Root (Type: Variant),"The application stores sensitive data under the web document root with insufficient access control, which might make it accessible to untrusted parties.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
683 CWE-220,EN-Sensitive Data Under FTP Root (Type: Variant),"The application stores sensitive data under the FTP document root with insufficient access control, which might make it accessible to untrusted parties.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
684 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,Unknown,
685 CWE-221,EN-Information Loss or Omission (Type: Class),"The software does not record, or improperly records, security-relevant information that leads to an incorrect decision or hampers later analysis.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
686 CWE-222,EN-Truncation of Security-relevant Information (Type: Base),"The application truncates the display, recording, or processing of security-relevant information in a way that can obscure the source or nature of an attack.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
687 CWE-223,EN-Omission of Security-relevant Information (Type: Base),"The application does not record or display information that would be important for identifying the source or nature of an attack, or determining if an action is safe.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
688 CWE-224,EN-Obscured Security-relevant Information by Alternate Name (Type: Base),"The software records security-relevant information according to an alternate name of the affected entity, instead of the canonical name.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,Writing Secure Code
689 CWE-225,EN-DEPRECATED (Duplicate): General Information Management Problems (Type: Base),This weakness can be found at CWE-199.,"This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
690 CWE-226,EN-Sensitive Information Uncleared Before Release (Type: Base),"The software does not fully clear previously used information in a data structure, file, or other resource, before making that resource available to a party in another control sphere.","This typically results from new data that is not as long as the old data, which leaves portions of the old data still available. Equivalent errors can occur in other situations where the length of data is variable but the associated data structure is not. If memory is not cleared after use, it may allow unintended actors to read the data when the memory is reallocated.",,Unknown,
691 CWE-227,EN-Improper Fulfillment of API Contract (API Abuse) (Type: Class),The software uses an API in a manner contrary to its intended use.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
692 CWE-228,EN-Improper Handling of Syntactically Invalid Structure (Type: Class),The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
693 CWE-229,EN-Improper Handling of Values (Type: Base),"The software does not properly handle when the expected number of values for parameters, fields, or arguments is not provided in input, or if those values are undefined.","An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
694 CWE-23,EN-Relative Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as "".."" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"OWASP Attack listing: http://www.owasp.org/index.php/Relative_Path_Traversal
695 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
696 CWE-230,EN-Improper Handling of Missing Values (Type: Variant),"The software does not handle or incorrectly handles when a parameter, field, or argument name is specified, but the associated value is missing, i.e. it is empty, blank, or null.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
697 CWE-231,EN-Improper Handling of Extra Values (Type: Variant),The software does not handle or incorrectly handles when more values are provided than expected.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
698 CWE-232,EN-Improper Handling of Undefined Values (Type: Variant),"The software does not handle or incorrectly handles when a value is not defined or supported for the associated parameter, field, or argument name.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
699 CWE-233,EN-Improper Handling of Parameters (Type: Base),"The software does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
700 CWE-235,EN-Improper Handling of Extra Parameters (Type: Variant),"The software does not handle or incorrectly handles when the number of parameters, fields, or arguments with the same name exceeds the expected amount.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
701 CWE-236,EN-Improper Handling of Undefined Parameters (Type: Variant),"The software does not handle or incorrectly handles when a particular parameter, field, or argument name is not defined or supported by the product.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
702 CWE-237,EN-Improper Handling of Structural Elements (Type: Base),The software does not handle or incorrectly handles inputs that are related to complex structures.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
703 CWE-238,EN-Improper Handling of Incomplete Structural Elements (Type: Variant),The software does not handle or incorrectly handles when a particular structural element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
704 CWE-239,EN-Failure to Handle Incomplete Element (Type: Variant),The software does not properly handle when a particular element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
705 CWE-24,EN-Path Traversal: ../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
706 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
707 CWE-240,EN-Improper Handling of Inconsistent Structural Elements (Type: Variant),"The software does not handle or incorrectly handles when two or more structural elements should be consistent, but are not.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
708 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
709 CWE-241,EN-Improper Handling of Unexpected Data Type (Type: Base),"The software does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
710 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
711 CWE-244,EN-Improper Clearing of Heap Memory Before Release (Heap Inspection) (Type: Variant),"Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
712 CWE-245,EN-J2EE Bad Practices: Direct Management of Connections (Type: Variant),"The J2EE application directly manages connections, instead of using the container's connection management facilities.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
713 CWE-246,EN-J2EE Bad Practices: Direct Use of Sockets (Type: Variant),The J2EE application directly uses sockets instead of using framework method calls.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
714 CWE-247,EN-DEPRECATED (Duplicate): Reliance on DNS Lookups in a Security Decision (Type: Base),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
715 CWE-248,EN-Uncaught Exception (Type: Base),"An exception is thrown from a function, but it is not caught.","When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
716 CWE-249,EN-DEPRECATED: Often Misused: Path Manipulation (Type: Variant),This entry has been deprecated because of name confusion and an accidental combination of multiple weaknesses. Most of its content has been transferred to CWE-785.,"When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
717 CWE-25,EN-Path Traversal: /../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
718 Sometimes a program checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
719 CWE-26,EN-Path Traversal: /dir/../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/dir/../filename"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
720 The '/dir/../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
721 CWE-260,EN-Password in Configuration File (Type: Variant),The software stores a password in a configuration file that might be accessible to actors who do not know the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
722 CWE-261,EN-Weak Cryptography for Passwords (Type: Variant),Obscuring a password with a trivial encoding does not protect the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,"Building Secure Software: How to Avoid Security Problems the Right Way
723 24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
724 CWE-266,EN-Incorrect Privilege Assignment (Type: Base),"A product incorrectly assigns a privilege to a particular actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
725 CWE-267,EN-Privilege Defined With Unsafe Actions (Type: Base),"A particular privilege, role, capability, or right can be used to perform unsafe actions that were not intended, even when it is assigned to the correct entity.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
726 CWE-27,EN-Path Traversal: dir/../../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize multiple internal ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
727 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,
728 CWE-270,EN-Privilege Context Switching Error (Type: Base),The software does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
729 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
730 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
731 CWE-272,EN-Least Privilege Violation (Type: Base),The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,Unknown,
732 CWE-274,EN-Improper Handling of Insufficient Privileges (Type: Base),"The software does not handle or incorrectly handles when it has insufficient privileges to perform an operation, leading to resultant weaknesses.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
733 CWE-277,EN-Insecure Inherited Permissions (Type: Variant),A product defines a set of insecure permissions that are inherited by objects that are created by the program.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
734 CWE-278,EN-Insecure Preserved Inherited Permissions (Type: Variant),"A product inherits a set of insecure permissions for an object, e.g. when copying from an archive file, without user awareness or involvement.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
735 CWE-279,EN-Incorrect Execution-Assigned Permissions (Type: Variant),"While it is executing, the software sets the permissions of an object in a way that violates the intended permissions that have been specified by the user.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
736 CWE-28,EN-Path Traversal: ..\filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""..\"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
737 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
738 CWE-280,EN-Improper Handling of Insufficient Permissions or Privileges (Type: Base),The application does not handle or incorrectly handles when it has insufficient privileges to access resources or functionality as specified by their permissions. This may cause it to follow unexpected code paths that may leave the application in an invalid state.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
739 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
740 CWE-281,EN-Improper Preservation of Permissions (Type: Base),"The software does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
741 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
742 CWE-282,EN-Improper Ownership Management (Type: Class),"The software assigns the wrong ownership, or does not properly verify the ownership, of an object or resource.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
743 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
744 CWE-283,EN-Unverified Ownership (Type: Base),The software does not properly verify that a critical resource is owned by the proper entity.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
745 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
746 CWE-284,EN-Improper Access Control (Type: Class),The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.,"Access control involves the use of several protection mechanisms such as authentication (proving the identity of an actor) authorization (ensuring that a given actor can access a resource), and accountability (tracking of activities that were performed). When any mechanism is not applied or otherwise fails, attackers can compromise the security of the software by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
747 There are two distinct behaviors that can introduce access control weaknesses:
748 Specification: incorrect privileges, permissions, ownership, etc. are explicitly specified for either the user or the resource (for example, setting a password file to be world-writable, or giving administrator capabilities to a guest user). This action could be performed by the program or the administrator.
749 Enforcement: the mechanism contains errors that prevent it from properly enforcing the specified access control requirements (e.g., allowing the user to specify their own privileges, or allowing a syntactically-incorrect ACL to produce insecure settings). This problem occurs within the program itself, in that it does not actually enforce the intended security policy that the administrator specifies.",,Unknown,"Writing Secure Code: Chapter 6, ""Determining Appropriate Access Control"" Page 171
750 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253"
751 CWE-286,EN-Incorrect User Management (Type: Class),The software does not properly manage a user within its environment.,Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
752 CWE-288,EN-Authentication Bypass Using an Alternate Path or Channel (Type: Base),"A product requires authentication, but the product has an alternate path or channel that does not require authentication.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
753 CWE-289,EN-Authentication Bypass by Alternate Name (Type: Variant),"The software performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
754 CWE-29,EN-Path Traversal: \..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
755 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
756 CWE-290,EN-Authentication Bypass by Spoofing (Type: Base),This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
757 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""Spoofing and Identification"", Page 72."
758 CWE-295,EN-Improper Certificate Validation (Type: Base),"The software does not validate, or incorrectly validates, a certificate.","When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by using a man-in-the-middle (MITM) attack. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.",,Unknown,"Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
759 Computer Security: Art and Science"
760 CWE-30,EN-Path Traversal: \dir\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\dir\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
761 This is similar to CWE-26, except using ""\"" instead of ""/"". The '\dir\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check.",,Unknown,
762 CWE-300,EN-Channel Accessible by Non-Endpoint (Man-in-the-Middle) (Type: Class),"The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.","In order to establish secure communication between two parties, it is often important to adequately verify the identity of entities at each end of the communication channel. Inadequate or inconsistent verification may result in insufficient or incorrect identification of either communicating entity. This can have negative consequences such as misplaced trust in the entity at the other end of the channel. An attacker can leverage this by interposing between the communicating entities and masquerading as the original entity. In the absence of sufficient verification of identity, such an attacker can eavesdrop and potentially modify the communication between the original entities.",,Unknown,Computer Security: Art and Science
763 CWE-302,EN-Authentication Bypass by Assumed-Immutable Data (Type: Variant),"The authentication scheme or implementation uses key data elements that are assumed to be immutable, but can be controlled or modified by the attacker.","A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Unknown,
764 CWE-303,EN-Incorrect Implementation of Authentication Algorithm (Type: Base),"The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect.",This incorrect implementation may allow authentication to be bypassed.,,Unknown,
765 CWE-304,EN-Missing Critical Step in Authentication (Type: Base),"The software implements an authentication technique, but it skips a step that weakens the technique.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
766 CWE-305,EN-Authentication Bypass by Primary Weakness (Type: Base),"The authentication algorithm is sound, but the implemented mechanism can be bypassed as the result of a separate weakness that is primary to the authentication error.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
767 CWE-307,EN-Improper Restriction of Excessive Authentication Attempts (Type: Base),"The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
768 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
769 CWE-31,EN-Path Traversal: dir\..\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize 'dir\..\..\filename' (multiple internal backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
770 The 'dir\..\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""..\"" sequence, so multiple ""..\"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""..\"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
771 CWE-312,EN-Cleartext Storage of Sensitive Information (Type: Base),The application stores sensitive information in cleartext within a resource that might be accessible to another control sphere.,"Because the information is stored in cleartext, attackers could potentially read it. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
772 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
773 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
774 CWE-313,EN-Cleartext Storage in a File or on Disk (Type: Variant),"The application stores sensitive information in cleartext in a file, or on disk.","The sensitive information could be read by attackers with access to the file, or with physical or administrator access to the raw disk. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
775 CWE-314,EN-Cleartext Storage in the Registry (Type: Variant),The application stores sensitive information in cleartext in the registry.,"Attackers can read the information by accessing the registry key. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
776 CWE-315,EN-Cleartext Storage of Sensitive Information in a Cookie (Type: Variant),The application stores sensitive information in cleartext in a cookie.,"Attackers can use widely-available tools to view the cookie and read the sensitive information. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
777 CWE-316,EN-Cleartext Storage of Sensitive Information in Memory (Type: Variant),The application stores sensitive information in cleartext in memory.,"The sensitive memory might be saved to disk, stored in a core dump, or remain uncleared if the application crashes, or if the programmer does not properly clear the memory before freeing it.
778 It could be argued that such problems are usually only exploitable by those with administrator privileges. However, swapping could cause the memory to be written to disk and leave it accessible to physical attack afterwards. Core dump files might have insecure permissions or be stored in archive files that are accessible to untrusted people. Or, uncleared sensitive memory might be inadvertently exposed to attackers due to another weakness.",,Unknown,
779 CWE-317,EN-Cleartext Storage of Sensitive Information in GUI (Type: Variant),The application stores sensitive information in cleartext within the GUI.,"An attacker can often obtain data from a GUI, even if hidden, by using an API to directly access GUI objects such as windows and menus. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
780 CWE-318,EN-Cleartext Storage of Sensitive Information in Executable (Type: Variant),The application stores sensitive information in cleartext in an executable.,"Attackers can reverse engineer binary code to obtain secret data. This is especially easy when the cleartext is plain ASCII. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
781 CWE-32,EN-Path Traversal: ... (Triple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '...' (triple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
782 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
783 CWE-325,EN-Missing Required Cryptographic Step (Type: Base),"The software does not implement a required step in a cryptographic algorithm, resulting in weaker encryption than advertised by that algorithm.","Cryptographic implementations should follow the algorithms that define them exactly, otherwise encryption can be weaker than expected.",,Unknown,
784 CWE-326,EN-Inadequate Encryption Strength (Type: Class),"The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.",A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.,,Unknown,"Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
785 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315"
786 CWE-328,EN-Reversible One-Way Hash (Type: Base),"The product uses a hashing algorithm that produces a hash value that can be used to determine the original input, or to find an input that can produce the same hash, more efficiently than brute force techniques.","This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Unknown,"MD5 considered harmful today: http://www.phreedom.org/research/rogue-ca/
787 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Integrity"", Page 47.
788 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
789 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
790 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
791 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
792 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
793 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
794 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
795 CWE-33,EN-Path Traversal: .... (Multiple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....' (multiple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
796 The '....' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
797 CWE-331,EN-Insufficient Entropy (Type: Base),"The software uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
798 CWE-334,EN-Small Space of Random Values (Type: Base),"The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
799 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
800 CWE-335,EN-PRNG Seed Error (Type: Class),A Pseudo-Random Number Generator (PRNG) uses seeds incorrectly.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
801 CWE-336,EN-Same Seed in PRNG (Type: Base),"A PRNG uses the same seed each time the product is initialized. If an attacker can guess (or knows) the seed, then he/she may be able to determine the ""random"" number produced from the PRNG.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
802 CWE-337,EN-Predictable Seed in PRNG (Type: Base),"A PRNG is initialized from a predictable seed, e.g. using process ID or system time.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
803 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
804 CWE-339,EN-Small Seed Space in PRNG (Type: Base),A PRNG uses a relatively small space of seeds.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
805 CWE-34,EN-Path Traversal: ....// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....//' (doubled dot dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
806 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,
807 CWE-340,EN-Predictability Problems (Type: Class),Weaknesses in this category are related to schemes that generate numbers or identifiers that are more predictable than required by the application.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
808 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
809 CWE-341,EN-Predictable from Observable State (Type: Base),"A number or object is predictable based on observations that the attacker can make about the state of the system or network, such as time, process ID, etc.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
810 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
811 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
812 CWE-342,EN-Predictable Exact Value from Previous Values (Type: Base),An exact value or random number can be precisely predicted by observing previous values.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
813 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
814 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
815 CWE-343,EN-Predictable Value Range from Previous Values (Type: Base),"The software's random number generator produces a series of values which, when observed, can be used to infer a relatively small range of possibilities for the next value that could be generated.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
816 Strange Attractors and TCP/IP Sequence Number Analysis: http://www.bindview.com/Services/Razor/Papers/2001/tcpseq.cfm
817 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
818 CWE-344,EN-Use of Invariant Value in Dynamically Changing Context (Type: Base),"The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
819 CWE-345,EN-Insufficient Verification of Data Authenticity (Type: Class),"The software does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
820 CWE-346,EN-Origin Validation Error (Type: Base),The software does not properly verify that the source of data or communication is valid.,"The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
821 CWE-347,EN-Improper Verification of Cryptographic Signature (Type: Base),"The software does not verify, or incorrectly verifies, the cryptographic signature for data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
822 CWE-348,EN-Use of Less Trusted Source (Type: Base),"The software has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
823 CWE-349,EN-Acceptance of Extraneous Untrusted Data With Trusted Data (Type: Base),"The software, when processing trusted data, accepts any untrusted data that is also included with the trusted data, treating the untrusted data as if it were trusted.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
824 CWE-35,EN-Path Traversal: .../...// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '.../...//' (doubled triple dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
825 The '.../...//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then "".../...//"" can collapse into the ""../"" unsafe value (CWE-182). Removing the first ""../"" yields ""....//""; the second removal yields ""../"". Depending on the algorithm, the software could be susceptible to CWE-34 but not CWE-35, or vice versa.",,Unknown,
826 CWE-350,EN-Reliance on Reverse DNS Resolution for a Security-Critical Action (Type: Variant),"The software performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.","When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
827 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
828 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231
829 24 Deadly Sins of Software Security: ""Sin 24: Trusting Network Name Resolution."" Page 361
830 The Art of Software Security Assessment: Chapter 16, ""DNS Spoofing"", Page 1002."
831 CWE-351,EN-Insufficient Type Distinction (Type: Base),The software does not properly distinguish between different types of elements in a way that leads to insecure behavior.,"When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
832 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
833 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,
834 CWE-356,EN-Product UI does not Warn User of Unsafe Actions (Type: Base),The software's user interface does not warn the user before undertaking an unsafe action on behalf of that user. This makes it easier for attackers to trick users into inflicting damage to their system.,"Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
835 CWE-357,EN-Insufficient UI Warning of Dangerous Operations (Type: Base),"The user interface provides a warning to a user regarding dangerous or sensitive operations, but the warning is not noticeable enough to warrant attention.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
836 CWE-358,EN-Improperly Implemented Security Check for Standard (Type: Base),"The software does not implement or incorrectly implements one or more security-relevant checks as specified by the design of a standardized algorithm, protocol, or technique.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
837 CWE-359,EN-Privacy Violation (Type: Class),"Mishandling private information, such as customer passwords or social security numbers, can compromise user privacy and is often illegal.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,"AOL man pleads guilty to selling 92m email addies: http://www.theregister.co.uk/2005/02/07/aol_email_theft/
838 Safe Harbor Privacy Framework: http://www.export.gov/safeharbor/
839 Financial Privacy: The Gramm-Leach Bliley Act (GLBA): http://www.ftc.gov/privacy/glbact/index.html
840 Health Insurance Portability and Accountability Act (HIPAA): http://www.hhs.gov/ocr/hipaa/
841 California SB-1386: http://info.sen.ca.gov/pub/01-02/bill/sen/sb_1351-1400/sb_1386_bill_20020926_chaptered.html
842 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
843 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
844 CWE-36,EN-Absolute Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as ""/abs/path"" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
845 CWE-363,EN-Race Condition Enabling Link Following (Type: Base),"The software checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the software to access the wrong file.","While developers might expect that there is a very narrow time window between the time of check and time of use, there is still a race condition. An attacker could cause the software to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Race Conditions"", Page 526."
846 CWE-368,EN-Context Switching Race Condition (Type: Base),"A product performs a series of non-atomic actions to switch between contexts that cross privilege or other security boundaries, but a race condition allows an attacker to modify or misrepresent the product's behavior during the switch.","This is commonly seen in web browser vulnerabilities in which the attacker can perform certain actions while the browser is transitioning from a trusted to an untrusted domain, or vice versa, and the browser performs the actions on one domain using the trust level and resources of the other domain.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
847 CWE-37,EN-Path Traversal: /absolute/pathname/here (Type: Variant),A software system that accepts input in the form of a slash absolute path ('/absolute/pathname/here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Unknown,
848 CWE-372,EN-Incomplete Internal State Distinction (Type: Base),"The software does not properly determine which state it is in, causing it to assume it is in state X when in fact it is in state Y, causing it to perform incorrect operations in a security-relevant manner.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
849 CWE-373,EN-DEPRECATED: State Synchronization Error (Type: Base),This entry was deprecated because it overlapped the same concepts as race condition (CWE-362) and Improper Synchronization (CWE-662).,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
850 CWE-377,EN-Insecure Temporary File (Type: Base),Creating and using insecure temporary files can leave application and system data vulnerable to attack.,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,"Writing Secure Code: Chapter 23, ""Creating Temporary Files Securely"" Page 682
851 The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538.
852 The Art of Software Security Assessment: Chapter 11, ""File Squatting"", Page 662."
853 CWE-38,EN-Path Traversal: \absolute\pathname\here (Type: Variant),A software system that accepts input in the form of a backslash absolute path ('\absolute\pathname\here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
854 CWE-382,EN-J2EE Bad Practices: Use of System.exit() (Type: Variant),"A J2EE application uses System.exit(), which also shuts down its container.","On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
855 CWE-383,EN-J2EE Bad Practices: Direct Use of Threads (Type: Variant),Thread management in a Web application is forbidden in some circumstances and is always highly error prone.,"Thread management in a web application is forbidden by the J2EE standard in some circumstances and is always highly error prone. Managing threads is difficult and is likely to interfere in unpredictable ways with the behavior of the application container. Even without interfering with the container, thread management usually leads to bugs that are hard to detect and diagnose like deadlock, race conditions, and other synchronization errors.",,Unknown,
856 CWE-386,EN-Symbolic Name not Mapping to Correct Object (Type: Base),"A constant symbolic reference to an object is used, even though the reference can resolve to a different object over time.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
857 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
858 CWE-39,EN-Path Traversal: C:dirname (Type: Variant),An attacker can inject a drive letter or Windows volume letter ('C:dirname') into a software system to potentially redirect access to an unintended location or arbitrary file.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
859 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
860 CWE-392,EN-Missing Report of Error Condition (Type: Base),The software encounters an error but does not provide a status code or return value to indicate that an error has occurred.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
861 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
862 CWE-393,EN-Return of Wrong Status Code (Type: Base),"A function or operation returns an incorrect return value or status code that does not indicate an error, but causes the product to modify its behavior based on the incorrect result.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
863 CWE-394,EN-Unexpected Status Code or Return Value (Type: Base),"The software does not properly check when a function or operation returns a value that is legitimate for the function, but is not expected by the software.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
864 CWE-395,EN-Use of NullPointerException Catch to Detect NULL Pointer Dereference (Type: Base),Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.,"This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
865 CWE-396,EN-Declaration of Catch for Generic Exception (Type: Base),Catching overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Multiple catch blocks can get ugly and repetitive, but ""condensing"" catch blocks by catching a high-level class like Exception can obscure exceptions that deserve special treatment or that should not be caught at this point in the program. Catching an overly broad exception essentially defeats the purpose of Java's typed exceptions, and can become particularly dangerous if the program grows and begins to throw new types of exceptions. The new exception types will not receive any attention.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 9: Catching Exceptions."" Page 157"
866 CWE-397,EN-Declaration of Throws for Generic Exception (Type: Base),Throwing overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Declaring a method to throw Exception or Throwable makes it difficult for callers to perform proper error handling and error recovery. Java's exception mechanism, for example, is set up to make it easy for callers to anticipate what can go wrong and write code to handle each specific exceptional circumstance. Declaring that a method throws a generic form of exception defeats this system.",,Unknown,
867 CWE-398,EN-Indicator of Poor Code Quality (Type: Class),"The code has features that do not directly introduce a weakness or vulnerability, but indicate that the product has not been carefully developed or maintained.","Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,
868 CWE-40,EN-Path Traversal: \\UNC\share\name\ (Windows UNC Share) (Type: Variant),An attacker can inject a Windows UNC share ('\\UNC\share\name') into a software system to potentially redirect access to an unintended location or arbitrary file.,"Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Filelike Objects"", Page 664."
869 CWE-402,EN-Transmission of Private Resources into a New Sphere (Resource Leak) (Type: Class),The software makes resources available to untrusted parties when those resources are only intended to be accessed by the software.,This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Unknown,
870 CWE-403,EN-Exposure of File Descriptor to Unintended Control Sphere (File Descriptor Leak) (Type: Base),"A process does not close sensitive file descriptors before invoking a child process, which allows the child to perform unauthorized I/O operations using those descriptors.","When a new process is forked or executed, the child process inherits any open file descriptors. When the child process has fewer privileges than the parent process, this might introduce a vulnerability if the child process can access the file descriptor but does not have the privileges to access the associated file.",,Unknown,"File descriptors and setuid applications: https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
871 Introduction to Secure Coding Guide: https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/AccessControl.html"
872 CWE-405,EN-Asymmetric Resource Consumption (Amplification) (Type: Class),Software that does not appropriately monitor or control resource consumption can lead to adverse system performance.,"This situation is amplified if the software allows malicious users or attackers to consume more resources than their access level permits. Exploiting such a weakness can lead to asymmetric resource consumption, aiding in amplification attacks against the system or the network.",,Unknown,
873 CWE-406,EN-Insufficient Control of Network Message Volume (Network Amplification) (Type: Base),"The software does not sufficiently monitor or control transmitted network traffic volume, so that an actor can cause the software to transmit more traffic than should be allowed for that actor.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
874 CWE-408,EN-Incorrect Behavior Order: Early Amplification (Type: Base),The software allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.,"In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
875 CWE-409,EN-Improper Handling of Highly Compressed Data (Data Amplification) (Type: Base),The software does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.,"An example of data amplification is a ""decompression bomb,"" a small ZIP file that can produce a large amount of data when it is decompressed.",,Unknown,
876 CWE-41,EN-Improper Resolution of Path Equivalence (Type: Base),The system or application is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.,"Path equivalence is usually employed in order to circumvent access controls expressed using an incomplete set of file name or file path representations. This is different from path traversal, wherein the manipulations are performed to generate a name for a different object.",,Unknown,
877 CWE-410,EN-Insufficient Resource Pool (Type: Base),"The software's resource pool is not large enough to handle peak demand, which allows an attacker to prevent others from accessing the resource by using a (relatively) large number of requests for resources.","Frequently the consequence is a ""flood"" of connection or sessions.",,Unknown,"Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
878 CWE-412,EN-Unrestricted Externally Accessible Lock (Type: Base),"The software properly checks for the existence of a lock, but the lock can be externally controlled or influenced by an actor that is outside of the intended sphere of control.","This prevents the software from acting on associated resources or performing other behaviors that are controlled by the presence of the lock. Relevant locks might include an exclusive lock or mutex, or modifying a shared resource that is treated as a lock. If the lock can be held for an indefinite period of time, then the denial of service could be permanent.",,Unknown,
879 CWE-413,EN-Improper Resource Locking (Type: Base),The software does not lock or does not correctly lock a resource when the software must have exclusive access to the resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
880 CWE-414,EN-Missing Lock Check (Type: Base),A product does not check to see if a lock is present before performing sensitive operations on a resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
881 CWE-419,EN-Unprotected Primary Channel (Type: Base),"The software uses a primary channel for administration or restricted functionality, but it does not properly protect the channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
882 Error conditions and other exceptional circumstances.
883 Confusion over which part of the program is responsible for freeing the memory.
884 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
885 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
886 CWE-42,EN-Path Equivalence: filename. (Trailing Dot) (Type: Variant),A software system that accepts path input in the form of trailing dot ('filedir.') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
887 Error conditions and other exceptional circumstances.
888 Confusion over which part of the program is responsible for freeing the memory.
889 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
890 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
891 CWE-420,EN-Unprotected Alternate Channel (Type: Base),"The software protects a primary channel, but it does not use the same level of protection for an alternate channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
892 Error conditions and other exceptional circumstances.
893 Confusion over which part of the program is responsible for freeing the memory.
894 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
895 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
896 CWE-421,EN-Race Condition During Access to Alternate Channel (Type: Base),"The product opens an alternate channel to communicate with an authorized user, but the channel is accessible to other actors.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
897 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
898 CWE-422,EN-Unprotected Windows Messaging Channel (Shatter) (Type: Variant),"The software does not properly verify the source of a message in the Windows Messaging System while running at elevated privileges, creating an alternate channel through which an attacker can directly send a message to the product.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Exploiting design flaws in the Win32 API for privilege escalation. Or... Shatter Attacks - How to break Windows: http://web.archive.org/web/20060115174629/http://security.tombom.co.uk/shatter.html
899 The Art of Software Security Assessment: Chapter 2, ""Design Review."" Page 34.
900 The Art of Software Security Assessment: Chapter 12, ""Shatter Attacks"", Page 694."
901 CWE-423,EN-DEPRECATED (Duplicate): Proxied Trusted Channel (Type: Base),This entry has been deprecated because it was a duplicate of CWE-441. All content has been transferred to CWE-441.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
902 CWE-424,EN-Improper Protection of Alternate Path (Type: Class),The product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
903 CWE-425,EN-Direct Request (Forced Browsing) (Type: Base),"The web application does not adequately enforce appropriate authorization on all restricted URLs, scripts, or files.",Web applications susceptible to direct request attacks often make the false assumption that such resources can only be reached through a given navigation path and so only apply authorization at certain points in the path.,,Unknown,
904 CWE-427,EN-Uncontrolled Search Path Element (Type: Base),"The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.","Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as ""/tmp"" or the current working directory.
905 In Windows-based systems, when the LoadLibrary or LoadLibraryEx function is called with a DLL name that does not contain a fully qualified path, the function follows a search order that includes two path elements that might be uncontrolled:
906 the directory from which the program has been loaded
907 the current working directory.
908 In some cases, the attack can be conducted remotely, such as when SMB or WebDAV network shares are used.
909 In some Unix-based systems, a PATH might be created that contains an empty element, e.g. by splicing an empty variable into the PATH. This empty element can be interpreted as equivalent to the current working directory, which might be an untrusted search element.",,Unknown,"Double clicking on MS Office documents from Windows Explorer may execute arbitrary programs in some cases
910 ACROS Security: Remote Binary Planting in Apple iTunes for Windows (ASPR #2010-08-18-1)
911 Automatic Detection of Vulnerable Dynamic Component Loadings: http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-2.pdf
912 Dynamic-Link Library Search Order: http://msdn.microsoft.com/en-us/library/ms682586%28v=VS.85%29.aspx
913 Dynamic-Link Library Security: http://msdn.microsoft.com/en-us/library/ff919712%28VS.85%29.aspx
914 An update on the DLL-preloading remote attack vector: http://blogs.technet.com/b/srd/archive/2010/08/23/an-update-on-the-dll-preloading-remote-attack-vector.aspx
915 Insecure Library Loading Could Allow Remote Code Execution: http://www.microsoft.com/technet/security/advisory/2269637.mspx
916 Application DLL Load Hijacking: http://blog.rapid7.com/?p=5325
917 DLL Hijacking: Facts and Fiction: http://threatpost.com/en_us/blogs/dll-hijacking-facts-and-fiction-082610"
918 CWE-428,EN-Unquoted Search Path or Element (Type: Base),"The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.","If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Process Loading"", Page 654."
919 CWE-43,EN-Path Equivalence: filename.... (Multiple Trailing Dot) (Type: Variant),A software system that accepts path input in the form of multiple trailing dot ('filedir....') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,
920 CWE-430,EN-Deployment of Wrong Handler (Type: Base),"The wrong ""handler"" is assigned to process an object.","An example of deploying the wrong handler would be calling a servlet to reveal source code of a .JSP file, or automatically ""determining"" type of the object even if it is contradictory to an explicitly specified type.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
921 CWE-431,EN-Missing Handler (Type: Base),A handler is not available or implemented.,"When an exception is thrown and not caught, the process has given up an opportunity to decide if a given failure or event is worth a change in execution.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
922 CWE-432,EN-Dangerous Signal Handler not Disabled During Sensitive Operations (Type: Base),"The application uses a signal handler that shares state with other signal handlers, but it does not properly mask or prevent those signal handlers from being invoked while the original signal handler is still running.","During the execution of a signal handler, it can be interrupted by another handler when a different signal is sent. If the two handlers share state - such as global variables - then an attacker can corrupt the state by sending another signal before the first handler has completed execution.",,Unknown,
923 CWE-433,EN-Unparsed Raw Web Content Delivery (Type: Variant),The software stores raw content or supporting code under the web document root with an extension that is not specifically handled by the server.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
924 CWE-435,EN-Interaction Error (Type: Class),"An interaction error occurs when two entities work correctly when running independently, but they interact in unexpected ways when they are run together.","This could apply to products, systems, components, etc.",,Unknown,
925 CWE-436,EN-Interpretation Conflict (Type: Base),"Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,"On Interpretation Conflict Vulnerabilities
926 Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection: http://www.insecure.org/stf/secnet_ids/secnet_ids.pdf
927 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
928 Poison NULL byte
929 Re: Corsaire Security Advisory - Multiple vendor MIME RFC2047 encoding: http://marc.theaimsgroup.com/?l=bugtraq&m=109525864717484&w=2"
930 CWE-437,EN-Incomplete Model of Endpoint Features (Type: Base),"A product acts as an intermediary or monitor between two or more endpoints, but it does not have a complete model of an endpoint's features, behaviors, or state, potentially causing the product to perform incorrect actions based on this incomplete model.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
931 CWE-439,EN-Behavioral Change in New Version or Environment (Type: Base),"A's behavior or functionality changes with a new version of A, or a new environment, which is not known (or manageable) by B.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
932 CWE-44,EN-Path Equivalence: file.name (Internal Dot) (Type: Variant),A software system that accepts path input in the form of internal dot ('file.ordir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
933 CWE-440,EN-Expected Behavior Violation (Type: Base),"A feature, API, or function being used by a product behaves differently than the product expects.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
934 CWE-441,EN-Unintended Proxy or Intermediary (Confused Deputy) (Type: Class),"The software receives a request, message, or directive from an upstream component, but the software does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the software's control sphere. This causes the software to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
935 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
936 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
937 The attacker is prevented from making the request directly to the target; and
938 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,The Confused Deputy (or why capabilities might have been invented): http://www.cap-lore.com/CapTheory/ConfusedDeputy.html
939 CWE-443,EN-DEPRECATED (Duplicate): HTTP response splitting (Type: Base),This weakness can be found at CWE-113.,"If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
940 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
941 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
942 The attacker is prevented from making the request directly to the target; and
943 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,
944 CWE-444,EN-Inconsistent Interpretation of HTTP Requests (HTTP Request Smuggling) (Type: Base),"When malformed or abnormal HTTP requests are interpreted by one or more entities in the data flow between the user and the web server, such as a proxy or firewall, they can be interpreted inconsistently, allowing the attacker to ""smuggle"" a request to one device without the other device being aware of it.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
945 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
946 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
947 The attacker is prevented from making the request directly to the target; and
948 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,HTTP Request Smuggling: http://www.cgisecurity.com/lib/HTTP-Request-Smuggling.pdf
949 CWE-446,EN-UI Discrepancy for Security Feature (Type: Base),"The user interface does not correctly enable or configure a security feature, but the interface provides feedback that causes the user to believe that the feature is in a secure state.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
950 CWE-447,EN-Unimplemented or Unsupported Feature in UI (Type: Base),"A UI function for a security feature appears to be supported and gives feedback to the user that suggests that it is supported, but the underlying functionality is not implemented.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
951 CWE-448,EN-Obsolete Feature in UI (Type: Base),A UI function is obsolete and the product does not warn the user.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
952 CWE-449,EN-The UI Performs the Wrong Action (Type: Base),The UI performs the wrong action with respect to the user's request.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
953 CWE-45,EN-Path Equivalence: file...name (Multiple Internal Dot) (Type: Variant),A software system that accepts path input in the form of multiple internal dot ('file...dir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
954 CWE-450,EN-Multiple Interpretations of UI Input (Type: Base),The UI has multiple interpretations of user input but does not prompt the user when it selects the less secure interpretation.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
955 CWE-451,EN-UI Misrepresentation of Critical Information (Type: Base),"The UI does not properly represent critical information to the user, allowing the information - or its source - to be obscured or spoofed. This is often a component in phishing attacks.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
956 CWE-453,EN-Insecure Default Variable Initialization (Type: Base),"The software, by default, initializes an internal variable with an insecure or less secure value than is possible.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
957 CWE-454,EN-External Initialization of Trusted Variables or Data Stores (Type: Base),The software initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.,"A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
958 CWE-455,EN-Non-exit on Failed Initialization (Type: Base),"The software does not exit or otherwise modify its operation when security-relevant errors occur during initialization, such as when a configuration file has a format error, which can cause the software to execute in a less secure fashion than intended by the administrator.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
959 CWE-456,EN-Missing Initialization of a Variable (Type: Base),"The software does not initialize critical variables, which causes the execution environment to use unexpected values.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
960 CWE-458,EN-DEPRECATED: Incorrect Initialization (Type: Base),"This weakness has been deprecated because its name and description did not match. The description duplicated CWE-454, while the name suggested a more abstract initialization problem. Please refer to CWE-665 for the more abstract problem.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
961 CWE-459,EN-Incomplete Cleanup (Type: Base),"The software does not properly ""clean up"" and remove temporary or supporting resources after they have been used.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
962 CWE-46,EN-Path Equivalence: filename (Trailing Space) (Type: Variant),A software system that accepts path input in the form of trailing space ('filedir ') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
963 CWE-463,EN-Deletion of Data Structure Sentinel (Type: Base),The accidental deletion of a data-structure sentinel can cause serious programming logic problems.,"Often times data-structure sentinels are used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the deletion or modification outside of some wrapper interface which provides safety.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL-Termination Problems"", Page 452."
964 CWE-466,EN-Return of Pointer Value Outside of Expected Range (Type: Base),A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
965 CWE-47,EN-Path Equivalence: filename (Leading Space) (Type: Variant),A software system that accepts path input in the form of leading space (' filedir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,
966 CWE-470,EN-Use of Externally-Controlled Input to Select Classes or Code (Unsafe Reflection) (Type: Base),"The application uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.","If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
967 CWE-471,EN-Modification of Assumed-Immutable Data (MAID) (Type: Base),The software does not properly protect an assumed-immutable element from being modified by an attacker.,"If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
968 CWE-472,EN-External Control of Assumed-Immutable Web Parameter (Type: Base),"The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
969 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75
970 The Art of Software Security Assessment: Chapter 17, ""Embedding State in HTML and URLs"", Page 1032."
971 CWE-473,EN-PHP External Variable Modification (Type: Variant),"A PHP application does not properly protect against the modification of variables from external sources, such as query parameters or cookies. This can expose the application to numerous weaknesses that would not exist otherwise.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
972 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
973 CWE-474,EN-Use of Function with Inconsistent Implementations (Type: Base),"The code uses a function that has inconsistent implementations across operating systems and versions, which might cause security-relevant portability problems.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
974 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
975 CWE-475,EN-Undefined Behavior for Input to API (Type: Base),The behavior of this function is undefined unless its control parameter is set to a specific value.,"If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
976 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
977 CWE-477,EN-Use of Obsolete Functions (Type: Base),"The code uses deprecated or obsolete functions, which suggests that the code has not been actively reviewed or maintained.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,
978 CWE-478,EN-Missing Default Case in Switch Statement (Type: Variant),"The code does not have a default case in a switch statement, which might lead to complex logical errors and resultant weaknesses.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
979 CWE-48,EN-Path Equivalence: file name (Internal Whitespace) (Type: Variant),A software system that accepts path input in the form of internal space ('file(SPACE)name') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
980 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Unknown,
981 CWE-485,EN-Insufficient Encapsulation (Type: Class),The product does not sufficiently encapsulate critical data or functionality.,"Encapsulation is about drawing strong boundaries. In a web browser that might mean ensuring that your mobile code cannot be abused by other mobile code. On the server it might mean differentiation between validated data and unvalidated data, between one user's data and another's, or between data users are allowed to see and data that they are not.",,Unknown,
982 CWE-488,EN-Exposure of Data Element to Wrong Session (Type: Variant),"The product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
983 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
984 CWE-489,EN-Leftover Debug Code (Type: Base),The application can be deployed with active debugging code that can create unintended entry points.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
985 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
986 CWE-49,EN-Path Equivalence: filename/ (Trailing Slash) (Type: Variant),A software system that accepts path input in the form of trailing slash ('filedir/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
987 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
988 CWE-491,EN-Public cloneable() Method Without Final (Object Hijack) (Type: Variant),"A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
989 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,"OWASP , Attack Category : Mobile code: object hijack: http://www.owasp.org/index.php/Mobile_code:_object_hijack"
990 CWE-495,EN-Private Array-Typed Field Returned From A Public Method (Type: Variant),"The product has a method that is declared public, but returns a reference to a private array, which could then be modified in unexpected ways.","An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
991 CWE-496,EN-Public Data Assigned to Private Array-Typed Field (Type: Variant),Assigning public data to a private array is equivalent to giving public access to the array.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
992 CWE-497,EN-Exposure of System Data to an Unauthorized Control Sphere (Type: Variant),Exposing system data or debugging information helps an adversary learn about the system and form an attack plan.,"An information exposure occurs when system data or debugging information leaves the program through an output stream or logging function that makes it accessible to unauthorized parties. An attacker can also cause errors to occur by submitting unusual requests to the web application. The response to these errors can reveal detailed system information, deny service, cause security mechanisms to fail, and crash the server. An attacker can use error messages that reveal technologies, operating systems, and product versions to tune the attack against known vulnerabilities in these technologies. An application may use diagnostic methods that provide significant implementation details such as stack traces as part of its error handling mechanism.",,Unknown,
993 CWE-5,EN-J2EE Misconfiguration: Data Transmission Without Encryption (Type: Variant),Information sent over a network can be compromised while in transit. An attacker may be able to read/modify the contents if the data are sent in plaintext or are weakly encrypted.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
994 CWE-50,EN-Path Equivalence: //multiple/leading/slash (Type: Variant),A software system that accepts path input in the form of multiple leading slash ('//multiple/leading/slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
995 CWE-501,EN-Trust Boundary Violation (Type: Base),The product mixes trusted and untrusted data in the same data structure or structured message.,"By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.",,Unknown,
996 CWE-506,EN-Embedded Malicious Code (Type: Class),The application contains code that appears to be malicious in nature.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
997 CWE-507,EN-Trojan Horse (Type: Base),"The software appears to contain benign or useful functionality, but it also contains code that is hidden from normal operation that violates the intended security policy of the user or the system administrator.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,"Writing Secure Code: Chapter 7, ""Viruses, Trojans, and Worms In a Nutshell"" Page 208"
998 CWE-508,EN-Non-Replicating Malicious Code (Type: Base),Non-replicating malicious code only resides on the target system or software that is attacked; it does not attempt to spread to other systems.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
999 CWE-509,EN-Replicating Malicious Code (Virus or Worm) (Type: Base),"Replicating malicious code, including viruses and worms, will attempt to attack other systems once it has successfully compromised the target system or software.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1000 CWE-51,EN-Path Equivalence: /multiple//internal/slash (Type: Variant),A software system that accepts path input in the form of multiple internal slash ('/multiple//internal/slash/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1001 CWE-510,EN-Trapdoor (Type: Base),"A trapdoor is a hidden piece of code that responds to a special input, allowing its user access to resources without passing through the normal security enforcement mechanism.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1002 CWE-511,EN-Logic/Time Bomb (Type: Base),"The software contains code that is designed to disrupt the legitimate operation of the software (or its environment) when a certain time passes, or when a certain logical condition is met.","When the time bomb or logic bomb is detonated, it may perform a denial of service such as crashing the system, deleting critical data, or degrading system response time. This bomb might be placed within either a replicating or non-replicating Trojan horse.",,Unknown,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
1003 CWE-512,EN-Spyware (Type: Base),"The software collects personally identifiable information about a human user or the user's activities, but the software accesses this information using other resources besides itself, and it does not require that user's explicit approval or direct input into the software.","""Spyware"" is a commonly used term with many definitions and interpretations. In general, it is meant to software that collects information or installs functionality that human users might not allow if they were fully aware of the actions being taken by the software. For example, a user might expect that tax software would collect a social security number and include it when filing a tax return, but that same user would not expect gaming software to obtain the social security number from that tax software's data.",,Unknown,
1004 CWE-514,EN-Covert Channel (Type: Class),A covert channel is a path that can be used to transfer information in a way not intended by the system's designers.,Typically the system has not given authorization for the transmission and has no knowledge of its occurrence.,,Unknown,
1005 CWE-516,EN-DEPRECATED (Duplicate): Covert Timing Channel (Type: Base),This weakness can be found at CWE-385.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1006 CWE-52,EN-Path Equivalence: /multiple/trailing/slash// (Type: Variant),A software system that accepts path input in the form of multiple trailing slash ('/multiple/trailing/slash//') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1007 CWE-520,EN-.NET Misconfiguration: Use of Impersonation (Type: Variant),Allowing a .NET application to run at potentially escalated levels of access to the underlying operating and file systems can be dangerous and result in various forms of attacks.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1008 CWE-521,EN-Weak Password Requirements (Type: Base),"The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1009 CWE-522,EN-Insufficiently Protected Credentials (Type: Base),This weakness occurs when the application transmits or stores authentication credentials and uses an insecure method that is susceptible to unauthorized interception and/or retrieval.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1010 CWE-523,EN-Unprotected Transport of Credentials (Type: Variant),Login pages not using adequate measures to protect the user name and password while they are in transit from the client to the server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1011 CWE-524,EN-Information Exposure Through Caching (Type: Variant),"The application uses a cache to maintain a pool of objects, threads, connections, pages, or passwords to minimize the time it takes to access them or the resources to which they connect. If implemented improperly, these caches can allow access to unauthorized information or cause a denial of service vulnerability.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1012 CWE-525,EN-Information Exposure Through Browser Caching (Type: Variant),"For each web page, the application should have an appropriate caching policy specifying the extent to which the page and its form fields should be cached.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1013 CWE-526,EN-Information Exposure Through Environmental Variables (Type: Variant),Environmental variables may contain sensitive information about a remote server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1014 CWE-527,EN-Exposure of CVS Repository to an Unauthorized Control Sphere (Type: Variant),The product stores a CVS repository in a directory or other container that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1015 CWE-528,EN-Exposure of Core Dump File to an Unauthorized Control Sphere (Type: Variant),The product generates a core dump file in a directory that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1016 CWE-529,EN-Exposure of Access Control List Files to an Unauthorized Control Sphere (Type: Variant),The product stores access control list files in a directory or other container that is accessible to actors outside of the intended control sphere.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1017 CWE-53,EN-Path Equivalence: \multiple\\internal\backslash (Type: Variant),A software system that accepts path input in the form of multiple internal backslash ('\multiple\trailing\\slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1018 CWE-530,EN-Exposure of Backup File to an Unauthorized Control Sphere (Type: Variant),A backup file is stored in a directory that is accessible to actors outside of the intended control sphere.,"Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1019 CWE-531,EN-Information Exposure Through Test Code (Type: Variant),"Accessible test applications can pose a variety of security risks. Since developers or administrators rarely consider that someone besides themselves would even know about the existence of these applications, it is common for them to contain sensitive information or functions.","Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1020 CWE-533,EN-Information Exposure Through Server Log Files (Type: Variant),"A server.log file was found. This can give information on whatever application left the file. Usually this can give full path names and system information, and sometimes usernames and passwords.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1021 CWE-534,EN-Information Exposure Through Debug Log Files (Type: Variant),The application does not sufficiently restrict access to a log file that is used for debugging.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1022 CWE-535,EN-Information Exposure Through Shell Error Message (Type: Variant),"A command shell error message indicates that there exists an unhandled exception in the web application code. In many cases, an attacker can leverage the conditions that cause these errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1023 CWE-536,EN-Information Exposure Through Servlet Runtime Error Message (Type: Variant),A servlet error message indicates that there exists an unhandled exception in your web application code and may provide useful information to an attacker.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1024 CWE-537,EN-Information Exposure Through Java Runtime Error Message (Type: Variant),"In many cases, an attacker can leverage the conditions that cause unhandled exception errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1025 CWE-538,EN-File and Directory Information Exposure (Type: Base),The product stores sensitive information in files or directories that are accessible to actors outside of the intended control sphere.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
1026 CWE-539,EN-Information Exposure Through Persistent Cookies (Type: Variant),Persistent cookies are cookies that are stored on the browser's hard drive. This can cause security and privacy issues depending on the information stored in the cookie and how it is accessed.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1027 CWE-54,EN-Path Equivalence: filedir\ (Trailing Backslash) (Type: Variant),A software system that accepts path input in the form of trailing backslash ('filedir\') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1028 CWE-540,EN-Information Exposure Through Source Code (Type: Variant),Source code on a web server often contains sensitive information and should generally not be accessible to users.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1029 CWE-541,EN-Information Exposure Through Include Source Code (Type: Variant),"If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.","There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1030 CWE-542,EN-Information Exposure Through Cleanup Log Files (Type: Variant),The application does not properly protect or delete a log file related to cleanup.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1031 CWE-543,EN-Use of Singleton Pattern Without Synchronization in a Multithreaded Context (Type: Variant),The software uses the singleton pattern when creating a resource within a multithreaded environment.,The use of a singleton pattern may not be thread-safe.,,Unknown,Thread-Specifc Storage for C/C++: http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf
1032 CWE-544,EN-Missing Standardized Error Handling Mechanism (Type: Base),"The software does not use a standardized method for handling errors throughout the code, which might introduce inconsistent error handling and resultant weaknesses.","If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1033 CWE-545,EN-Use of Dynamic Class Loading (Type: Variant),Dynamically loaded code has the potential to be malicious.,"If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1034 CWE-546,EN-Suspicious Comment (Type: Variant),"The code contains comments that suggest the presence of bugs, incomplete functionality, or weaknesses.","Many suspicious comments, such as BUG, HACK, FIXME, LATER, LATER2, TODO, in the code indicate missing security functionality and checking. Others indicate code problems that programmers should fix, such as hard-coded variables, error handling, not using stored procedures, and performance issues.",,Unknown,
1035 CWE-547,"EN-Use of Hard-coded, Security-relevant Constants (Type: Variant)","The program uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.","If the developer does not find all occurrences of the hard-coded constants, an incorrect policy decision may be made if one of the constants is not changed. Making changes to these values will require code changes that may be difficult or impossible once the system is released to the field. In addition, these hard-coded values may become available to attackers if the code is ever disclosed.",,Unknown,
1036 CWE-548,EN-Information Exposure Through Directory Listing (Type: Variant),"A directory listing is inappropriately exposed, yielding potentially sensitive information to attackers.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1037 CWE-549,EN-Missing Password Field Masking (Type: Variant),"The software does not mask passwords during entry, increasing the potential for attackers to observe and capture passwords.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1038 CWE-55,EN-Path Equivalence: /./ (Single Dot Directory) (Type: Variant),A software system that accepts path input in the form of single dot directory exploit ('/./') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1039 CWE-550,EN-Information Exposure Through Server Error Message (Type: Variant),"Certain conditions, such as network failure, will cause a server error message to be displayed.","While error messages in and of themselves are not dangerous, per se, it is what an attacker can glean from them that might cause eventual problems.",,Unknown,
1040 CWE-551,EN-Incorrect Behavior Order: Authorization Before Parsing and Canonicalization (Type: Base),"If a web server does not fully parse requested URLs before it examines them for authorization, it may be possible for an attacker to bypass authorization protection.","For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1041 CWE-552,EN-Files or Directories Accessible to External Parties (Type: Base),Files or directories are accessible in the environment that should not be.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1042 CWE-553,EN-Command Shell in Externally Accessible Directory (Type: Variant),A possible shell file exists in /cgi-bin/ or other accessible directories. This is extremely dangerous and can be used by an attacker to execute commands on the web server.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1043 CWE-554,EN-ASP.NET Misconfiguration: Not Using Input Validation Framework (Type: Variant),The ASP.NET application does not use an input validation framework.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1044 CWE-555,EN-J2EE Misconfiguration: Plaintext Password in Configuration File (Type: Variant),The J2EE application stores a plaintext password in a configuration file.,"Storing a plaintext password in a configuration file allows anyone who can read the file to access the password-protected resource, making it an easy target for attackers.",,Unknown,
1045 CWE-556,EN-ASP.NET Misconfiguration: Use of Identity Impersonation (Type: Variant),Configuring an ASP.NET application to run with impersonated credentials may give the application unnecessary privileges.,The use of impersonated credentials allows an ASP.NET application to run with either the privileges of the client on whose behalf it is executing or with arbitrary privileges granted in its configuration.,,Unknown,
1046 CWE-558,EN-Use of getlogin() in Multithreaded Application (Type: Variant),"The application uses the getlogin() function in a multithreaded context, potentially causing it to return incorrect values.","The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1047 CWE-56,EN-Path Equivalence: filedir* (Wildcard) (Type: Variant),A software system that accepts path input in the form of asterisk wildcard ('filedir*') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1048 CWE-560,EN-Use of umask() with chmod-style Argument (Type: Variant),The product calls umask() with an incorrect argument that is specified as if it is an argument to chmod().,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1049 CWE-561,EN-Dead Code (Type: Variant),"The software contains dead code, which can never be executed.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1050 CWE-562,EN-Return of Stack Variable Address (Type: Base),"A function returns the address of a stack variable, which will cause unintended program behavior, typically in the form of a crash.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1051 CWE-563,EN-Unused Variable (Type: Variant),"The variable's value is assigned but never used, making it a dead store.","It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1052 CWE-564,EN-SQL Injection: Hibernate (Type: Variant),Using Hibernate to execute a dynamic SQL statement built with user-controlled input can allow an attacker to modify the statement's meaning or to execute arbitrary SQL commands.,"It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1053 CWE-565,EN-Reliance on Cookies without Validation and Integrity Checking (Type: Base),"The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.",,Unknown,
1054 CWE-566,EN-Authorization Bypass Through User-Controlled SQL Primary Key (Type: Variant),"The software uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.","When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.
1055 Database access control errors occur when:
1056 Data enters a program from an untrusted source.
1057 The data is used to specify the value of a primary key in a SQL query.
1058 The untrusted source does not have the permissions to be able to access all rows in the associated table.",,Unknown,
1059 CWE-567,EN-Unsynchronized Access to Shared Data in a Multithreaded Context (Type: Base),"The product does not properly synchronize shared data, such as static variables across threads, which can lead to undefined behavior and unpredictable data changes.","Within servlets, shared static variables are not protected from concurrent access, but servlets are multithreaded. This is a typical programming mistake in J2EE applications, since the multithreading is handled by the framework. When a shared variable can be influenced by an attacker, one thread could wind up modifying the variable to contain data that is not valid for a different thread that is also using the data within the variable.
1060 Note that this weakness is not unique to servlets.",,Unknown,
1061 CWE-568,EN-finalize() Method Without super.finalize() (Type: Variant),The software contains a finalize() method that does not call super.finalize().,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1062 CWE-57,EN-Path Equivalence: fakedir/../realdir/filename (Type: Variant),"The software contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.",The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1063 CWE-570,EN-Expression is Always False (Type: Variant),The software contains an expression that will always evaluate to false.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1064 CWE-571,EN-Expression is Always True (Type: Variant),The software contains an expression that will always evaluate to true.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1065 CWE-572,EN-Call to Thread run() instead of start() (Type: Variant),"The program calls a thread's run() method instead of calling start(), which causes the code to run in the thread of the caller instead of the callee.","In most cases a direct call to a Thread object's run() method is a bug. The programmer intended to begin a new thread of control, but accidentally called run() instead of start(), so the run() method will execute in the caller's thread of control.",,Unknown,
1066 CWE-573,EN-Improper Following of Specification by Caller (Type: Class),"The software does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform.","When leveraging external functionality, such as an API, it is important that the caller does so in accordance with the requirements of the external functionality or else unintended behaviors may result, possibly leaving the system vulnerable to any number of exploits.",,Unknown,
1067 CWE-574,EN-EJB Bad Practices: Use of Synchronization Primitives (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using thread synchronization primitives.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances."" The specification justifies this requirement in the following way: ""This rule is required to ensure consistent runtime semantics because while some EJB containers may use a single JVM to execute all enterprise bean's instances, others may distribute the instances across multiple JVMs.""",,Unknown,
1068 CWE-575,EN-EJB Bad Practices: Use of AWT Swing (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the AWT functionality to attempt to output information to a display, or to input information from a keyboard."" The specification justifies this requirement in the following way: ""Most servers do not allow direct interaction between an application program and a keyboard/display attached to the server system.""",,Unknown,
1069 CWE-576,EN-EJB Bad Practices: Use of Java I/O (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the java.io package.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the java.io package to attempt to access files and directories in the file system."" The specification justifies this requirement in the following way: ""The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.""",,Unknown,
1070 CWE-577,EN-EJB Bad Practices: Use of Sockets (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using sockets.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast."" The specification justifies this requirement in the following way: ""The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean-- to serve the EJB clients.""",,Unknown,
1071 CWE-578,EN-EJB Bad Practices: Use of Class Loader (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the class loader.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1072 CWE-579,EN-J2EE Bad Practices: Non-serializable Object Stored in Session (Type: Variant),"The application stores a non-serializable object as an HttpSession attribute, which can hurt reliability.","The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1073 CWE-58,EN-Path Equivalence: Windows 8.3 Filename (Type: Variant),"The software contains a protection mechanism that restricts access to a long filename on a Windows operating system, but the software does not properly restrict access to the equivalent short ""8.3"" filename.","On later Windows operating systems, a file can have a ""long name"" and a short name that is compatible with older Windows file systems, with up to 8 characters in the filename and 3 characters for the extension. These ""8.3"" filenames, therefore, act as an alternate name for files with long names, so they are useful pathname equivalence manipulations.",,Unknown,"Writing Secure Code
1074 The Art of Software Security Assessment: Chapter 11, ""DOS 8.3 Filenames"", Page 673."
1075 CWE-580,EN-clone() Method Without super.clone() (Type: Variant),The software contains a clone() method that does not call super.clone() to obtain the new object.,"All implementations of clone() should obtain the new object by calling super.clone(). If a class does not follow this convention, a subclass's clone() method will return an object of the wrong type.",,Unknown,
1076 CWE-581,EN-Object Model Violation: Just One of Equals and Hashcode Defined (Type: Base),The software does not maintain equal hashcodes for equal objects.,"Java objects are expected to obey a number of invariants related to equality. One of these invariants is that equal objects must have equal hashcodes. In other words, if a.equals(b) == true then a.hashCode() == b.hashCode().",,Unknown,
1077 CWE-582,"EN-Array Declared Public, Final, and Static (Type: Variant)","The program declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.","Because arrays are mutable objects, the final constraint requires that the array object itself be assigned only once, but makes no guarantees about the values of the array elements. Since the array is public, a malicious program can change the values stored in the array. As such, in most cases an array declared public, final and static is a bug.",,Unknown,
1078 CWE-583,EN-finalize() Method Declared Public (Type: Variant),The program violates secure coding principles for mobile code by declaring a finalize() method public.,"A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1079 CWE-584,EN-Return Inside Finally Block (Type: Base),"The code has a return statement inside a finally block, which will cause any thrown exception in the try block to be discarded.","A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1080 CWE-585,EN-Empty Synchronized Block (Type: Variant),The software contains an empty synchronized block.,An empty synchronized block does not actually accomplish any synchronization and may indicate a troubled section of code. An empty synchronized block can occur because code no longer needed within the synchronized block is commented out without removing the synchronized block.,,Unknown,Intrinsic Locks and Synchronization (in Java): http://java.sun.com/docs/books/tutorial/essential/concurrency/locksync.html
1081 CWE-586,EN-Explicit Call to Finalize() (Type: Variant),The software makes an explicit call to the finalize() method from outside the finalizer.,"While the Java Language Specification allows an object's finalize() method to be called from outside the finalizer, doing so is usually a bad idea. For example, calling finalize() explicitly means that finalize() will be called more than once: the first time will be the explicit call and the last time will be the call that is made after the object is garbage collected.",,Unknown,
1082 CWE-587,EN-Assignment of a Fixed Address to a Pointer (Type: Base),The software sets a pointer to a specific address other than NULL or 0.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1083 CWE-588,EN-Attempt to Access Child of a Non-structure Pointer (Type: Variant),Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1084 CWE-589,EN-Call to Non-ubiquitous API (Type: Variant),The software uses an API function that does not exist on all versions of the target platform. This could cause portability problems or inconsistencies that allow denial of service or other consequences.,"Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Unknown,
1085 CWE-590,EN-Free of Memory not on the Heap (Type: Variant),"The application calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().","When free() is called on an invalid pointer, the program's memory management data structures may become corrupted. This corruption can cause the program to crash or, in some circumstances, an attacker may be able to cause free() to operate on controllable memory locations to modify critical program variables or execute code.",,Unknown,Valgrind: http://valgrind.org/
1086 CWE-591,EN-Sensitive Data Storage in Improperly Locked Memory (Type: Variant),"The application stores sensitive data in memory that is not locked, or that has been incorrectly locked, which might cause the memory to be written to swap files on disk by the virtual memory manager. This can make the data more accessible to external actors.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,
1087 CWE-592,EN-Authentication Bypass Issues (Type: Class),"The software does not properly perform authentication, allowing it to be bypassed through various methods.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1088 CWE-593,EN-Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created (Type: Variant),The software modifies the SSL context after connection creation has begun.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1089 CWE-594,EN-J2EE Framework: Saving Unserializable Objects to Disk (Type: Variant),When the J2EE container attempts to write unserializable objects to disk there is no guarantee that the process will complete successfully.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1090 CWE-595,EN-Comparison of Object References Instead of Object Contents (Type: Base),"The program compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.","If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1091 CWE-596,EN-Incorrect Semantic Object Comparison (Type: Base),The software does not correctly compare two objects based on their conceptual content.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1092 CWE-597,EN-Use of Wrong Operator in String Comparison (Type: Variant),"The product uses the wrong operator when comparing a string, such as using ""=="" when the equals() method should be used instead.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
1093 CWE-598,EN-Information Exposure Through Query Strings in GET Request (Type: Variant),"The web application uses the GET method to process requests that contain sensitive information, which can expose that information through the browser's history, Referers, web logs, and other sources.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,
1094 CWE-599,EN-Missing Validation of OpenSSL Certificate (Type: Variant),The software uses OpenSSL and trusts or uses a certificate without using the SSL_get_verify_result() function to ensure that the certificate satisfies all necessary security requirements.,"This could allow an attacker to use an invalid certificate to claim to be a trusted host, use expired certificates, or conduct other attacks that could be detected if the certificate is properly validated.",,Unknown,
1095 CWE-6,EN-J2EE Misconfiguration: Insufficient Session-ID Length (Type: Variant),The J2EE application is configured to use an insufficient session ID length.,"If an attacker can guess or steal a session ID, then he/she may be able to take over the user's session (called session hijacking). The number of possible session IDs increases with increased session ID length, making it more difficult to guess or steal a session ID.",,Unknown,No description: http://www.securiteam.com/securityreviews/5TP0F0UEVQ.html
1096 CWE-600,EN-Uncaught Exception in Servlet (Type: Base),"The Servlet does not catch all exceptions, which may reveal sensitive debugging information.","When a Servlet throws an exception, the default error response the Servlet container sends back to the user typically includes debugging information. This information is of great value to an attacker. For example, a stack trace might show the attacker a malformed SQL query string, the type of database being used, and the version of the application container. This information enables the attacker to target known vulnerabilities in these components.",,Unknown,
1097 CWE-603,EN-Use of Client-Side Authentication (Type: Base),"A client/server product performs authentication within client code but not in server code, allowing server-side authentication to be bypassed via a modified client that omits the authentication check.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1098 CWE-605,EN-Multiple Binds to the Same Port (Type: Base),"When multiple sockets are allowed to bind to the same port, other services on that port may be stolen or spoofed.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1099 CWE-606,EN-Unchecked Input for Loop Condition (Type: Base),"The product does not properly check inputs that are used for loop conditions, potentially leading to a denial of service because of excessive looping.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1100 CWE-607,EN-Public Static Final Field References Mutable Object (Type: Variant),"A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1101 CWE-608,EN-Struts: Non-private Field in ActionForm Class (Type: Variant),"An ActionForm class contains a field that has not been declared private, which can be accessed without using a setter or getter.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1102 CWE-609,EN-Double-Checked Locking (Type: Base),"The program uses double-checked locking to access a resource without the overhead of explicit synchronization, but the locking is insufficient.","Double-checked locking refers to the situation where a programmer checks to see if a resource has been initialized, grabs a lock, checks again to see if the resource has been initialized, and then performs the initialization if it has not occurred yet. This should not be done, as is not guaranteed to work in all languages and on all architectures. In summary, other threads may not be operating inside the synchronous block and are not guaranteed to see the operations execute in the same order as they would appear inside the synchronous block.",,Unknown,"The ""Double-Checked Locking is Broken"" Declaration: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
1103 JSR 133 (Java Memory Model) FAQ: http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#dcl
1104 The Art of Software Security Assessment: Chapter 13, ""Threading Vulnerabilities"", Page 815."
1105 CWE-610,EN-Externally Controlled Reference to a Resource in Another Sphere (Type: Class),The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.,,,Unknown,
1106 CWE-611,EN-Improper Restriction of XML External Entity Reference (XXE) (Type: Variant),"The software 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.","XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
1107 By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as ""file:///c:/winnt/win.ini"" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Using URIs with other schemes such as http://, the attacker can force the application to make outgoing requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions or hide the source of attacks such as port scanning.
1108 Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g. in an error message), thereby exposing the file contents.",,Unknown,"XML External Entity (XXE) Processing: https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
1109 XML External Entity Attacks (XXE): https://www.owasp.org/images/5/5d/XML_Exteral_Entity_Attack.pdf
1110 XXE (Xml eXternal Entity) Attack: http://www.securiteam.com/securitynews/6D0100A5PU.html
1111 XML External Entities (XXE) Attack: http://projects.webappsec.org/w/page/13247003/XML%20External%20Entities
1112 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
1113 Preventing XXE in PHP: http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html"
1114 CWE-612,EN-Information Exposure Through Indexing of Private Data (Type: Variant),"The product performs an indexing routine against private documents, but does not sufficiently verify that the actors who can access the index also have the privileges to access the private documents.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1115 CWE-613,EN-Insufficient Session Expiration (Type: Base),"According to WASC, ""Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.""","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1116 CWE-614,EN-Sensitive Cookie in HTTPS Session Without Secure Attribute (Type: Variant),"The Secure attribute for sensitive cookies in HTTPS sessions is not set, which could cause the user agent to send those cookies in plaintext over an HTTP session.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1117 CWE-615,EN-Information Exposure Through Comments (Type: Variant),"While adding general comments is very useful, some programmers tend to leave important data, such as: filenames related to the web application, old links or links which were not meant to be browsed by users, old code fragments, etc.","An attacker who finds these comments can map the application's structure and files, expose hidden parts of the site, and study the fragments of code to reverse engineer the application, which may help develop further attacks against the site.",,Unknown,
1118 CWE-616,EN-Incomplete Identification of Uploaded File Variables (PHP) (Type: Variant),"The PHP application uses an old method for processing uploaded files by referencing the four global variables that are set for each file (e.g. $varname, $varname_size, $varname_name, $varname_type). These variables could be overwritten by attackers, causing the application to process unauthorized files.","These global variables could be overwritten by POST requests, cookies, or other methods of populating or overwriting these variables. This could be used to read or process arbitrary files by providing values such as ""/etc/passwd"".",,Unknown,"A Study in Scarlet - section 5, ""File Upload"""
1119 CWE-617,EN-Reachable Assertion (Type: Variant),"The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.","For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.",,Unknown,
1120 CWE-618,EN-Exposed Unsafe ActiveX Method (Type: Base),"An ActiveX control is intended for use in a web browser, but it exposes dangerous methods that perform actions that are outside of the browser's security model (e.g. the zone or domain).","ActiveX controls can exercise far greater control over the operating system than typical Java or javascript. Exposed methods can be subject to various vulnerabilities, depending on the implemented behaviors of those methods, and whether input validation is performed on the provided arguments. If there is no integrity checking or origin validation, this method could be invoked by attackers.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1121 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1122 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1123 CWE-619,EN-Dangling Database Cursor (Cursor Injection) (Type: Base),"If a database cursor is not closed properly, then it could become accessible to other users while retaining the same privileges that were originally assigned, leaving the cursor ""dangling.""","For example, an improper dangling cursor could arise from unhandled exceptions. The impact of the issue depends on the cursor's role, but SQL injection attacks are commonly possible.",,Unknown,"The Oracle Hacker's Handbook
1124 Cursor Injection: http://www.databasesecurity.com/dbsec/cursor-injection.pdf"
1125 CWE-62,EN-UNIX Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently account for when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. /etc/passwd). When the process opens the file, the attacker can assume the privileges of that process.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Hard Links"", Page 518."
1126 CWE-620,EN-Unverified Password Change (Type: Variant),"When setting a new password for a user, the product does not require knowledge of the original password, or using another form of authentication.","This could be used by an attacker to change passwords for another user, thus gaining the privileges associated with that user.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1127 CWE-621,EN-Variable Extraction Error (Type: Base),"The product uses external input to determine the names of variables into which information is extracted, without verifying that the names of the specified variables are valid. This could cause the program to overwrite unintended variables.","For example, in PHP, calling extract() or import_request_variables() without the proper arguments could allow arbitrary global variables to be overwritten, including superglobals. Similar functionality might be possible in other interpreted languages, including custom languages.",,Unknown,
1128 CWE-622,EN-Improper Validation of Function Hook Arguments (Type: Variant),"A product adds hooks to user-accessible API functions, but does not properly validate the arguments. This could lead to resultant vulnerabilities.","Such hooks can be used in defensive software that runs with privileges, such as anti-virus or firewall, which hooks kernel calls. When the arguments are not validated, they could be used to bypass the protection scheme or attack the product itself.",,Unknown,
1129 CWE-623,EN-Unsafe ActiveX Control Marked Safe For Scripting (Type: Variant),"An ActiveX control is intended for restricted use, but it has been marked as safe-for-scripting.","This might allow attackers to use dangerous functionality via a web page that accesses the control, which can lead to different resultant vulnerabilities, depending on the control's behavior.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1130 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1131 No description: http://support.microsoft.com/kb/240797
1132 Writing Secure Code: Chapter 16, ""What ActiveX Components Are Safe for Initialization and Safe for Scripting?"" Page 510
1133 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1134 CWE-624,EN-Executable Regular Expression Error (Type: Base),"The product uses a regular expression that either (1) contains an executable component with user-controlled inputs, or (2) allows a user to enable execution by inserting pattern modifiers.","Case (2) is possible in the PHP preg_replace() function, and possibly in other languages when a user-controlled input is inserted into a string that is later parsed as a regular expression.",,Unknown,
1135 CWE-625,EN-Permissive Regular Expression (Type: Base),The product uses a regular expression that does not sufficiently restrict the set of allowed values.,"This effectively causes the regexp to accept substrings that match the pattern, which produces a partial comparison to the target. In some cases, this can lead to other weaknesses. Common errors include:
1136 not identifying the beginning and end of the target string
1137 using wildcards instead of acceptable character ranges
1138 others",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
1139 CWE-626,EN-Null Byte Interaction Error (Poison Null Byte) (Type: Variant),The product does not properly handle null bytes or NUL characters when passing data between different representations or components.,"A null byte (NUL character) can have different meanings across representations or languages. For example, it is a string terminator in standard C libraries, but Perl and PHP strings do not treat it as a terminator. When two representations are crossed - such as when Perl or PHP invokes underlying C functionality - this can produce an interaction error with unexpected results. Similar issues have been reported for ASP. Other interpreters written in C might also be affected.",,Unknown,"Poison NULL byte: http://insecure.org/news/P55-07.txt
1140 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
1141 ShAnKaR: multiple PHP application poison NULL byte vulnerability: http://seclists.org/fulldisclosure/2006/Sep/0185.html"
1142 CWE-627,EN-Dynamic Variable Evaluation (Type: Base),"In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.","The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.",,Unknown,"Dynamic Evaluation Vulnerabilities in PHP applications: http://seclists.org/fulldisclosure/2006/May/0035.html
1143 A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications: http://www.securereality.com.au/studyinscarlet.txt"
1144 CWE-628,EN-Function Call with Incorrectly Specified Arguments (Type: Base),"The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.","There are multiple ways in which this weakness can be introduced, including:
1145 the wrong variable or reference;
1146 an incorrect number of arguments;
1147 incorrect order of arguments;
1148 wrong type of arguments; or
1149 wrong value.",,Unknown,
1150 CWE-636,EN-Not Failing Securely (Failing Open) (Type: Class),"When the product encounters an error condition or failure, its design requires it to fall back to a state that is less secure than other options that are available, such as selecting the weakest encryption algorithm or using the most permissive access control restrictions.","By entering a less secure state, the product inherits the weaknesses associated with that state, making it easier to compromise. At the least, it causes administrators to have a false sense of security. This weakness typically occurs as a result of wanting to ""fail functional"" to minimize administration and support costs, instead of ""failing safe.""",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1151 Failing Securely: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/349.html"
1152 CWE-637,EN-Unnecessary Complexity in Protection Mechanism (Not Using Economy of Mechanism) (Type: Class),"The software uses a more complex mechanism than necessary, which could lead to resultant weaknesses when the mechanism is not correctly understood, modeled, configured, implemented, or used.","Security mechanisms should be as simple as possible. Complex security mechanisms may engender partial implementations and compatibility problems, with resulting mismatches in assumptions and implemented security. A corollary of this principle is that data specifications should be as simple as possible, because complex data specifications result in complex validation code. Complex tasks and systems may also need to be guarded by complex security checks, so simple systems should be preferred.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1153 Economy of Mechanism: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/348.html"
1154 CWE-638,EN-Not Using Complete Mediation (Type: Class),"The software does not perform access checks on a resource every time the resource is accessed by an entity, which can create resultant weaknesses if that entity's rights or privileges change over time.",,,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1155 Complete Mediation: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/346.html"
1156 CWE-65,EN-Windows Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. AUTOEXEC.BAT). When the process opens the file, the attacker can assume the privileges of that process, or prevent the program from accurately processing data.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Links"", Page 676."
1157 CWE-651,EN-Information Exposure Through WSDL File (Type: Variant),The Web services architecture may require exposing a WSDL file that contains information on the publicly accessible services and how callers of these services should interact with them (e.g. what parameters they expect and what types they return).,"An information exposure may occur if any of the following apply:
1158 The WSDL file is accessible to a wider audience than intended.
1159 The WSDL file contains information on the methods/services that should not be publicly accessible or information about deprecated methods. This problem is made more likely due to the WSDL often being automatically generated from the code.
1160 Information in the WSDL file helps guess names/locations of methods/resources that should not be publicly accessible.",,Unknown,
1161 CWE-653,EN-Insufficient Compartmentalization (Type: Base),"The product does not sufficiently compartmentalize functionality or processes that require different privilege levels, rights, or permissions.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1162 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1163 CWE-654,EN-Reliance on a Single Factor in a Security Decision (Type: Base),"A protection mechanism relies exclusively, or to a large extent, on the evaluation of a single condition or the integrity of a single object or entity in order to make a decision about granting access to restricted resources or functionality.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1164 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1165 CWE-655,EN-Insufficient Psychological Acceptability (Type: Base),"The software has a protection mechanism that is too difficult or inconvenient to use, encouraging non-malicious users to disable or bypass the mechanism, whether by accident or on purpose.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1166 Psychological Acceptability: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/354.html
1167 Usability of Security: A Case Study: http://reports-archive.adm.cs.cmu.edu/anon/1998/CMU-CS-98-155.pdf
1168 24 Deadly Sins of Software Security: ""Sin 14: Poor Usability."" Page 217"
1169 CWE-656,EN-Reliance on Security Through Obscurity (Type: Base),"The software uses a protection mechanism whose strength depends heavily on its obscurity, such that knowledge of its algorithms or key data is sufficient to defeat the mechanism.","This reliance on ""security through obscurity"" can produce resultant weaknesses if an attacker is able to reverse engineer the inner workings of the mechanism. Note that obscurity can be one small part of defense in depth, since it can create more work for an attacker; however, it is a significant risk if used as the primary means of protection.",,Unknown,"RFC: 793, TRANSMISSION CONTROL PROTOCOL: http://www.ietf.org/rfc/rfc0793.txt
1170 The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1171 Never Assuming that Your Secrets Are Safe: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/352.html"
1172 CWE-657,EN-Violation of Secure Design Principles (Type: Class),The product violates well-established principles for secure design.,"This can introduce resultant weaknesses or make it easier for developers to introduce related weaknesses during implementation. Because code is centered around design, it can be resource-intensive to fix design problems.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1173 Design Principles: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/358.html"
1174 CWE-66,EN-Improper Handling of File Names that Identify Virtual Resources (Type: Base),"The product does not handle or incorrectly handles a file name that identifies a ""virtual"" resource that is not directly specified within the directory that is associated with the file name, causing the product to perform file-based operations on a resource that is not a file.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1175 CWE-662,EN-Improper Synchronization (Type: Base),"The software attempts to use a shared resource in an exclusive manner, but does not prevent or incorrectly prevents use of the resource by another thread or process.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1176 CWE-663,EN-Use of a Non-reentrant Function in a Concurrent Context (Type: Base),The software calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.,"Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,"Java Concurrency API: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantLock.html
1177 Use reentrant functions for safer signal handling: http://www.ibm.com/developerworks/linux/library/l-reent.html"
1178 CWE-664,EN-Improper Control of a Resource Through its Lifetime (Type: Class),"The software does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.","Resources often have explicit instructions on how to be created, used and destroyed. When software does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states.
1179 Even without explicit instructions, various principles are expected to be adhered to, such as ""Do not use an object until after its creation is complete,"" or ""do not use an object after it has been slated for destruction.""",,Unknown,
1180 CWE-666,EN-Operation on Resource in Wrong Phase of Lifetime (Type: Base),"The software performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1181 CWE-667,EN-Improper Locking (Type: Base),"The software does not properly acquire a lock on a resource, or it does not properly release a lock on a resource, leading to unexpected resource state changes and behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1182 CWE-668,EN-Exposure of Resource to Wrong Sphere (Type: Class),"The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1183 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
1184 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1185 CWE-669,EN-Incorrect Resource Transfer Between Spheres (Type: Class),"The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1186 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
1187 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1188 CWE-670,EN-Always-Incorrect Control Flow Implementation (Type: Class),"The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.","This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.",,Unknown,
1189 CWE-671,EN-Lack of Administrator Control over Security (Type: Class),The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect the environment in which the product is being used. This introduces resultant weaknesses or prevents it from operating at a level of security that is desired by the administrator.,"If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1190 CWE-672,EN-Operation on a Resource after Expiration or Release (Type: Base),"The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.","If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1191 CWE-673,EN-External Influence of Sphere Definition (Type: Class),The product does not prevent the definition of control spheres from external actors.,"Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1192 CWE-674,EN-Uncontrolled Recursion (Type: Base),"The product does not properly control the amount of recursion that takes place, which consumes excessive resources, such as allocated memory or the program stack.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1193 CWE-675,EN-Duplicate Operations on Resource (Type: Class),"The product performs the same operation on a resource two or more times, when the operation should only be applied once.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1194 CWE-683,EN-Function Call With Incorrect Order of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses.","While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers or types of arguments, such as format strings in C. It also can occur in languages or environments that do not enforce strong typing.",,Unknown,
1195 CWE-684,EN-Incorrect Provision of Specified Functionality (Type: Base),"The code does not function according to its published specifications, potentially leading to incorrect usage.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1196 CWE-685,EN-Function Call With Incorrect Number of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1197 CWE-686,EN-Function Call With Incorrect Argument Type (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that is the wrong data type, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1198 CWE-687,EN-Function Call With Incorrectly Specified Argument Value (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that contains the wrong value, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1199 CWE-688,EN-Function Call With Incorrect Variable or Reference as Argument (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1200 CWE-69,EN-Improper Handling of Windows ::DATA Alternate Data Stream (Type: Variant),"The software does not properly prevent access to, or detect usage of, alternate data streams (ADS).","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,"Windows NTFS Alternate Data Streams: http://www.securityfocus.com/infocus/1822
1201 Writing Secure Code"
1202 CWE-691,EN-Insufficient Control Flow Management (Type: Class),"The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,
1203 CWE-693,EN-Protection Mechanism Failure (Type: Class),The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.,"This weakness covers three distinct situations. A ""missing"" protection mechanism occurs when the application does not define any mechanism against a certain class of attack. An ""insufficient"" protection mechanism might provide some defenses - for example, against the most common attacks - but it does not protect against everything that is intended. Finally, an ""ignored"" mechanism occurs when a mechanism is available and in active use within the product, but the developer has not applied it in some code path.",,Unknown,
1204 CWE-694,EN-Use of Multiple Resources with Duplicate Identifier (Type: Base),"The software uses multiple resources that can have the same identifier, in a context in which unique identifiers are required.","If the software assumes that each resource has a unique identifier, the software could operate on the wrong resource if attackers can cause multiple resources to be associated with the same identifier.",,Unknown,
1205 CWE-695,EN-Use of Low-Level Functionality (Type: Base),The software uses low-level functionality that is explicitly prohibited by the framework or specification under which the software is supposed to operate.,"The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1206 CWE-696,EN-Incorrect Behavior Order (Type: Class),"The software performs multiple related behaviors, but the behaviors are performed in the wrong order in ways which may produce resultant weaknesses.","The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1207 CWE-697,EN-Insufficient Comparison (Type: Class),"The software compares two entities in a security-relevant context, but the comparison is insufficient, which may lead to resultant weaknesses.","This weakness class covers several possibilities:
1208 the comparison checks one factor incorrectly;
1209 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,
1210 CWE-698,EN-Execution After Redirect (EAR) (Type: Base),"The web application sends a redirect to another location, but instead of exiting, it executes additional code.","This weakness class covers several possibilities:
1211 the comparison checks one factor incorrectly;
1212 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,Fear the EAR: Discovering and Mitigating Execution After Redirect Vulnerabilities: http://cs.ucsb.edu/~bboe/public/pubs/fear-the-ear-ccs2011.pdf
1213 CWE-7,EN-J2EE Misconfiguration: Missing Custom Error Page (Type: Variant),The default error page of a web application should not display sensitive information about the software system.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,19 Deadly Sins of Software Security
1214 CWE-703,EN-Improper Check or Handling of Exceptional Conditions (Type: Class),The software does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the software.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,"A Taxonomy of Security Faults in the UNIX Operating System: http://ftp.cerias.purdue.edu/pub/papers/taimur-aslam/aslam-taxonomy-msthesis.pdf
1215 Use of A Taxonomy of Security Faults: http://csrc.nist.gov/nissc/1996/papers/NISSC96/paper057/PAPER.PDF
1216 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
1217 CWE-704,EN-Incorrect Type Conversion or Cast (Type: Class),"The software does not correctly convert an object, resource or structure from one type to a different type.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1218 CWE-705,EN-Incorrect Control Flow Scoping (Type: Class),The software does not properly return control flow to the proper location after it has completed a task or detected an unusual condition.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1219 CWE-706,EN-Use of Incorrectly-Resolved Name or Reference (Type: Class),"The software uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1220 CWE-707,EN-Improper Enforcement of Message or Data Structure (Type: Class),The software does not enforce or incorrectly enforces that structured messages or data are well-formed before being read from an upstream component or sent to a downstream component.,"If a message is malformed it may cause the message to be incorrectly interpreted.
1221 This weakness typically applies in cases where the product prepares a control message that another process must act on, such as a command or query, and malicious input that was intended as data, can enter the control plane instead. However, this weakness also applies to more general cases where there are not always control implications.",,Unknown,
1222 CWE-708,EN-Incorrect Ownership Assignment (Type: Base),"The software assigns an owner to a resource, but the owner is outside of the intended control sphere.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1223 CWE-71,EN-Apple .DS_Store (Type: Variant),"Software operating in a MAC OS environment, where .DS_Store is in effect, must carefully manage hard links, otherwise an attacker may be able to leverage a hard link from .DS_Store to overwrite arbitrary files and gain privileges.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1224 CWE-710,EN-Coding Standards Violation (Type: Class),"The software does not follow certain coding rules for development, which can lead to resultant weaknesses or increase the severity of the associated vulnerabilities.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1225 CWE-72,EN-Improper Handling of Apple HFS+ Alternate Data Stream Path (Type: Variant),The software does not properly handle special paths that may identify the data or resource fork of a file on the HFS+ file system.,"If the software chooses actions to take based on the file name, then if an attacker provides the data or resource fork, the software may take unexpected actions. Further, if the software intends to restrict access to a file, then an attacker might still be able to bypass intended access restrictions by requesting the data or resource fork for that file.",,Unknown,No description: http://docs.info.apple.com/article.html?artnum=300422
1226 CWE-733,EN-Compiler Optimization Removal or Modification of Security-critical Code (Type: Base),The developer builds a security-critical protection mechanism into the software but the compiler optimizes the program such that the mechanism is removed or modified.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322"
1227 CWE-75,EN-Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) (Type: Class),The software does not adequately filter user-controlled input for special elements with control implications.,"This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
1228 The exposure can occur in a few different ways:
1229 1) The function/method was never intended to be exposed to outside actors.
1230 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Unknown,
1231 CWE-756,EN-Missing Custom Error Page (Type: Class),"The software does not return custom error pages to the user, possibly exposing sensitive information.","The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
1232 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Unknown,
1233 CWE-757,EN-Selection of Less-Secure Algorithm During Negotiation (Algorithm Downgrade) (Type: Class),"A protocol or its implementation supports interaction between multiple actors and allows those actors to negotiate which algorithm should be used as a protection mechanism such as encryption or authentication, but it does not select the strongest algorithm that is available to both parties.","When a security mechanism can be forced to downgrade to use a less secure algorithm, this can make it easier for attackers to compromise the software by exploiting weaker algorithm. The victim might not be aware that the less secure algorithm is being used. For example, if an attacker can force a communications channel to use cleartext instead of strongly-encrypted data, then the attacker could read the channel by sniffing, instead of going through extra effort of trying to decrypt the data using brute force techniques.",,Unknown,
1234 CWE-758,"EN-Reliance on Undefined, Unspecified, or Implementation-Defined Behavior (Type: Class)","The software uses an API function, data structure, or other entity in a way that relies on properties that are not always guaranteed to hold for that entity.","This can lead to resultant weaknesses when the required properties change, such as when the software is ported to a different platform or if an interaction error (CWE-435) occurs.",,Unknown,
1235 CWE-759,EN-Use of a One-Way Hash without a Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.
1236 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1237 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1238 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1239 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1240 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1241 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1242 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1243 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1244 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1245 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1246 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1247 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1248 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1249 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1250 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1251 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1252 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1253 CWE-760,EN-Use of a One-Way Hash with a Predictable Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software uses a predictable salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables, effectively disabling the protection that an unpredictable salt would provide.
1254 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1255 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1256 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1257 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1258 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1259 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1260 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1261 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1262 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1263 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1264 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1265 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1266 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1267 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1268 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1269 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1270 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1271 CWE-761,EN-Free of Pointer not at Start of Buffer (Type: Variant),"The application calls free() on a pointer to a memory resource that was allocated on the heap, but the pointer is not at the start of the buffer.","This can cause the application to crash, or in some cases, modify critical program variables or execute code.
1272 This weakness often occurs when the memory is allocated explicitly on the heap with one of the malloc() family functions and free() is called, but pointer arithmetic has caused the pointer to be in the interior or end of the buffer.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1273 Valgrind: http://valgrind.org/"
1274 CWE-763,EN-Release of Invalid Pointer or Reference (Type: Base),"The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly.","This weakness can take several forms, such as:
1275 The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
1276 The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1277 Valgrind: http://valgrind.org/"
1278 CWE-764,EN-Multiple Locks of a Critical Resource (Type: Variant),"The software locks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly locks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra locking calls will reduce the size of the total available pool, possibly leading to degraded performance or a denial of service. If this can be triggered by an attacker, it will be similar to an unrestricted lock (CWE-412). In the context of a binary lock, it is likely that any duplicate locking attempts will never succeed since the lock is already held and progress may not be possible.",,Unknown,
1279 CWE-765,EN-Multiple Unlocks of a Critical Resource (Type: Variant),"The software unlocks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Unknown,
1280 CWE-785,EN-Use of Path Manipulation Function without Maximum-sized Buffer (Type: Variant),"The software invokes a function for normalizing paths or file names, but it provides an output buffer that is smaller than the maximum possible size, such as PATH_MAX.","Passing an inadequately-sized output buffer to a path manipulation function can result in a buffer overflow. Such functions include realpath(), readlink(), PathAppend(), and others.",,Unknown,
1281 CWE-786,EN-Access of Memory Location Before Start of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Unknown,
1282 CWE-787,EN-Out-of-bounds Write (Type: Base),"The software writes data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,
1283 CWE-788,EN-Access of Memory Location After End of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location after the end of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Unknown,
1284 CWE-790,EN-Improper Filtering of Special Elements (Type: Class),"The software receives data from an upstream component, but does not filter or incorrectly filters special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1285 1. Untrusted data enters a web application, typically from a web request.
1286 2. The web application dynamically generates a web page that contains this untrusted data.
1287 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
1288 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1289 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
1290 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
1291 There are three main kinds of XSS:
1292 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
1293 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
1294 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
1295 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
1296 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1297 CWE-791,EN-Incomplete Filtering of Special Elements (Type: Base),"The software receives data from an upstream component, but does not completely filter special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1298 1. Untrusted data enters a web application, typically from a web request.
1299 2. The web application dynamically generates a web page that contains this untrusted data.
1300 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
1301 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1302 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
1303 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
1304 There are three main kinds of XSS:
1305 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
1306 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
1307 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
1308 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
1309 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1310 CWE-792,EN-Incomplete Filtering of One or More Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not completely filter one or more instances of special elements before sending it to a downstream component.","Incomplete filtering of this nature involves either
1311 only filtering a single instance of a special element when more exist, or
1312 not filtering all instances or all elements where multiple special elements exist.",,Unknown,
1313 CWE-793,EN-Only Filtering One Instance of a Special Element (Type: Variant),"The software receives data from an upstream component, but only filters a single instance of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be location-dependent, as in only the first or last element is filtered.",,Unknown,
1314 CWE-794,EN-Incomplete Filtering of Multiple Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not filter all instances of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be applied to
1315 sequential elements (special elements that appear next to each other) or
1316 non-sequential elements (special elements that appear multiple times in different locations).",,Unknown,
1317 CWE-795,EN-Only Filtering Special Elements at a Specified Location (Type: Base),"The software receives data from an upstream component, but only accounts for special elements at a specified location, thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1318 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1319 at an absolute position (e.g. ""byte number 10"").
1320 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1321 CWE-796,EN-Only Filtering Special Elements Relative to a Marker (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements positioned relative to a marker (e.g. ""at the beginning/end of a string; the second argument""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1322 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1323 at an absolute position (e.g. ""byte number 10"").
1324 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1325 CWE-797,EN-Only Filtering Special Elements at an Absolute Position (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. ""byte number 10""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1326 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1327 at an absolute position (e.g. ""byte number 10"").
1328 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1329 CWE-799,EN-Improper Control of Interaction Frequency (Type: Class),"The software does not properly limit the number or frequency of interactions that it has with an actor, such as the number of incoming requests.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
1330 CWE-8,EN-J2EE Misconfiguration: Entity Bean Declared Remote (Type: Variant),"When an application exposes a remote interface for an entity bean, it might also expose methods that get or set the bean's data. These methods could be leveraged to read sensitive information, or to change data in ways that violate the application's expectations, potentially leading to other vulnerabilities.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,
1331 CWE-81,EN-Improper Neutralization of Script in an Error Message Web Page (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page.","Error pages may include customized 403 Forbidden or 404 Not Found pages.
1332 When an attacker can trigger an error that contains unneutralized input, then cross-site scripting attacks may be possible.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
1333 CWE-82,EN-Improper Neutralization of Script in Attributes of IMG Tags in a Web Page (Type: Variant),"The web application does not neutralize or incorrectly neutralizes scripting elements within attributes of HTML IMG tags, such as the src attribute.","Attackers can embed XSS exploits into the values for IMG attributes (e.g. SRC) that is streamed and then executed in a victim's browser. Note that when the page is loaded into a user's browsers, the exploit will automatically execute.",,Unknown,
1334 CWE-820,EN-Missing Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but does not attempt to synchronize access to the resource.,"If access to a shared resource is not synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1335 CWE-821,EN-Incorrect Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but it does not correctly synchronize access to the resource.,"If access to a shared resource is not correctly synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1336 CWE-822,EN-Untrusted Pointer Dereference (Type: Base),"The program obtains a value from an untrusted source, converts this value to a pointer, and dereferences the resulting pointer.","An attacker can supply a pointer for memory locations that the program is not expecting. If the pointer is dereferenced for a write operation, the attack might allow modification of critical program state variables, cause a crash, or execute code. If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash, or set a program variable to an unexpected value (since the value will be read from an unexpected memory location).
1337 There are several variants of this weakness, including but not necessarily limited to:
1338 The untrusted value is directly invoked as a function call.
1339 In OS kernels or drivers where there is a boundary between ""userland"" and privileged memory spaces, an untrusted pointer might enter through an API or system call (see CWE-781 for one such example).
1340 Inadvertently accepting the value from an untrusted control sphere when it did not have to be accepted as input at all. This might occur when the code was originally developed to be run by a single user in a non-networked environment, and the code is then ported to or otherwise exposed to a networked environment.",,Unknown,
1341 CWE-823,EN-Use of Out-of-range Pointer Offset (Type: Base),"The program performs pointer arithmetic on a valid pointer, but it uses an offset that can point outside of the intended range of valid memory locations for the resulting pointer.","While a pointer can contain a reference to any arbitrary memory location, a program typically only intends to use the pointer to access limited portions of memory, such as contiguous memory used to access an individual array.
1342 Programs may use offsets in order to access fields or sub-elements stored within structured data. The offset might be out-of-range if it comes from an untrusted source, is the result of an incorrect calculation, or occurs because of another error.
1343 If an attacker can control or influence the offset so that it points outside of the intended boundaries of the structure, then the attacker may be able to read or write to memory locations that are used elsewhere in the program. As a result, the attack might change the state of the software as accessed through program variables, cause a crash or instable behavior, and possibly lead to code execution.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
1344 CWE-824,EN-Access of Uninitialized Pointer (Type: Base),The program accesses or uses a pointer that has not been initialized.,"If the pointer contains an uninitialized value, then the value might not point to a valid memory location. This could cause the program to read from or write to unexpected memory locations, leading to a denial of service. If the uninitialized pointer is used as a function call, then arbitrary functions could be invoked. If an attacker can influence the portion of uninitialized memory that is contained in the pointer, this weakness could be leveraged to execute code or perform other attacks.
1345 Depending on memory layout, associated memory management behaviors, and program operation, the attacker might be able to influence the contents of the uninitialized pointer, thus gaining more fine-grained control of the memory location to be accessed.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
1346 CWE-825,EN-Expired Pointer Dereference (Type: Base),"The program dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.","When a program releases memory, but it maintains a pointer to that memory, then the memory might be re-allocated at a later time. If the original pointer is accessed to read or write data, then this could cause the program to read or modify data that is in use by a different function or process. Depending on how the newly-allocated memory is used, this could lead to a denial of service, information exposure, or code execution.",,Unknown,
1347 CWE-826,EN-Premature Release of Resource During Expected Lifetime (Type: Base),The program releases a resource that is still intended to be used by the program itself or another actor.,"This weakness focuses on errors in which the program should not release a resource, but performs the release anyway. This is different than a weakness in which the program releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weaknesses, the resource should still be valid upon the subsequent access.
1348 When a program releases a resource that is still being used, it is possible that operations will still be taken on this resource, which may have been repurposed in the meantime, leading to issues similar to CWE-825. Consequences may include denial of service, information exposure, or code execution.",,Unknown,
1349 CWE-827,EN-Improper Control of Document Type Definition (Type: Base),"The software does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the software to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker.","As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content.
1350 For example, the SOAP specification prohibits SOAP messages from containing DTDs.",,Unknown,Apache CXF Security Advisory (CVE-2010-2076): http://svn.apache.org/repos/asf/cxf/trunk/security/CVE-2010-2076.pdf
1351 CWE-828,EN-Signal Handler with Functionality that is not Asynchronous-Safe (Type: Base),"The software defines a signal handler that contains code sequences that are not asynchronous-safe, i.e., the functionality is not reentrant, or it can be interrupted.","This can lead to an unexpected system state with a variety of potential consequences depending on context, including denial of service and code execution.
1352 Signal handlers are typically intended to interrupt normal functionality of a program, or even other signals, in order to notify the process of an event. When a signal handler uses global or static variables, or invokes functions that ultimately depend on such state or its associated metadata, then it could corrupt system state that is being used by normal functionality. This could subject the program to race conditions or other weaknesses that allow an attacker to cause the program state to be corrupted. While denial of service is frequently the consequence, in some cases this weakness could be leveraged for code execution.
1353 There are several different scenarios that introduce this issue:
1354 Invocation of non-reentrant functions from within the handler. One example is malloc(), which modifies internal global variables as it manages memory. Very few functions are actually reentrant.
1355 Code sequences (not necessarily function calls) contain non-atomic use of global variables, or associated metadata or structures, that can be accessed by other functionality of the program, including other signal handlers. Frequently, the same function is registered to handle multiple signals.
1356 The signal handler function is intended to run at most one time, but instead it can be invoked multiple times. This could happen by repeated delivery of the same signal, or by delivery of different signals that have the same handler function (CWE-831).
1357 Note that in some environments or contexts, it might be possible for the signal handler to be interrupted itself.
1358 If both a signal handler and the normal behavior of the software have to operate on the same set of state variables, and a signal is received in the middle of the normal execution's modifications of those variables, the variables may be in an incorrect or corrupt state during signal handler execution, and possibly still incorrect or corrupt upon return.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
1359 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1360 CWE-829,EN-Inclusion of Functionality from Untrusted Control Sphere (Type: Class),"The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1361 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
1362 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
1363 CWE-83,EN-Improper Neutralization of Script in Attributes in a Web Page (Type: Variant),"The software does not neutralize or incorrectly neutralizes ""javascript:"" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1364 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,
1365 CWE-830,EN-Inclusion of Web Functionality from an Untrusted Source (Type: Base),"The software includes web functionality (such as a web widget) from another domain, which causes it to operate within the domain of the software, potentially granting total access and control of the software to the untrusted source.","Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
1366 Even if the third party is a trusted source, the software may still be exposed to attacks and malicious behavior if that trusted source is compromised, or if the code is modified in transmission from the third party to the software.
1367 This weakness is common in ""mashup"" development on the web, which may include source functionality from other domains. For example, Javascript-based web widgets may be inserted by using '<SCRIPT SRC=""http://other.domain.here"">' tags, which causes the code to run in the domain of the software, not the remote site from which the widget was loaded. As a result, the included code has access to the local DOM, including cookies and other data that the developer might not want the remote site to be able to access.
1368 Such dependencies may be desirable, or even required, but sometimes programmers are not aware that a dependency exists.",,Unknown,Third-Party Web Widget Security FAQ: http://jeremiahgrossman.blogspot.com/2010/07/third-party-web-widget-security-faq.html
1369 CWE-831,EN-Signal Handler Function Associated with Multiple Signals (Type: Base),The software defines a function that is used as a handler for more than one signal.,"While sometimes intentional and safe, when the same function is used to handle multiple signals, a race condition could occur if the function uses any state outside of its local declaration, such as global variables or non-reentrant functions, or has any side effects.
1370 An attacker could send one signal that invokes the handler function; in many OSes, this will typically prevent the same signal from invoking the handler again, at least until the handler function has completed execution. However, the attacker could then send a different signal that is associated with the same handler function. This could interrupt the original handler function while it is still executing. If there is shared state, then the state could be corrupted. This can lead to a variety of potential consequences depending on context, including denial of service and code execution.
1371 Another rarely-explored possibility arises when the signal handler is only designed to be executed once (if at all). By sending multiple signals, an attacker could invoke the function more than once. This may generate extra, unintended side effects. A race condition might not even be necessary; the attacker could send one signal, wait until it is handled, then send the other signal.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
1372 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1373 CWE-832,EN-Unlock of a Resource that is not Locked (Type: Base),The software attempts to unlock a resource that is not locked.,"Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,
1374 CWE-833,EN-Deadlock (Type: Base),"The software contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in deadlock.","Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,"The Art of Software Security Assessment: Chapter 13, ""Synchronization Problems"" / ""Starvation and Deadlocks"", Page 760
1375 The Art of Software Security Assessment: Chapter 13, ""Starvation and Deadlocks"", Page 760.
1376 Secure Coding in C and C++: Chapter 7, ""Concurrency"", section ""Mutual Exclusion and Deadlock"", Page 248."
1377 CWE-834,EN-Excessive Iteration (Type: Base),The software performs an iteration or loop without sufficiently limiting the number of times that the loop is executed.,"If the iteration can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory. In many cases, a loop does not need to be infinite in order to cause enough resource consumption to adversely affect the software or its host system; it depends on the amount of resources consumed per iteration.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1378 CWE-835,EN-Loop with Unreachable Exit Condition (Infinite Loop) (Type: Base),"The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.","If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1379 CWE-836,EN-Use of Password Hash Instead of Password for Authentication (Type: Base),"The software records password hashes in a data store, receives a hash of a password from a client, and compares the supplied hash to the hash obtained from the data store.","Some authentication mechanisms rely on the client to generate the hash for a password, possibly to reduce load on the server or avoid sending the password across the network. However, when the client is used to generate the hash, an attacker can bypass the authentication by obtaining a copy of the hash, e.g. by using SQL injection to compromise a database of authentication credentials, or by exploiting an information exposure. The attacker could then use a modified client to replay the stolen hash without having knowledge of the original password.
1380 As a result, the server-side comparison against a client-side hash does not provide any more security than the use of passwords without hashing.",,Unknown,
1381 CWE-837,"EN-Improper Enforcement of a Single, Unique Action (Type: Base)","The software requires that an actor should only be able to perform an action once, or to have only one unique action, but the software does not enforce or improperly enforces this restriction.","In various applications, a user is only expected to perform a certain action once, such as voting, requesting a refund, or making a purchase. When this restriction is not enforced, sometimes this can have security implications. For example, in a voting application, an attacker could attempt to ""stuff the ballot box"" by voting multiple times. If these votes are counted separately, then the attacker could directly affect who wins the vote. This could have significant business impact depending on the purpose of the software.",,Unknown,
1382 CWE-838,EN-Inappropriate Encoding for Output Context (Type: Base),"The software uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.","This weakness can cause the downstream component to use a decoding method that produces different data than what the software intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the software. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks.
1383 While using output encoding is essential for ensuring that communications between components are accurate, the use of the wrong encoding - even if closely related - could cause the downstream component to misinterpret the output.
1384 For example, HTML entity encoding is used for elements in the HTML body of a web page. However, a programmer might use entity encoding when generating output for that is used within an attribute of an HTML tag, which could contain functional Javascript that is not affected by the HTML encoding.
1385 While web applications have received the most attention for this problem, this weakness could potentially apply to any type of software that uses a communications stream that could support multiple encodings.",,Unknown,"Injection-safe templating languages: http://manicode.blogspot.com/2010/06/injection-safe-templating-languages_30.html
1386 Can we please stop saying that XSS is boring and easy to fix!: http://diniscruz.blogspot.com/2010/09/can-we-please-stop-saying-that-xss-is.html
1387 Canoe: XSS prevention via context-aware output encoding: http://blog.ivanristic.com/2010/09/introducing-canoe-context-aware-output-encoding-for-xss-prevention.html
1388 What is the Future of Automated XSS Defense Tools?: http://software-security.sans.org/downloads/appsec-2011-files/manico-appsec-future-tools.pdf
1389 XSS Attacks: Preventing XSS Attacks
1390 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
1391 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
1392 CWE-839,EN-Numeric Range Comparison Without Minimum Check (Type: Base),"The program checks a value to ensure that it does not exceed a maximum, but it does not verify that the value exceeds the minimum.","Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1393 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversion Vulnerabilities"" Page 246.
1394 The Art of Software Security Assessment: Chapter 6, ""Comparisons"", Page 265."
1395 CWE-84,EN-Improper Neutralization of Encoded URI Schemes in a Web Page (Type: Variant),The web application improperly neutralizes user-controlled input for executable script disguised with URI encodings.,"Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1396 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,
1397 CWE-841,EN-Improper Enforcement of Behavioral Workflow (Type: Base),"The software supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence.","By performing actions in an unexpected order, or by omitting steps, an attacker could manipulate the business logic of the software or cause it to enter an invalid state. In some cases, this can also expose resultant weaknesses.
1398 For example, a file-sharing protocol might require that an actor perform separate steps to provide a username, then a password, before being able to transfer files. If the file-sharing server accepts a password command followed by a transfer command, without any username being provided, the software might still perform the transfer.
1399 Note that this is different than CWE-696, which focuses on when the software performs actions in the wrong sequence; this entry is closely related, but it is focused on ensuring that the actor performs actions in the correct sequence.
1400 Workflow-related behaviors include:
1401 Steps are performed in the expected order.
1402 Required steps are not omitted.
1403 Steps are not interrupted.
1404 Steps are performed in a timely fashion.",,Unknown,"Business Logic Flaws and Yahoo Games: http://jeremiahgrossman.blogspot.com/2006/12/business-logic-flaws.html
1405 Seven Business Logic Flaws That Put Your Website At Risk: http://www.whitehatsec.com/home/assets/WP_bizlogic092407.pdf
1406 Business Logic Flaws: http://www.whitehatsec.com/home/solutions/BL_auction.html
1407 Insufficient Process Validation: http://projects.webappsec.org/w/page/13246943/Insufficient-Process-Validation
1408 Defying Logic: Theory, Design, and Implementation of Complex Systems for Testing Application Logic: http://www.slideshare.net/RafalLos/defying-logic-business-logic-testing-with-automation
1409 Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
1410 Toward Automated Detection of Logic Vulnerabilities in Web Applications: http://www.usenix.org/events/sec10/tech/full_papers/Felmetsger.pdf
1411 Designing a Framework Method for Secure Business Application Logic Integrity in e-Commerce Systems: http://ijns.femto.com.tw/contents/ijns-v12-n1/ijns-2011-v12-n1-p29-41.pdf"
1412 CWE-842,EN-Placement of User into Incorrect Group (Type: Base),The software or the administrator places a user into an incorrect group.,"If the incorrect group has more access or privileges than the intended group, the user might be able to bypass intended security policy to access unexpected resources or perform unexpected actions. The access-control system might not be able to detect malicious usage of this group membership.",,Unknown,
1413 CWE-843,EN-Access of Resource Using Incompatible Type (Type Confusion) (Type: Base),"The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.","When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1414 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
1415 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,"Attacking Interoperability: http://www.azimuthsecurity.com/resources/bh2009_dowd_smith_dewey.pdf
1416 The Art of Software Security Assessment: Chapter 7, ""Type Confusion"", Page 319."
1417 CWE-85,EN-Doubled Character XSS Manipulations (Type: Variant),The web application does not filter user-controlled input for executable script disguised using doubling of the involved characters.,"When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1418 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
1419 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,
1420 CWE-86,EN-Improper Neutralization of Invalid Characters in Identifiers in Web Pages (Type: Variant),"The software does not neutralize or incorrectly neutralizes invalid characters or byte sequences in the middle of tag names, URI schemes, and other identifiers.","Some web browsers may remove these sequences, resulting in output that may have unintended control implications. For example, the software may attempt to remove a ""javascript:"" URI scheme, but a ""java%00script:"" URI may bypass this check and still be rendered as active javascript by some browsers, allowing XSS or other attacks.",,Unknown,
1421 CWE-87,EN-Improper Neutralization of Alternate XSS Syntax (Type: Variant),The software does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1422 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,
1423 CWE-88,EN-Argument Injection or Modification (Type: Base),"The software does not sufficiently delimit the arguments being passed to a component in another control sphere, allowing alternate arguments to be provided, leading to potentially security-relevant changes.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1424 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,"Argument injection issues: http://www.securityfocus.com/archive/1/archive/1/460089/100/100/threaded
1425 The Art of Software Security Assessment: Chapter 10, ""The Argument Array"", Page 567."
1426 CWE-9,EN-J2EE Misconfiguration: Weak Access Permissions for EJB Methods (Type: Variant),"If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the software system.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1427 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,
1428 CWE-90,EN-Improper Neutralization of Special Elements used in an LDAP Query (LDAP Injection) (Type: Base),"The software constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1429 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,Web Applications and LDAP Injection
1430 CWE-91,EN-XML Injection (aka Blind XPath Injection) (Type: Base),"The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.","Within XML, special elements could include reserved words or characters such as ""<"", "">"", """""", and ""&"", which could then be used to add new data or modify XML syntax.",,Unknown,"Blind XPath Injection: http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf
1431 The Art of Software Security Assessment: Chapter 17, ""XML Injection"", Page 1069."
1432 CWE-912,EN-Hidden Functionality (Type: Class),"The software contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the software's users or administrators.","Hidden functionality can take many forms, such as intentionally malicious code, ""Easter Eggs"" that contain extraneous functionality such as games, developer-friendly shortcuts that reduce maintenance or support costs such as hard-coded accounts, etc. From a security perspective, even when the functionality is not intentionally malicious or damaging, it can increase the software's attack surface and expose additional weaknesses beyond what is already exposed by the intended functionality. Even if it is not easily accessible, the hidden functionality could be useful for attacks that modify the control flow of the application.",,Unknown,
1433 CWE-913,EN-Improper Control of Dynamically-Managed Code Resources (Type: Class),"The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.","Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.",,Unknown,
1434 CWE-914,EN-Improper Control of Dynamically-Identified Variables (Type: Base),The software does not properly restrict reading from or writing to dynamically-identified variables.,"Many languages offer powerful features that allow the programmer to access arbitrary variables that are specified by an input string. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can modify unintended variables that have security implications.",,Unknown,
1435 CWE-915,EN-Improperly Controlled Modification of Dynamically-Determined Object Attributes (Type: Base),"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.","If the object contains attributes that were only intended for internal use, then their unexpected modification could lead to a vulnerability.
1436 This weakness is sometimes known by the language-specific mechanisms that make it possible, such as mass assignment, autobinding, or object injection.",,Unknown,"Shocking News in PHP Exploitation: http://www.suspekt.org/downloads/POC2009-ShockingNewsInPHPExploitation.pdf
1437 ""Two Security Vulnerabilities in the Spring Framework's MVC"" pdf (from 2008): http://blog.diniscruz.com/2011/07/two-security-vulnerabilities-in-spring.html
1438 Two Security Vulnerabilities in the Spring Framework's MVC: http://o2platform.files.wordpress.com/2011/07/ounce_springframework_vulnerabilities.pdf
1439 Best Practices for ASP.NET MVC: http://blogs.msdn.com/b/aspnetue/archive/2010/09/17/second_2d00_post.aspx
1440 Mass assignment in Rails applications: http://blog.mhartl.com/2008/09/21/mass-assignment-in-rails-applications/
1441 Secure your Rails apps!: http://pragtob.wordpress.com/2012/03/06/secure-your-rails-apps/
1442 Ruby On Rails Security Guide: http://guides.rubyonrails.org/security.html#mass-assignment
1443 Mass Assignment Vulnerability in ASP.NET MVC: http://freshbrewedcode.com/joshbush/2012/03/05/mass-assignment-aspnet-mvc/
1444 6 Ways To Avoid Mass Assignment in ASP.NET MVC: http://odetocode.com/blogs/scott/archive/2012/03/11/complete-guide-to-mass-assignment-in-asp-net-mvc.aspx
1445 PHP Object Injection: https://www.owasp.org/index.php/PHP_Object_Injection
1446 Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
1447 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
1448 CWE-916,EN-Use of Password Hash With Insufficient Computational Effort (Type: Base),"The software generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1449 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
1450 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
1451 The amount of CPU time required to compute the hash (""stretching"")
1452 The amount of memory required to compute the hash (""memory-hard"" operations)
1453 Including a random value, along with the password, as input to the hash computation (""salting"")
1454 Given a hash, there is no known way of determining a password that produces this hash value, other than by guessing possible passwords (""one-way"" hashing)
1455 Relative to the number of all possible hashes that can be generated by the scheme, there is a low likelihood of producing the same hash for multiple different inputs (""collision resistance"")
1456 Note that the security requirements for the software may vary depending on the environment and the value of the passwords. Different schemes might not provide all of these properties, yet may still provide sufficient security for the environment. Conversely, a solution might be very strong in preserving one property, which still being very weak for an attack against another property, or it might not be able to significantly reduce the efficiency of a massively-parallel attack.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1457 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1458 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1459 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1460 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1461 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1462 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1463 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1464 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1465 Password hashing at scale: http://www.openwall.com/presentations/YaC2012-Password-Hashing-At-Scale/
1466 New developments in password hashing: ROM-port-hard functions: http://www.openwall.com/presentations/ZeroNights2012-New-In-Password-Hashing/
1467 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1468 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1469 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1470 CWE-917,EN-Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection) (Type: Base),"The software constructs all or part of an expression language (EL) statement in a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1471 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
1472 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
1473 The amount of CPU time required to compute the hash (""stretching"")
1474 The amount of memory required to compute the hash (""memory-hard"" operations)
1475 Including a random value, along with the password, as input to the hash computation (""salting"")
1476 Given a hash, there is no known way of determining a password that produces this hash value, other than by guessing possible passwords (""one-way"" hashing)
1477 Relative to the number of all possible hashes that can be generated by the scheme, there is a low likelihood of producing the same hash for multiple different inputs (""collision resistance"")
1478 Note that the security requirements for the software may vary depending on the environment and the value of the passwords. Different schemes might not provide all of these properties, yet may still provide sufficient security for the environment. Conversely, a solution might be very strong in preserving one property, which still being very weak for an attack against another property, or it might not be able to significantly reduce the efficiency of a massively-parallel attack.",,Unknown,"Expression Language Injection: http://www.mindedsecurity.com/fileshare/ExpressionLanguageInjection.pdf
1479 Remote Code with Expression Language Injection: http://danamodio.com/application-security/discoveries/spring-remote-code-with-expression-language-injection/"
1480 CWE-918,EN-Server-Side Request Forgery (SSRF) (Type: Base),"The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,"SSRF vs. Business-critical applications: XXE tunneling in SAP: https://media.blackhat.com/bh-us-12/Briefings/Polyakov/BH_US_12_Polyakov_SSRF_Business_Slides.pdf
1481 SSRF vs. Business-critical Applications. Part 1: XXE Tunnelling in SAP NetWeaver: http://erpscan.com/wp-content/uploads/2012/08/SSRF-vs-Businness-critical-applications-whitepaper.pdf
1482 Cross Site Port Attacks - XSPA - Part 1: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-1.html
1483 Cross Site Port Attacks - XSPA - Part 2: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-2.html
1484 Cross Site Port Attacks - XSPA - Part 3: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-3.html
1485 SSRF attacks and sockets: smorgasbord of vulnerabilities: http://www.slideshare.net/d0znpp/ssrf-attacks-and-sockets-smorgasbord-of-vulnerabilities
1486 SSRF bible. Cheatsheet: https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit?pli=1#
1487 Web Portals: Gateway To Information, Or A Hole In Our Perimeter Defenses: http://www.shmoocon.org/2008/presentations/Web%20portals,%20gateway%20to%20information.ppt"
1488 CWE-92,EN-DEPRECATED: Improper Sanitization of Custom Special Characters (Type: Base),"This entry has been deprecated. It originally came from PLOVER, which sometimes defined ""other"" and ""miscellaneous"" categories in order to satisfy exhaustiveness requirements for taxonomies. Within the context of CWE, the use of a more abstract entry is preferred in mapping situations. CWE-75 is a more appropriate mapping.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,
1489 CWE-920,EN-Improper Restriction of Power Consumption (Type: Base),"The software operates in an environment in which power is a limited resource that cannot be automatically replenished, but the software does not properly restrict the amount of power that its operation consumes.","In environments such as embedded or mobile devices, power can be a limited resource such as a battery, which cannot be automatically replenished by the software itself, and the device might not always be directly attached to a reliable power source. If the software uses too much power too quickly, then this could cause the device (and subsequently, the software) to stop functioning until power is restored, or increase the financial burden on the device owner because of increased power costs.
1490 Normal operation of an application will consume power. However, in some cases, an attacker could cause the application to consume more power than intended, using components such as:
1491 Display
1492 CPU
1493 Disk I/O
1494 GPS
1495 Sound
1496 Microphone
1497 USB interface",,Unknown,
1498 CWE-921,EN-Storage of Sensitive Data in a Mechanism without Access Control (Type: Base),The software stores sensitive information in a file system or device that does not have built-in access control.,"While many modern file systems or devices utilize some form of access control in order to restrict access to data, not all storage mechanisms have this capability. For example, memory cards, floppy disks, CDs, and USB devices are typically made accessible to any user within the system. This can become a problem when sensitive data is stored in these mechanisms in a multi-user environment, because anybody on the system can read or write this data.
1499 On Android devices, external storage is typically globally readable and writable by other applications on the device. External storage may also be easily accessible through the mobile device's USB connection or physically accessible through the device's memory card port.",,Unknown,Security Tips: http://developer.android.com/training/articles/security-tips.html#StoringData
1500 CWE-922,EN-Insecure Storage of Sensitive Information (Type: Class),The software stores sensitive information without properly limiting read or write access by unauthorized actors.,"If read access is not properly restricted, then attackers can steal the sensitive information. If write access is not properly restricted, then attackers can modify and possibly delete the data, causing incorrect results and possibly a denial of service.",,Unknown,
1501 CWE-923,EN-Improper Authentication of Endpoint in a Communication Channel (Type: Class),"The software establishes a communication channel to (or from) an endpoint for privileged or protected operations, but it does not properly authenticate the endpoint to ensure it is associated with the identity of the intended actor.","Attackers might be able to spoof the intended endpoint from a different system or process, thus gaining the same level of access as the intended endpoint.
1502 While this issue frequently involves authentication between network-based clients and servers, other types of communication channels and endpoints can have this weakness.",,Unknown,
1503 CWE-924,EN-Improper Enforcement of Message Integrity During Transmission in a Communication Channel (Type: Class),"The software establishes a communication channel with an endpoint and receives a message from that endpoint, but it does not sufficiently ensure that the message was not modified during transmission.",A man-in-the-middle (MITM) attacker might be able to modify the message and spoof the endpoint.,,Unknown,
1504 CWE-925,EN-Improper Verification of Intent by Broadcast Receiver (Type: Variant),"The Android application uses a Broadcast Receiver that receives an Intent but does not properly verify that the Intent came from an authorized source, e.g. by checking the action string.","Certain types of Intents, identified by action string, can only be broadcast by the operating system itself, not by third-party applications. However, when an application declares the ability for a component to receive broadcast messages, in most cases a malicious application can send an Intent with a non-reserved action string to that receiving component.",,Unknown,
1505 CWE-926,EN-Improper Restriction of Content Provider Export to Other Applications (Type: Variant),The Android application uses a Content Provider that does not properly restrict which applications can access the data that is offered by the Content Provider.,"Android's Content Provider mechanism can be used to share data with other applications or internally within the same application. If access to the Content Provider is not restricted to only the expected applications, then malicious applications might be able to access the sensitive data.
1506 This weakness could be expressed in several different ways:
1507 The Content Provider is only intended for internal use by the application, and thus does not need to be exported.
1508 In Android before 4.2, the Content Provider is automatically exported unless it has been explicitly declared as NOT exported.
1509 The Content Provider is intended for external use by some applications, but it does not properly limit access, e.g. by exporting with excessive permissions.",,Unknown,No description: http://developer.android.com/training/articles/security-tips.html#ContentProviders
1510 CWE-927,EN-Use of Implicit Intent for Sensitive Communication (Type: Variant),The Android application uses an implicit intent for transmitting sensitive data to other applications.,"Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Unknown,"Analyzing Inter-Application Communication in Android: http://www.cs.berkeley.edu/~afelt/intentsecurity-mobisys.pdf
1511 Security Tips: http://developer.android.com/training/articles/security-tips.html#ContentProviders"
1512 CWE-96,EN-Improper Neutralization of Directives in Statically Saved Code (Static Code Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1513 CWE-97,EN-Improper Neutralization of Server-Side Includes (SSI) Within a Web Page (Type: Variant),"The software generates a web page, but does not neutralize or incorrectly neutralizes user-controllable input that could be interpreted as a server-side include (SSI) directive.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1514 CWE-116,EN-Improper Encoding or Escaping of Output (Type: Class),"The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.","Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
1515 Most software follows a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, ""GET /index.html HTTP/1.1"" is a structured message containing a command (""GET"") with a single argument (""/index.html"") and metadata about which protocol version is being used (""HTTP/1.1"").
1516 If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.",,Very High,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
1517 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
1518 Output Sanitization: http://www.analyticalengine.net/archives/58
1519 Sanitizing user data: How and where to do it: http://www.diovo.com/2008/09/sanitizing-user-data-how-and-where-to-do-it/
1520 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
1521 Input Validation - Not That Important: http://manicode.blogspot.com/2008/08/input-validation-not-that-important.html
1522 Preventing XSS with Correct Output Encoding: http://phed.org/2008/05/19/preventing-xss-with-correct-output-encoding/
1523 Writing Secure Code: Chapter 11, ""Canonical Representation Issues"" Page 363"
1524 CWE-121,EN-Stack-based Buffer Overflow (Type: Variant),"A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,Very High,"Writing Secure Code: Chapter 5, ""Stack Overruns"" Page 129
1525 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
1526 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
1527 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
1528 CWE-134,EN-Uncontrolled Format String (Type: Base),"The software uses externally-controlled format strings in printf-style functions, which can lead to buffer overflows or data representation problems.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Very High,"Format String Vulnerabilities in Perl Programs: http://www.securityfocus.com/archive/1/418460/30/0/threaded
1529 Programming Language Format String Vulnerabilities: http://www.ddj.com/dept/security/197002914
1530 Format String Attacks: http://www.thenewsh.com/~newsham/format-string-attacks.pdf
1531 Writing Secure Code: Chapter 5, ""Format String Bugs"" Page 147
1532 24 Deadly Sins of Software Security: ""Sin 6: Format String Problems."" Page 109
1533 The Art of Software Security Assessment: Chapter 8, ""C Format Strings"", Page 422."
1534 CWE-256,EN-Plaintext Storage of a Password (Type: Variant),Storing a password in plaintext may result in a system compromise.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1535 CWE-257,EN-Storing Passwords in a Recoverable Format (Type: Base),"The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,
1536 CWE-258,EN-Empty Password in Configuration File (Type: Variant),Using an empty string as a password is insecure.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1537 CWE-259,EN-Use of Hard-coded Password (Type: Base),"The software contains a hard-coded password, which it uses for its own inbound authentication or for outbound communication to external components.","A hard-coded password typically leads to a significant authentication failure that can be difficult for the system administrator to detect. Once detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1538 Inbound: the software contains an authentication mechanism that checks for a hard-coded password.
1539 Outbound: the software connects to another system or component, and it contains hard-coded password for connecting to that component.
1540 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
1541 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1542 CWE-309,EN-Use of Password System for Primary Authentication (Type: Base),"The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.","While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,Very High,
1543 CWE-74,EN-Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection) (Type: Class),"The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","Software has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Very High,
1544 CWE-77,EN-Improper Neutralization of Special Elements used in a Command (Command Injection) (Type: Class),"The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.","Command injection vulnerabilities typically occur when:
1545 1. Data enters the application from an untrusted source.
1546 2. The data is part of a string that is executed as a command by the application.
1547 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Very High,"Exploiting Software: How to Break Code
1548 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171"
1549 CWE-798,EN-Use of Hard-coded Credentials (Type: Base),"The software contains hard-coded credentials, such as a password or cryptographic key, which it uses for its own inbound authentication, outbound communication to external components, or encryption of internal data.","Hard-coded credentials typically create a significant hole that allows an attacker to bypass the authentication that has been configured by the software administrator. This hole might be difficult for the system administrator to detect. Even if detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1550 Inbound: the software contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials.
1551 Outbound: the software connects to another system or component, and it contains hard-coded credentials for connecting to that component.
1552 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
1553 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"Writing Secure Code: Chapter 8, ""Key Management Issues"" Page 272
1554 Top 25 Series - Rank 11 - Hardcoded Credentials: http://blogs.sans.org/appsecstreetfighter/2010/03/10/top-25-series-rank-11-hardcoded-credentials/
1555 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
1556 CWE-89,EN-Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) (Type: Base),"The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1557 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Very High,"24 Deadly Sins of Software Security: ""Sin 1: SQL Injection."" Page 3
1558 Writing Secure Code: Chapter 12, ""Database Input Issues"" Page 397
1559 SQL Injection Prevention Cheat Sheet: http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
1560 SQL Injection Attacks by Example: http://www.unixwiz.net/techtips/sql-injection.html
1561 SQL Injection Cheat Sheet: http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/
1562 The Database Hacker's Handbook: Defending Database Servers
1563 The Oracle Hacker's Handbook: Hacking and Defending Oracle
1564 SQL Injection: http://msdn.microsoft.com/en-us/library/ms161953.aspx
1565 SQL Injection Attack: http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx
1566 Giving SQL Injection the Respect it Deserves: http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx
1567 Top 25 Series - Rank 2 - SQL Injection: http://blogs.sans.org/appsecstreetfighter/2010/03/01/top-25-series-rank-2-sql-injection/
1568 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
1569 The Art of Software Security Assessment: Chapter 8, ""SQL Queries"", Page 431.
1570 The Art of Software Security Assessment: Chapter 17, ""SQL Injection"", Page 1061."
1571 CWE-262,EN-Not Using Password Aging (Type: Variant),"If no mechanism is in place for managing password aging, users will have no incentive to update passwords in a timely manner.","This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1572 CWE-263,EN-Password Aging with Long Expiration (Type: Base),Allowing password aging to occur unchecked can result in the possibility of diminished password integrity.,"Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1573 CWE-768,ES-Incorrect Short Circuit Evaluation (Type: Variant),"The software contains a conditional statement with multiple logical expressions in which one of the non-leading expressions may produce side effects. This may lead to an unexpected state in the program after the execution of the conditional, because short-circuiting logic may prevent the side effects from occurring.",,"Usage of short circuit evaluation, though well-defined in the C standard, may alter control flow in a way that introduces logic errors that are difficult to detect, possibly causing errors later during the software's execution. If an attacker can discover such an inconsistency, it may be exploitable to gain arbitrary control over a system.
1574 If the first condition of an ""or"" statement is assumed to be true under normal circumstances, or if the first condition of an ""and"" statement is assumed to be false, then any subsequent conditional may contain its own logic errors that are not detected during code review or testing.
1575 Finally, the usage of short circuit evaluation may decrease the maintainability of the code.",Very Low,
1576 ,Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
1577 ,ES-Session Cookie without Secure flag set,"La cookie no tiene la marca de ""Secure"". Esto instruye al navegador que dicha cookie puede ser solo accedida por canales SSL.",,Si es posible se deberia habilitar la flag Secure para esta cookie,Low,
1578 ,ES-Session Cookie without HttpOnly flag Set,"La cookie de sesion no esta marcada como HTTPOnly, cuando una cookie es marcada de esta manera da instruccion al navegador que esa cookie puede ser accedida solamente por el servdor y no por script del lado del cliente. Es una importante proteccion de seguridad para las cookies de sesion",,Si es posible se deberia habilitar la flag HTTPOnly para esta cookie,Low,
1579 ,ES-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
1580 Se ha detectado un problema en las versiones de apache 1.3.0, 2.0.x hasta 2.0.64 y 2.2.X hasta 2.2.19 que mediante una herramienta automatizada un atacante usand una moderada cantidad de request puede causar un uso significativo de memoria y CPU en el servidor. Datos: http://seclists.org/fulldisclosure/2011/Aug/175.",,Actualizar version de apache,Medium,
1581 ,ES-Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
1582 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
1583 Disallow: /*AB/$
1584 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",Info,
1585 ,ES-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
1586 ,ES-Credentials en Texto Plano,Las Credenciales de usuario son trasmitidas por un canal sin cifrar y puede ser interceptada.,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
1587 ,ES-Parametro __VIEWSTATE sin encriptar,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
1588 <machineKey validation=""3DES""/>",,
1589 ,ES-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
1590
1591 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
1592 style=""border-width:0px;"" />
1593
1594 Siendo la respuesta THHvB
1595
1596 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
1597 ,"ES-Mensaje de error de la aplicacion
1598 (Application error message)","El server responde con mensajes de error internos que no deberián mostrarse, facilitando de esta manera informacion que puede ser sensible o util para un atacante. Pudiendo de esta manera obtener datos para mejorar su vector de ataque",,"Se recomienda deshabilitar los mensajes de error, para no proporcionar información de la tecnología o software implementado.
1599
1600 ",Low,
1601 ,ES-Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1602 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,Medium,
1603 ,ES-Input de Contraseña con Autocompletar,"Un form de login con autocompletar sugiere un problema de seguridad, sobretodo para los usuarios que utilizan el servicio desde computadoras publicas.",,"Se recomienta establecer el input con Autocomplete OFF:
1604 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
1605 ,ES-Archivos de Backup,"Los archivos de Backup pueden contener codigo fuente de script, archivos de configuracion u otra informacion sensible que puede ayudar a un atacante a conocer el servidor y preparar ataques mas avanzados o especificos.",,Remover el/los archivo(s) si no son requeridos en el servidor en produccion. Como un paso adicional es recomendado implementar una politica de seguridad para no permitir la creacion de archivos de backup en directorios accesibles desde la web.,,
1606 ,ES-Possible sensitive directories,"Un posible directorio sensible fue encotnrado. Este directorio no esta directamente linkeado en el servidor Web.Se chekeo usando nombres comunes para directorios de configuracion, backups, bajadas de bases de datos, paginas de administracion, archivos temporales, etc. Usar nombres comunes de directorios para almacenar este tipo de informacion facilita a usuarios maliciosos buscar archivos sensibles.",,"Se recomienda llamar a estos directorios de manera no estandard, por ejemplo:
1607 config-->c0nfig05
1608 backup-->b4ccup
1609 Aunque es aun mas recomendabl, de ser posible, no dejar directorios de backup, configuracion, etc accesibles directamente desde la web",,
1610 ,ES-Slow HTTP Denial of Service Attack,"Los ataques conocidos como ""Slowloris"" y ""Slow HTTP POST DoS"" se basan en el hecho de que el protocolo HTTP, por diseño, requiere que las consultas esten completamente recividas por el servidor antes de poder ser procesadas. Si la consulta HTTP no esta completa, o si la tranferencia es muy lenta, el servidor mantiene recursos ocupados esperando el resto de la informacion. Si el servidor mantiene demasiados recursos ocupados, esto crea una denegacion de servicio.",,Es importante establecer los tiempos de espera del servidor. Se adjunta link de recomendacion para evitar este tipo de ataques: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1611 ,ES-Clickjacking,"No se encuentra ningún tipo de impedimento para evitar que la web sea embebida dentro de un iframe. Esta restricción es importante ya que un atacante podría engañar a un usuario autenticado a realizar operaciones mediante un engaño llamado Clickjacking donde la víctima se le presenta una web, posiblemente con algun juego, utilizando algunos engaños de interfaz la victima podria ser engañada a aprobar una venta. Ref:http://javascript.info/tutorial/clickjacking",,"Todos los browsers modernos son capaces de interpretar los valores seteados en X-Frame-Options, si los mismos son incluidos en el Header del servidor.",Low,
1612 ,"ES-XSS Cross Site Scripting
1613 (Secuencias de comandos en sitios cruzados)","Es posible injectar tags html y código javascript malicioso, por una falta en la comprobación de los datos ingresados en los parameros. De esta forma, un atacante podría ejecutar código que le permita obtener las cookies del usuario atacado, y de esa forma, tomar control de su cuenta.",,"Recomendamos filtrar todos los parámetros en búsqueda de posibles injecciones, y escapar todos los datos de entrada que se vayan a mostrar en la respuesta.",High,
1614 ,ES-SSL 2.0 Obsolete Protocol,"El servicio remoto encripta el trafico utilizando una version obsoleta del protocolo SSL con errores y debilidades conocidas. Un atacante puede explotar estas vulneravilidades y conducir a un ataque de ""man in the middle"" o desencriptar la comunicaciones entre el servicio afectado y los clientes.",,Se recomienda desactivar SSL 2.0 y usar SSL 3.0 o TLS 1.0 en su lugar.,High,
1615 ,"ES-OPTIONS method is enabled
1616 (Metodo OPTIONS activado)",El metodo HTTP OPTIONS esta activado en el servidor. El metodo OPTIONS provee una lista de los metodos que son soportados por el servidor web. El metodo OPTIONS puede exponer informasion sensible que puede ayudar a un usuario malicioso a preparar ataques mas avanzados,,Es recomendado desactivar el metodo OPTIONS en un servidor en produccion.,Low,
1617 ,ES-TLS1/SSLv3 Renegotiation Vulnerability,"Una vulnerabilidad en la manera que el protocol SSL and TLS acepta pedidos renegociaciones pueden permitir a un atacante inyectar texto plano en ect plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
1618 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
1619 ,ES-File Inclusion,Es posible que un atacante remoto incluya un archivo de recursos locales o remotos y / o la ejecución de código de script arbitrario con los privilegios del servidor web.,,"Editar el código fuente para asegurarse de que la entrada esté correctamente validada. Cuando es posible, se recomienda hacer una lista de nombres de archivos aceptados y restringir la entrada a la lista.
1620
1621 En PHP, la opción allow_url_fopen normalmente permite a un programador para abrir, incluir o utilizan de alguna manera un archivo remoto a través de una URL en lugar de una ruta de archivo local. Se recomienda desactivar esta opción de php.ini.",,
1622 CWE-319,"ES-Credenciales enviadas por un canal en texto plano
1623 (User Credentials Sent in Clear Text)","Las credenciales de usuario se transmiten sobre un canal sin cifrar. Esta información siempre debe ser transferida a través de un canal cifrado (HTTPS) para evitar ser interceptados por usuarios maliciosos.
1624
1625 Una tercera persona puede ser capaz de leer las credenciales de usuario mediante la interceptación de una conexión no cifrada de HTTP.",,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",Medium,
1626 ,ES-URL Redirection,"Este script es vulnerable a los ataques de redireccion por URL
1627
1628 La redireccion por URL es comunmente usado para pishing y suplantacion de identidad, ya que confunde al usuario a que sitio esta ingresando realmente. Un atacante puede redireccionar una visita desde un sitio valido hasta un servidor preparado por el, para poder hacer ataques como por ejemplo de pishin o distribucion de malware.",,"El script debe filtrar los sitios destinos del redirect, manteniendolo siempre dentro de los dominios validos.",,
1629 ,ES-Apache Server Status Enabled,"Server Status es una opcion de debug que muestra informacion sensible del servidor, como numero de peticiones, url de las peticiones, uso de memoria, threads, etc",,"Es recomendable desactivar esta opcion en servidores en produccion, o de ser necesaria la utilizacion de la misma, securizar la carpeta con contraseña o renombrarla para que no sea de facil ubicacion",,
1630 ,ES-Microsoft IIS tilde directory enumeration,"Es posible detectar nombres cortos de archivosy directorios cuyo nombrado sea en formato 8.3 en Windows usando vectores en varias versiones de Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1631 ,ES-SQL Injection,"Debido al incorrecto filtrado de parámetros es posible ejecutar comandos SQL en la base de datos situada en el servidor mediante manipulación de parámetros. Un atacante podría utilizar esta técnica para extraer/modificar/eliminar el contenido de la base de datos, el único limitante son los privilegios del usuario utilizado por la web application aunque en muchos casos es posible, gracias a una inyeccion de SQL, es posible catapultar un acceso al sistema operativo.",,"Se debe modificar la aplicación para filtrar caracteres en los campos de input antes de ser enviados como consulta al servidor de base de datos.
1632 Es importante que se sigan buenas prácticas de programación, en todos los sitios desarrollados, y sobre todos los parámetros, y no solo sobre aquellos que sean vulnerables actualmente.
1633 Guía de cómo evitar estos ataques (en inglés): https://www.owasp.org/index.php/Guide_to_SQL_Injection",Very High,
1634 ,ES-ASP.NET debugging enabled,"El modo depuracion de ASP.NET esta activado en el servidor. Es recomendado desactivar este modo en servidores en produccion. Por defecto en la instalacion de IIS este modo esta desactivado, si fue activado para diagnosticar errores es conveniente luego desactivarlo.",,"Es posible que el modo debug muestre datos sensibles del servidor.
1635 Mas informacion de como desactivar el modo debug:
1636 http://support.microsoft.com/default.aspx?scid=kb;es-us;815157",,
1637 ,ES-Unicode tranfsormation Issues,"La pagina es vulnerable a varias tranformaciones de Unicode como ""Best-Fit Mappings"", ""Overlong byte sequences"" y ""Ill-formed sequences"".
1638 Best-Fit Mappings ocurre cuando el caracter X es tranformado por un totalmente diferente caracter Y. En general, best-fit mappings occure cuando el caracter es transcodeado entre Unicode y otro encodificado.
1639
1640 ************************************
1641
1642 ""Overlong byte sequences"" (no la forma corta) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
1643 0xC0 0x8A
1644 0xE0 0x80 0x8A
1645 0xF0 0x80 0x80 0x8A
1646 0xF8 0x80 0x80 0x80 0x8A
1647 0xFC 0x80 0x80 0x80 0x80 0x8A
1648
1649 Ill-Formed Subsequences As REQUIRED by UNICODE 3.0, and noted in the Unicode Technical Report #36, if a leading byte is followed by an invalid successor byte, then it should NOT consume it.
1650
1651
1652 Software vulnerabilities arise when Best-Fit mappings occur. For example, characters can be manipulated to bypass string handling filters, such as cross-site scripting (XSS) or SQL Injection filters, WAF's, and IDS devices. Overlong UTF-8 sequence could be abused to bypass UTF-8 substring tests that look only for the shortest possible encoding.",,"Se debe identificar el origen de esta tranformacion Unicode y reparar el problema. Se deja links a paginas con informacion:
1653 Links with more information:
1654 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
1655 http://www.cl.cam.ac.uk/~mgk25/unicode.html
1656 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
1657 http://www.unicode.org/reports/tr36/",,
1658 ,"ES-File Upload XSS
1659 (Subida dearchivo de secuencias de comandos de sitios curzados)","El Script es vulnerable a XSS (Cross-site scripting). La aplicacion permite la carga de archivos y se subio un archivo conteniendo lenguaje HTML. Cuando este tipo de archivos es permitido en la carga, Lugo se pueden ejecutar o linkear, mostrando codigo o acciones malociosas en dicha web.
1660
1661 Usuarios maliciosos pueden inyectar: JavaScript, VBScript, ActiveX, HTML o Flash en esta aplicacion vulnerable y engañar a un usuario para obtener informacion de el, tambien se puede robar datos de la sesion, asi como las cookies de la misma. Dependiendo del codigo que se pueda ejecutar, tambien se puede ganar acceso al wevidor web, archivos de configuracion o hasta ejecucion de binarios en el sistema operativo host.",,"Se deben restringir los tipos de archivos aceptados en el sistema de Carga: chekear la extension y solo aceptar ciertos tipos de archivos. Se recomienda una Whitelist en lugar de Un blacklist (es mejor especificar listado unico de extensiones permitidas, sobre un listado de denegadas). Tambien se debe chekear doble extensiones como .php.png. Chekear archivos sin nombre como "".htaccess"" (en ASP.NET, se debe chekear archivos de configuracion como web.config). Cambiar los permisos sobre la carpeta upload (de carga) para que los archivos no puedan ser ejecutados ahi. Si es posible, renombre los archivos que son subidos al servidor.
1662 Links con mas informacion:
1663 https://www.owasp.org/index.php/Unrestricted_File_Upload
1664 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
1665 ,ES-jQuery cross site scripting,"Esta pagina esta usando una version obsoleta de jQuery la cual es vulnerable a Cross Site Scripting. Muchos sitios estan utilisando la seleccion de elementos usando location.hash lo que permite la ejecucion de scripts en la pagina. El problema fue solucionado en la vercion jQuery 1.6.3 o superior.
1666 Usuarios malociosos pueden inyectar JavaScript, VBScript, ActiveX, HTML o Flash en la aplicacion vulnerable, pudiendo asi engañar a un usuario para sacarle informacion sensible.",,"Update to the latest version of jQuery.
1667 More info: http://ma.la/jquery_xss/
1668 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
1669 ,ES-Host Header Attack,"Un atacante puede manipular el header Host y causar que la aplicacion se comporte de maneras inesperadas. Programadores aveces creen en el header host y programas el codigo basado en el: (_SERVER[""HTTP_HOST""] in PHP). Esto tambien se refleja en portales como joombla o wordpress donde los plugins y ejecucion de script, ejemplos:
1670
1671 <link href=""http://_SERVER['HOST']"" (Joomla)
1672
1673 ...haciendo un apend de keys secretas y tokens:
1674 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery y otros)
1675 ....e importante directamente scripts:
1676 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)",,"La aplicacion web deberia usar una variable ""SERVER_NAME"" en lugar de basarse en le Host header.",High,
1677 ,ES-Login Page password-guessing attack,"Un problema común con el que se encuentran los programadores web son los ataques de fuerza bruta de logins. Un ataque de fuerza bruta es un intento de adivinar la contraseña por sistemáticamente probar todas las posibles combinaciones de números, letras y símbolos hasta descubrir la convencional correcta. Este ataque se mejora utilizando diccionarios con palabras comunes y combinaciones de las mismas
1678
1679 Esta pagina de Login no tiene ninguna protección contra este ataque ya que se probaron 20 logins inválidos y el servidor no bloqueo el acceso para seguir intentando. Tampoco dispone de ninguna protección para evitar los intentos de login automáticos (como un captcha).",,"Es recomendable implementar algun tipo de bloqueo de intentos de login tras un numero de fallos en los intentos.
1680 Mas información:
1681 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
1682 ,ES-Error page web server version disclosure (Pagina de error mostrando version de servidor ),Pidiendo una pagina que no existe el servidor responde con un error. En esta pagina de error se encuentran datos que contienen version del servidor web y/o modulos activados en este. Dicha informacion puede ser usada para mejorar las tacticas del atacante sabiendo a que se enfrenta,,Se debe configurar paginas de error customizadas evitando mostrar esta informacion.,Low,
1683 ,ES-Weak SSL,"El servidor esta utiizando un cifrado SSL dèbil.
1684
1685 Weak SSL ciphers (SSL2 on port 443):
1686
1687 SSL2_CK_RC4_128_EXPORT40_WITH_MD5 - Low strength
1688 SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 - Low strength
1689 SSL2_CK_DES_64_CBC_WITH_MD5 - Low strength
1690
1691 Weak SSL ciphers (SSL3 on port 443):
1692
1693 SSL3_CK_RSA_RC4_40_MD5 - Low strength
1694 SSL3_CK_RSA_RC2_40_MD5 - Low strength
1695 SSL3_CK_RSA_DES_40_CBC_SHA - Low strength
1696 SSL3_CK_RSA_DES_64_CBC_SHA - Low strength
1697 SSL3_CK_EDH_RSA_DES_40_CBC_SHA - Low strength
1698 SSL3_CK_EDH_RSA_DES_64_CBC_SHA - Low strength
1699
1700 Weak SSL ciphers (TLS1 on port 443):
1701
1702 TLS1_CK_RSA_EXPORT_WITH_RC4_40_MD5 - Low strength
1703 TLS1_CK_RSA_EXPORT_WITH_RC2_CBC_40_MD5 - Low strength
1704 TLS1_CK_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
1705 TLS1_CK_RSA_WITH_DES_CBC_SHA - Low strength
1706 TLS1_CK_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
1707 TLS1_CK_DHE_RSA_WITH_DES_CBC_SHA - Low strength",,Reconfigurar el servidor para encriptado mas fuerte.,,
1708 ,ES-CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) es un exploit contra las cookies secretas del servidor sobre conexiones usando protocolos HTTPS y SPDY que tambien esten usando compresion de datos. Cuando se recupera el contenido de la cookie de autentificacion, permite a un atacante robar la sesion, permitiendo iniciar otros ataques.
1709
1710 CRIME es un ataque del lado cliente, pero el servidor puede proteger al cliente rechazando la combinacion de estas opciones. Para CRIME, la debilidad es la compresion Deflate.",,"CRIME puede ser combatido previniendo el uso de compresion, tanto del lado del cliente, desactivando la compresion de las peticiones HTTPS, o del lado del servidor previniendo el uso de compresion de datos en las transacciones que utilicen el protocolo TLS.
1711
1712 Referencias WEB.
1713 http://blogs.cisco.com/security/breach-crime-and-blackhat/
1714 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
1715 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",High,
1716 ,ES-Transaccion Insegura de HTTPS a HTTP en el form POST,La pagina segura (https) contiene un form que realiza el post sobre una pagina insegura (http). Esto puede confundir al usuario y hacerle creer que su datos son enviados encriptados cuando en realidad no.,,El destino del FORM debe apuntar a una pagina segura (https),,
1717 ,ES-Trace Method is Enabled (Metodo TRACE activado),"El metodo Trace esta habilitado en el servidor. En precencia de otras vulnerabilidades cross-domain en los navegadores web, informacion sensible del campo header puede ser leida desde cualquier dominio que soporte metodo HTTP TRACE.
1718
1719 Un atacante poria abusar de la funcionabilidad HTTP TRACE para ganar acceso a la informacion de los headers HTTP como las cookies y datos de autenticacion.",,"Se recomienda desactivar el metodo TRACE en el servidor web.
1720
1721 Referencias WEB:
1722 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
1723 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",Low,
1724 ,ES-Public Key SSL < 2048 bits (Certificado de llave Publica SSL menor de 2048 Bits),"El certificado SSL usado por el servidor contiene una llave publica de menos de 2048 bits de largo
1725
1726 Los nuevos estandares de de la Industria de Certificados para SSL (SSL Certificates Industry) seteados por Certification Authority/Browser (CA/B) Forum requiere que los certificados expedidos despues de enero 1 del 2014. Deben ser al menos de 2048-bit largo. Con el incremento del poder de procesamiento de las computadoras, cualquier certificado menor de 2048-bit es riesgoso de ser comprometido por personas mal intecionadas con poder de procesamiento.",,"Si se tiene cualquier certificado de 1024-bito certificados con menos de 2048-bit de largo, sera necesario que se migre a 2048-bit.
1727
1728 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
1729 ,ES-Ruby on Rails CookieStore session cookie persistence,"Ruby on Rails contiene un fallo en su diseño que podria permitir a atacantes facilitar el acceso a las aplicaciones. El problema esta en mecanicsmo de la CookieStore en guardar la cookie en el lado del cliente, mientras no guarda la entrada correspondiente en el lado del servidor. Cuando la aplicacion termina la sesion, Ruby on Rails no tiene manera de trackear esto y verdaderamente invalidad la cookie con la configuracion por defecto. Esto significa que persiste ""de por vida"" y puede ser usada para acceder a aplicaciones inclusive cuando se piensa que se termino la sesion.",,"Actualmente, no se conocen actualizaciones o parches para corregir esta vulnerabilidad. Si es posible migrar temporalmente implementando un sistema de autenticacion mas seguro (e.g. ActiveRecordStore).",,
1730 ,EN-Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
1731 ,EN-Session Cookie without Secure flag set,"This cookie does not have the Secure flag set. When a cookie is set with the Secure flag, it instructs the browser that the cookie can only be accessed over secure SSL channels. This is an important security protection for session cookies.",,"If possible, you should set the Secure flag for this cookie.",low,
1732 ,EN-Session Cookie without HttpOnly flag Set,"This cookie does not have the HTTPOnly flag set. When a cookie is set with the HTTPOnly flag, it instructs the browser that the cookie can only be accessed by the server and not by client-side scripts. This is an important security protection for session cookies.",,"If possible, you should set the HTTPOnly flag for this cookie.",Low,
1733 ,EN-Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
1734 Se ha detectado un problema en las versiones de apache 1.3.0, 2.0.x hasta 2.0.64 y 2.2.X hasta 2.2.19 que mediante una herramienta automatizada un atacante usand una moderada cantidad de request puede causar un uso significativo de memoria y CPU en el servidor. Datos: http://seclists.org/fulldisclosure/2011/Aug/175.",,Actualizar version de apache,,
1735 ,EN-Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
1736 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
1737 Disallow: /*AB/$
1738 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",,
1739 ,EN-Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
1740 ,EN-Credentials in Plain Text,La pagina de login viaja sobre texto plano,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
1741 ,EN-Unencrypted __VIEWSTATE parameter,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
1742 <machineKey validation=""3DES""/>",,
1743 ,EN-Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
1744
1745 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
1746 style=""border-width:0px;"" />
1747
1748 Siendo la respuesta THHvB
1749
1750 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
1751 ,EN-Application error message,"This page contains an error/warning message that may disclose sensitive information.The message can also contain the location of the file that produced the unhandled exception.
1752
1753 The error messages may disclose sensitive information. This information can be used to launch further attacks.",,Review the source code for this script. The application need to show generic errors.,,
1754 ,EN-Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1755 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,,
1756 ,EN-Input Password with Autocomplete Enable,"Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. If an attacker gain access to a computer its possible of get credentials back.",,"You should include the attribute Autocomplete OFF:
1757 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
1758 ,Backup FilesEN-,"Backup files can contain script sources, configuration files or other sensitive information that may help an malicious user to prepare more advanced attacks",,"Remove the file(s) if they are not required on your website. As an additional step, it is recommended to implement a security policy within your organization to disallow creation of backup files in directories accessible from the web.",,
1759 ,EN-Sesintive directory,"A possible sensitive directory has been found. This directory is not directly linked from the website.This check looks for common sensitive resources like backup directories, database dumps, administration pages, temporary directories. Each one of these directories could help an attacker to learn more about his target.",,,,
1760 ,EN-Slow HTTP Denial of Service Attack,"Slowloris and Slow HTTP POST DoS attacks rely on the fact that the HTTP protocol, by design, requires requests to be completely received by the server before they are processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. If the server keeps too many resources busy, this creates a denial of service.",,It's important to configure the timout values on the Webserver. Here is a link to a guide on how to prevent this kind of attack: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1761 ,EN-Clickjacking,"It might be possible for a web page controlled by an attacker to load the content of this response within an iframe on the attacker's page. This may enable a ""clickjacking"" attack, in which the attacker's page overlays the target application's interface with a different interface provided by the attacker. By inducing victim users to perform actions such as mouse clicks and keystrokes, the attacker can cause them to unwittingly carry out actions within the application that is being targeted. This technique allows the attacker to circumvent defenses against cross-site request forgery, and may result in unauthorized actions. Ref:http://javascript.info/tutorial/clickjacking",,"To effectively prevent framing attacks, the application should return a response header with the name X-Frame-Options and the value DENY to prevent framing altogether, or the value SAMEORIGIN to allow framing only by pages on the same origin as the response itself.",Low,
1762 ,EN-OPTIONS method is enabled,"HTTP OPTIONS method is enabled on this web server. The OPTIONS method provides a list of the methods that are supported by the web server, it represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
1763 The OPTIONS method may expose sensitive information that may help an malicious user to prepare more advanced attacks.",,It's recommended to disable OPTIONS Method on the web server.,Low,
1764 ,EN-TLS1/SSLv3 Renegotiation Vulnerability,"A vulnerability in the way SSL and TLS protocols allow renegotiation requests may allow an attacker to inject plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
1765 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
1766 ,EN-Email address found,One or more email addresses have been found on this page. The majority of spam comes from email addresses harvested off the internet. The spam-bots (also known as email harvesters and email extractors) are programs that scour the internet looking for email addresses on any website they come across. Spambot programs look for strings like [email protected] and then record any addresses found.,,,,
1767 ,EN-File Inclusion,It is possible for a remote attacker to include a file from local or remote resources and/or execute arbitrary script code with the privileges of the webserver.,,"Edit the source code to ensure that input is properly validated. Where is possible, it is recommended to make a list of accepted filenames and restrict the input to that list.
1768
1769 For PHP, the option allow_url_fopen would normally allow a programmer to open, include or otherwise use a remote file using a URL rather than a local file path. It is recommended to disable this option from php.ini.",,
1770 ,EN-User Credentials Sent in Clear Text,"Vulnerability description
1771 User credentials are transmitted over an unencrypted channel. This information should always be transferred via an encrypted channel (HTTPS) to avoid being intercepted by malicious users.
1772
1773 The impact of this vulnerability
1774 A third party may be able to read the user credentials by intercepting an unencrypted HTTP connection.",,"Because user credentials are considered sensitive information, should always be transferred to the server over an encrypted connection (HTTPS).",,
1775 ,EN-URL Redirection,"This script is possibly vulnerable to URL redirection attacks.
1776
1777 URL redirection is sometimes used as a part of phishing attacks that confuse visitors about which web site they are visiting.
1778
1779 The impact of this vulnerability
1780 A remote attacker can redirect users from your website to a specified URL. This problem may assist an attacker to conduct phishing attacks, trojan distribution, spammers.",,Your script should properly sanitize user input.,,
1781 ,EN-Microsoft IIS tilde directory enumeration,"It is possible to detect short names of files and directories which have an 8.3 file naming scheme equivalent in Windows by using some vectors in several versions of Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1782 ,EN-SQL Injection,"SQL injection is a vulnerability that allows an attacker to alter back-end SQL statements by manipulating the user input. An SQL injection occurs when web applications accept user input that is directly placed into a SQL statement and doesn't properly filter out dangerous characters.
1783
1784 This is one of the most common application layer attacks currently being used on the Internet. Despite the fact that it is relatively easy to protect against, there is a large number of web applications vulnerable.
1785
1786 An attacker may execute arbitrary SQL statements on the vulnerable system. This may compromise the integrity of your database and/or expose sensitive information.
1787
1788 Depending on the back-end database in use, SQL injection vulnerabilities lead to varying levels of data/system access for the attacker. It may be possible to not only manipulate existing queries, but to UNION in arbitrary data, use sub selects, or append additional queries. In some cases, it may be possible to read in or write out to files, or to execute shell commands on the underlying operating system.
1789
1790 Certain SQL Servers such as Microsoft SQL Server contain stored and extended procedures (database server functions). If an attacker can obtain access to these procedures it may be possible to compromise the entire machine.",,"Your script should filter metacharacters from user input.
1791 Check detailed information for more information about fixing this vulnerability.
1792 Detailed information",,
1793 ,EN-ASP.NET debugging enabled,"ASP.NET debugging is enabled on this application. It is recommended to disable debug mode before deploying a production application. By default, debugging is disabled, and although debugging is frequently enabled to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.",,"It may be possible to disclose sensitive information about the web sever the ASP.NET application.
1794 More information on how to fix it:
1795 http://support.microsoft.com/default.aspx?scid=kb;en-us;815157",,
1796 ,EN-Unicode tranformation Issues,"This page is vulnerable to various Unicode transformation issues such as Best-Fit Mappings, Overlong byte sequences, Ill-formed sequences.
1797 Best-Fit Mappings occurs when a character X gets transformed to an entirely different character Y. In general, best-fit mappings occur when characters are transcoded between Unicode and another encoding.
1798
1799 Overlong byte sequences (non-shortest form) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
1800 0xC0 0x8A
1801 0xE0 0x80 0x8A
1802 0xF0 0x80 0x80 0x8A
1803 0xF8 0x80 0x80 0x80 0x8A
1804 0xFC 0x80 0x80 0x80 0x80 0x8A
1805
1806 Ill-Formed Subsequences As REQUIRED by UNICODE 3.0, and noted in the Unicode Technical Report #36, if a leading byte is followed by an invalid successor byte, then it should NOT consume it.
1807
1808
1809 Software vulnerabilities arise when Best-Fit mappings occur. For example, characters can be manipulated to bypass string handling filters, such as cross-site scripting (XSS) or SQL Injection filters, WAF's, and IDS devices. Overlong UTF-8 sequence could be abused to bypass UTF-8 substring tests that look only for the shortest possible encoding.",,"Identiy the source of these Unicode transformation issues and fix them. Consult the web references bellow for more information.
1810 Links with more information:
1811 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
1812 http://www.cl.cam.ac.uk/~mgk25/unicode.html
1813 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
1814 http://www.unicode.org/reports/tr36/",,
1815 ,EN-File Upload XSS,"This script is possibly vulnerable to XSS (Cross-site scripting). The web application allows file upload and Acunetix WVS was able to upload a file containing HTML content. When HTML files are allowed, XSS payload can be injected in the file uploaded. Check Attack details for more information about this attack.
1816
1817 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Restrict file types accepted for upload: check the file extension and only allow certain files to be uploaded. Use a whitelist approach instead of a blacklist. Check for double extensions such as .php.png. Check for files without a filename like .htaccess (on ASP.NET, check for configuration files like web.config). Change the permissions on the upload folder so the files within it are not executable. If possible, rename the files that are uploaded.
1818
1819 https://www.owasp.org/index.php/Unrestricted_File_Upload
1820 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
1821 ,EN-Possible virtual host found,"Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name.
1822
1823 This web server is responding differently when the Host header is manipulated and various common virtual hosts are tested. This could indicate there is a Virtual Host present.",,Consult the virtual host configuration and check if this virtual host should be publicly accessible,,
1824 ,EN-Host header attack,"An attacker can manipulate the Host header as seen by the web application and cause the application to behave in unexpected ways.
1825 Developers often resort to the exceedingly untrustworthy HTTP Host header (_SERVER[""HTTP_HOST""] in PHP).
1826 Even otherwise-secure applications trust this value enough to write it to the page without HTML-encoding it with code equivalent to:
1827
1828 <link href=""http://_SERVER['HOST']"" (Joomla)
1829 ...and append secret keys and tokens to links containing it:
1830
1831 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery, others)
1832 ....and even directly import scripts from it:
1833
1834 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)
1835
1836 Host header *********evilhostDx5oMrAd.com was reflected inside a A tag (href attribute).",,"The web application should use the SERVER_NAME instead of the Host header. It should also create a dummy vhost that catches all requests with unrecognized Host headers. This can also be done under Nginx by specifying a non-wildcard SERVER_NAME, and under Apache by using a non-wildcard serverName and turning the UseCanonicalName directive on. Consult references for detailed information.",,
1837 ,EN-jQuery cross site scripting,"This page is using an older version of jQuery that is vulnerable to a Cross Site Scripting vulnerability. Many sites are using to select elements using location.hash that allows someone to inject script into the page. This problem was fixed in jQuery 1.6.3 and up.
1838 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Update to the latest version of jQuery.
1839 More info: http://ma.la/jquery_xss/
1840 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
1841 ,EN-Login Page password-guessing attack,"A common threat web developers face is a password-guessing attack known as a brute force attack. A brute-force attack is an attempt to discover a password by systematically trying every possible combination of letters, numbers, and symbols until you discover the one correct combination that works.
1842
1843 This login page doesn't have any protection against password-guessing attacks (brute force attacks). It's recommended to implement some type of account lockout after a defined number of incorrect password attempts. Consult Web references for more information about fixing this problem.
1844
1845 The scanner tested 10 invalid credentials and no account lockout was detected.",,"It's recommended to implement some type of account lockout after a defined number of incorrect password attempts.
1846 More info:
1847 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
1848 ,EN-Error page web server version disclosure,"By requesting a page that doesn't exist, an error page was returned. This error page contains the web server version number and a list of modules enabled on this server. This information can be used to conduct further attacks. Possible sensitive information disclosure.",,"If you are using Apache, you can setup a custom 404 page by following the instructions provided in the References section.",,
1849 ,EN-SSL weak ciphers,"The remote host supports the use of SSL ciphers that offer either weak encryption or no encryption at all.
1850 This vulnerability affects Server.",,Reconfigure the affected application to avoid use of weak ciphers.,,
1851 ,EN-CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) is a security exploit against secret web cookies over connections using the HTTPS and SPDY protocols that also use data compression. When used to recover the content of secret authentication cookies, it allows an attacker to perform session hijacking on an authenticated web session, allowing the launching of further attacks.
1852
1853 CRIME is a client-side attack, but the server can protect the client by refusing to use the feature combinations which can be attacked. For CRIME, the weakness is Deflate compression. This alert is issued if the server accepts Deflate compression.
1854
1855 An attacker can perform session hijacking on an authenticated web session, allowing the launching of further attacks.",,"CRIME can be defeated by preventing the use of compression, either at the client end, by the browser disabling the compression of HTTPS requests, or by the website preventing the use of data compression on such transactions using the protocol negotiation features of the TLS protocol. As detailed in The Transport Layer Security (TLS) Protocol Version 1.2, the client sends a list of compression algorithms in its ClientHello message, and the server picks one of them and sends it back in its ServerHello message. The server can only choose a compression method the client has offered, so if the client only offers 'none' (no compression), the data will not be compressed. Similarly, since 'no compression' must be allowed by all TLS clients, a server can always refuse to use compression.
1856
1857 Web references
1858 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
1859 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",,
1860 ,EN-Insecure transition from HTTPS to HTTP in form post,"This secure (https) page contains a form that is posting to an insecure (http) page. This could confuse users who may think their data is encrypted when in fact it's not.
1861 Impact: Possible information disclosure.",,The form target should point to a secure (https) page.,,
1862 ,EN-TRACE method is enabled,"HTTP TRACE method is enabled on this web server. In the presence of other cross-domain vulnerabilities in web browsers, sensitive header information could be read from any domains that support the HTTP TRACE method.
1863
1864 Attackers may abuse HTTP TRACE functionality to gain access to information in HTTP headers such as cookies and authentication data.",,"Disable TRACE Method on the web server.
1865
1866 Web references
1867 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
1868 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",,
1869 ,EN-SSL certificate public key less than 2048 bit,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,"If you have any 1024-bit certificates or certificates with less than 2048-bit key length, you will need to migrate to 2048-bit key length.
1870
1871 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
1872 ,EN-Ruby on Rails CookieStore session cookie persistence,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",,"Currently, there are no known upgrades or patches to correct this vulnerability. It is possible to temporarily mitigate the flaw by implementing the following workaround: switch to a more secure authentication management systems (e.g. ActiveRecordStore).",,
1873 ,EN-Remote Code Execution - ms_08_067 netapi,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,,High,
1874 ,EN-Windows Print Spooler Components Vulnerability - MS13-001,"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
1875 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,
1876 ,ES-Credenciales Repetidas,Existen multiples credeciales repetidas para un mismo acceso.,"Tener credenciales repetidas de un mismo servidor o acceso, posibilita a un atacante tener mayor impacto, pues utilizando un mismo password puede ingresar a distintos servicios o áreas",Evitar utilizar mismas credenciales en distintos servicios,High,
1877 ,ES-Ftp Anonimo,Es servicio de FTP posee el usuario : anonymous,"Los servidores FTP anónimos ofrecen sus servicios libremente a todos los usuarios, permiten acceder a sus archivos sin necesidad de tener un 'USER ID' o una cuenta de usuario. Es la manera más cómoda fuera del servicio web de permitir que todo el mundo tenga acceso a cierta información sin que para ello el administrador de un sistema tenga que crear una cuenta para cada usuario.
1878
1879 Si un servidor posee servicio 'FTP anonymous' solamente con teclear la palabra «anonymous», cuando pregunte por tu usuario tendrás acceso a ese sistema. No se necesita ninguna contraseña preestablecida, aunque tendrás que introducir una sólo para ese momento, normalmente se suele utilizar la dirección de correo electrónico propia.",Evitar usuario anonimo,Medium,
1880 ,ES-Credenciales débiles Tomcat,"Se detectaron credenciales por defecto en servidores Tomcat, ejecutándose con privilegios elevados.
1881 Un atacante que intente loguearse con una lista de usuarios por defecto podría comprometer el servicio.
1882 En este caso en particular el usuario “admin” es muy común en servidores Tomcat, y cuenta con privilegios para ejecutar código, por lo que debe ser protegido con una contraseña fuerte.",,Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.,High,
1883 ,ES-Wpad Spoofing,"En los ambientes Windows ante una falla a resolver un nombre de host,
1884 realizan una segunda búsqueda utilizando NetBios. La naturaleza de este
1885 pedido realizado utilizando broadcast es inseguro si no se tienen
1886 recaudos.
1887
1888 Un atacante podría utilizar esta vulnerabilidad para
1889 registrar el dominio WPAD en netbios con el fin de redirigir y modificar
1890 el tráfico de las workstations con las que comparte el segmento de red.
1891 Este ataque podría derivar en la captura de credenciales o hashes que
1892 le brinden acceso a sistemas críticos.",,"Deshabilitar la configuración automática de proxy en los equipos
1893 windows, y registrar el nombre de domino wpad, para que ningún equipo de
1894 la red pueda impersonarlo.",High,
1895 ,ES-Servicio de Telnet,"Las credenciales de usuario se transmiten sobre un canal sin cifrar (servicio telnet).
1896 Un atacante capaz de interceptar el tráfico entre los hosts y el usuario remoto, será capaz de obtener las credenciales utilizadas.",,"Reemplazar los servicios que permiten el envío de credenciales en texto plano, por aquellos que lo hacen de forma cifrada. En este caso, existen diferentes alternativas para reemplazar los servicios de administración remota, como por ejemplo ssh o rdp.",Medium,
1897 ,ES-Tokens cacheados,"Fue posible impersonar diferentes usuarios de dominio, incluido un administrador de dominio, a través de los tokens de acceso cacheados en el servidor.",,"No existe un parche para resolver este tipo de situaciones, ya que los tokens de acceso son propios de la arquitectura de Windows. Sin embargo es posible implementar algunas medidas a nivel operativo para mitigar en gran parte el impacto del cacheo de tokens. Recomendamos:
1898 > Asegurarse que usuarios con altos privilegios (especialmente administradores) tengan una cuenta específica para tareas de administración y otra para loguearse en sus sistemas.
1899 > Ejecutar aquellas tareas que requieran mayores privilegios utilizando la aplicación “RunAs”.
1900 > Asegurarse que los Domain Admins sólo sean utilizados para administrar el dominio. Crear diferentes cuentas de dominio y asignarle autorización administrativa solo para la unidad de negocio correspondiente.
1901 > Asegurarse que las cuentas administrativas de ambientes de desarrollo y test sean diferentes a las de los sistemas críticos de producción.
1902 > Ejecutar los servicios necesarios para el correcto funcionamiento de la unidad de negocio en un equipo diferente al Controlador de Dominio.
1903 > Utilizar la opción de Active Directory “Account is sensitive and cannot be delegated” (sólo aplica a los logueos interactivos, pero ayuda a reforzar la seguridad de la cuenta).
1904
1905 Referencias:
1906 http://carnal0wnage.attackresearch.com/2008/05/token-passing-with-incognito-part-2.html
1907 http://pentestmonkey.net/uncategorized/from-local-admin-to-domain-admin
1908 http://www.offensive-security.com/metasploit-unleashed/Fun_With_Incognito",High,
1909 ,ES-Denegacion de Servicios(DOS),"un ataque de denegación de servicios, también llamado ataque DoS (de las siglas en inglés Denial of Service) o DDoS (de Distributed Denial of Service), es un ataque a un sistema de computadoras o red que causa que un servicio o recurso sea inaccesible a los usuarios legítimos. Normalmente provoca la pérdida de la conectividad de la red por el consumo del ancho de banda de la red de la víctima o sobrecarga de los recursos computacionales del sistema de la víctima",,La forma de prevenirlo: https://www.owasp.org/index.php/Denial_of_Service,High,
1910 ,ES-Revelacion de Informacion (Information Disclosure),Se puede obtener una información sensible del usuario. Esto podría ayudar a un atacante a tener control de una base de datos ó permitirle escalar hacia otro vector de ataque.,,"Determinar si esta información debería ser accesible desde la red, sin estar protegida por credenciales.",Medium,
1911 ,ES-Sitio sin Informar,,,/reclamaciones/home/index. ,,
1912 ,ES-Listado de Directorios,Muestra directorios que no deberian ser publicos,,Evitar que dichos directorios sean publicos,Medium,
1913 ,ES-Shell,"Una shell es parte de codigo programado en (PHP,Python,Ruby,etc) que una vez que es subido al host victima, puede ser utilizado para subir, bajar, borrar archivos.",,"Evitar entradas que posibiliten subir imagenes o codigo al servidor, sin ser adecuadamente controlado",,
1914 ,ES-Path Disclosure,Permite ver la ruta a archivos u aplicaciones que no deberian ser mostradas,,"Puede solucionarse desactivando los mensajes de error :
1915 En PHP modificando el archivo php.ini ( display_errors = 'off' )
1916 En Apache modificando el archivo httpd.conf ( php_flag display_errors off)",,
1917 ,ES-File Upload,Es posible subir código o imagenes sin ser fitradas adecuadamente.,,Evitar campos para subir archivos que no sean correctamente filtrados,,
1918 ,ES-Metodo Put habilitado (Put File Allow),"Sube, carga o realiza un upload de un recurso especificado (archivo), es el camino más eficiente para subir archivos a un servidor.",,"Evitar que el metodo PUT se encuentre con libre acceso a cualquier tipo de usuario, restringir acceso.",,
1919 ,ES-Leer Archivos (Read files),,,,,
1920 ,ES-Usuarios por defecto(default users),"Se debe evitar utilizar usuarios y contraseñas por defecto, pues el sistema puede quedar suseptible a un ataque de fuerza bruta o de diccionario.",,Cambiar usuarios y contraseñas de acuerdo a las politicas de la empresa,,
1921 ,ES-Sslstrip Attack,"Dado que la página no esta utilizando https para proteger sus credenciales, el panel de ingreso esta implementedo mediante http, y no https, es posible modificar los recursos obtenidos, si el atacante logra intereceptar la comunicación entre ambos sitios. ",,"Cargar todos los recursos a través de https, para los recursos externos recomendamos incluir los mismo de la siguiente manera src=""//dominio.com/recurso.js"" de esta manera el navegador automaticamete incluye el protocolo http o https segun la conexion inicial que genera.",High,
1922 ,ES-Enumerar Usuarios,,,,Medium,
1923 ,ES-Login User HTTP,"Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Utilizar HTTPS para autenticar usuarios,Medium,
1924 ,ES-Falta de Control de Acceso,Se puede acceder a parte del sitio sin una sesion valida,,Validar correctamente la sesiones del sitio verifiquen que el usuario poseen una sesion valida,Medium,
1925 ,ES-Cookie Reutilization,La cookie puede ser modificada y reutilizada para hacer nuevas consultas o impersonar usuarios,,Evitar ,Medium,
1926 ,ES-Credenciales Debiles md5,"Se detecto que dentro del request se envía el nombre de usuario y la contraseña hasheada. Si bien la contraseña utiliza una funcion de md5, lo hace sin salt para protegerla.
1927 Con lo cual un atacante que la intercepte, puede decifrar el md5 para luego obtener la contraseña en texto plano junto con el usuario para acceder al sistema.",,"Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.
1928 Se recomienda un cifrado mas robusto con la funcion salt",High,
1929 ,ES-CSRF,"Un ataque CSRF fuerza al navegador web validado de una víctima a enviar una petición a una aplicación web vulnerable, la cual entonces realiza la acción elegida a través de la víctima. Al contrario que en los ataques XSS, los cuales explotan la confianza que un usuario tiene en un sitio en particular, el cross site request forgery explota la confianza que un sitio tiene en un usuario en particular.",,"Recomendamos la imprementacion de un feature anti-csrf con el fin de autenticar todoslos request,en particual aquellas peticiones sensibles como por ejemplo el cambiode contraseñas y asignacion de roles (dar permisos de administrador a un usuario). El framework de ASP.net cuenta con este feature llamado viewstate (https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Viewstate_.28ASP.NET.29)",Medium,
1930 ,ES-SSL weak ciphers (Cifrado debil),El servidor remoto soporta el uso de SSL pero ofrece una encriptacion debil,,Reconfigurar el servidor web con un nivel de encriptacion mayor,Medium,
1931 ,EN-Android Debugging Activated,The Application has enabled Debugging in it's manifiest. This feature allows an attacker to debug native code and sensitive information could be retrived using this vector,,Set to false debuging features in production releases,,
1932 ,EN-Flash Crossdomain policy,The application publishes a Flash cross-domain policy which allows access from any domain.,,The policy must include the domains which are allowed by the Flash cross-domain policy,Medium,
1933 ,EN-Session Token in URL,The Session token is included in the URL. This could leak the session token,,Session tokens should only be included using safe channels,Medium,
1934 ,ES-Token de Session en URL,"Información sensible dentro de las URLs puede ser guardado en distintas lugares, por ejemplo en la información del navegador del usuario, en el webserver, o en cualquier proxy o reverse proxy. Las URLs se pueden ver en las pantallas, puede ser guardadas como favoritos o pueden ser enviada entre los usuarios. Esta información puede ser obtenida también como referer, en el histórico de la ultima pagina desde donde se ingresa a otra pagina. Guardar la sesiones en las URLs incrementa que esa información sea captura por un atacante para luego impersonarse como un usuario valido.",,La aplicación debería utilizar otros mecanismos para el envió de las sessiones como cookies o campos ocultos enviados a traves de métodos de POST ,Medium,
1935 ,ES-Autenticacion sin HTTPS,"La aplicación web no utiliza HTTPS para la autenticación de usuarios al sistema. Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Siempre utilizar HTTPS para autenticar usuarios,High,
1936 ,Es-Version Obsoleta / Desactualizada,"El servidor se encuentra utilizando una versión de Apache Tomcat MUY desactualizada (Apache Tomcat/4.1.31), la cual es vulnerable a multiples vulnerabilidades publicas. Actualmente la ultima versión estable es la 8.0.9 ",,"Recomendación actualizar y desactivar los mensajes de error del servidor, que puedan brindar información extra a un atacante",Medium,
1937 ,ES-Numero de Tarjeta en Texto Plano,"La respuesta del servidor, contiene el numero de tarjeta de crédito y otra información sensible que debería evitarse enviar en texto plano.",,Utilizar HTTPS en todo el sitio en donde la información sensible pueda ser expuesta.,High,
1938 ,ES-Server Version Discloure,El servidor web responde con la version del sistema facilitando a un atacante saber contra que se enfrenta,,"Filtrar en las respuestas del servidor, cualquier dato que demuestre la version del servidor y del sistema operativo del mismo",Low,
1939 ,EN-Insecure crossdomain.xml file,"The browser security model normally prevents web content from one domain from accessing data from another domain. This is commonly known as the ""same origin policy"". URL policy files grant cross-domain permissions for reading data. They permit operations that are not permitted by default. The URL policy file is located, by default, in the root directory of the target server, with the name crossdomain.xml (for example, at www.example.com/crossdomain.xml).
1940
1941 When a domain is specified in crossdomain.xml file, the site declares that it is willing to allow the operators of any servers in that domain to obtain any document on the server where the policy file resides. The crossdomain.xml file deployed on this website opens the server to all domains (use of a single asterisk ""*"" as a pure wildcard is supported) like so:
1942 <cross-domain-policy>
1943 <allow-access-from domain=""*"" />
1944 </cross-domain-policy>
1945 This practice is suitable for public servers, but should not be used for sites located behind a firewall because it could permit access to protected areas. It should not be used for sites that require authentication in the form of passwords or cookies. Sites that use the common practice of authentication based on cookies to access private or user-specific data should be especially careful when using cross-domain policy files.
1946
1947 Using an insecure cross-domain policy file could expose your site to various attacks.",,"Carefully evaluate which sites will be allowed to make cross-domain calls. Consider network topology and any authentication mechanisms that will be affected by the configuration or implementation of the cross-domain policy.
1948 ",Medium,
1949 ,ES-Archivo crossdomain.xml inseguro,"El modelo de seguridad del navegador normalmente previene el contenido web de ser accedido desde otro dominio. Esto comunmente es conocido como ""same origin policy"" (""politica del mismo origen""). Lo politica de archivos URL garantiza acceso cross-dominio para leer datos. Permiten operaciones que no son permitidas por defecto. La politica de acceso de archivo URL esta localizado, por defecto, en el directorio raiz del servidor destino, con el nombre crossdomain.xml (por ejemplo en www.ejemplo.com/crossdomain.xml).
1950
1951 Cuando un dominio es especificado en el archivo crossdomain.xml, el sitio declara que esta dispuesto a dar acceso a operadores de cualqueir server en ese dominio para obtener cualquier documento donde la regla reside. El archivo crossdomain.xml desplegado en este servidor web abre el servidor a todos los dominios (uso de un unico asterisco ""*"" de comodin es soportado) Como por ejemplo:
1952 <cross-domain-policy>
1953 <allow-access-from domain=""*"" />
1954 </cross-domain-policy>
1955
1956 Esta practica es correcta para servidores publicos, pero no deberia ser usada en servidores que se encuentran tras un firewall porque puede permitir acceso a areas protejidas. No deberia ser usada para sitios que requieren autenticacion en forma de contraseñas o cookies. ",,"Detenidamente evaluar que sitios deben tener permitido el acceso cross-dominio. Considerar la topologia de red y todos los mecanismos de autenticacion afectados por la configuracion o implementacion de la politica cross-domain.
1957 ",Medium,
1958 ,EN-BREACH attack,"This web application is potentially vulnerable to the BREACH attack.
1959 An attacker with the ability to:
1960 Inject partial chosen plaintext into a victim's requests
1961 Measure the size of encrypted traffic
1962 can leverage information leaked by compression to recover targeted parts of the plaintext.
1963
1964 BREACH (Browser Reconnaissance & Exfiltration via Adaptive Compression of Hypertext) is a category of vulnerabilities and not a specific instance affecting a specific piece of software. To be vulnerable, a web application must:
1965
1966 Be served from a server that uses HTTP-level compression
1967 Reflect user-input in HTTP response bodies
1968 Reflect a secret (such as a CSRF token) in HTTP response bodies
1969
1970
1971 This alert was issued because the following conditions were met:
1972 The page content is served via HTTPS
1973 The server is using HTTP-level compression
1974 URL encoded GET input next was reflected into the HTTP response body.
1975 HTTP response body contains a secret named csrfmiddlewaretoken",,"The mitigations are ordered by effectiveness (not by their practicality - as this may differ from one application to another).
1976
1977 Disabling HTTP compression
1978 Separating secrets from user input
1979 Randomizing secrets per request
1980 Masking secrets (effectively randomizing by XORing with a random secret per request)
1981 Protecting vulnerable pages with CSRF
1982 Length hiding (by adding random number of bytes to the responses)
1983 Rate-limiting the requests
1984
1985 More information http://breachattack.com/",,
1986 ,ES-Archivos de backup en servidor de producción,"La aplicación web tiene multiples archivos de buckup disponibles para ser descargados, los cuales brindan información de la tecnología que se utiliza en el sitio, así como código fuente de las aplicaciones, nombres de usuarios, rutas de acceso y multiple información sensible del mismo.",,"Es recomendable aplicar buenas politicas deprotección de información sensible, evitando exponer buckups y otra información del sitio web",Very High,
1987 ,ES-Exposición de información a través del listado de directorios,"Estos directorios no deberian estar publicos, pues exponen información sensible del tipo de tecnología utilizada, código de programación, información sobre rutas de acceso a distintos lugares, particularmente en este caso podemos listar toda la información del servidor sin ningun tipo de restricción",,Siempre evitar que se puedan listar directorios de manera externa y sin permisos,High,
1988 ,ES-Archivos con información sensible,"Es posible acceder a archivos con información sensible, podemos ver el ""log error"" y dentro de este rutas de acceso, nombres de usuario, etc . Con lo cual un atacante con tiempo podría intentar obtener credeciales de un servicio ssh, ftp,o similar para luego crackearlo.
1989 ",,Evitar exponer toda información sensible del sistema,High,
1990 ,ES-Revelación de IP interno,"La aplicación expone ip/s interno, con lo cual si por algun vector de ataque un atacante logra acceder al servidor o servicio podría continuar la explotación por dicho vector",,Evitar exponer toda información sensible y privada del sistemadel sistema,Low,
1991 ,ES-Archivos e información de desarollo en ambientes productivos,"Podemos ver código de programacion, con ejemplos concretos del funcionamiento interno y
1992 de la lógica utilizada a la hora de programar, dejando en evidencia
1993 informacion como nombres de usuarios, email, dni, telefonos, etc ",,Evitar exponer toda información sensible y privada del sistemadel sistema,High,
1994 ,ES-Sentencias SQL sin Prepared Statement,Se detecto que se utilizan una mala implementacion de sentencias SQL concatenando las variables manualmente pudiendo un atacante realizar ataques de SQL Injection,,"Utilizar para la sentencia de SQL Prepared Statement
1995 Reference:
1996 https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet#Prepared_Statement_Examples",High,
1997 ,ES-Mysql lectura y escritura de archivos,Es posible utilizar mysql server para la lectura y escritura de archivos en el servidor,,"Seguir los siguientes lineamientos para el hardening de Mysql Server
1998 https://www.owasp.org/index.php/Testing_for_MySQL#Read_from_a_File",High,
1999 ,ES-Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
2000 ,ES-Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
2001 ,EN-Internal IP Address Disclosure,A string matching an internal IPv4 address was found on this page. This may disclose information about the IP addressing scheme of the internal network. This information can be used to conduct further attacks.,,Prevent this information from being displayed to the user,Low,
2002 ,ES-Internal IP Address Disclosure,Una cadena coincidente con una direccion interna de IPv4 fue encontrada en esta pagina. Esto lleva a divulgar informacion sensible acerca del esquema de la red interna. Esta informacion puede ser usada para generar ataques especificos.,,Se recomienda prevenir que esta informacion sea mostrada al usuario,Low,
2003 ,EN-ASP.NET MAC disabled,"By default, the serialized value is signed by the server to prevent tampering by the user; however, this behavior can be disabled by setting the Page.EnableViewStateMac property to false. If this is done, then an attacker can modify the contents of the ViewState and cause arbitrary data to be deserialized and processed by the server. If the ViewState contains any items that are critical to the server's processing of the request, then this may result in a security exposure.",,Set the Page.EnableViewStateMac property to true on any pages where the ViewState is not currently signed.,Low,
2004 ,ES-Cisco ASA Error,"El Cisco ASA es vulnerable a un Information Leak (CVE-2014-3392), un atacante podria obtener credenciales em base a un error.",,Actualizar a la ultima version del firmware del CISCO ASA,High,
2005 ,ES-Listado de directorios,"Evitar listar directorios, muchas veces a partir de aqui se pueden realizar distintos vectores de ataques, por claves almacenadas en archivos ocultos o por tener acceso a archivos de configuracion. ",,"Evitar listar directorios, es recomendable que se desabiliten o se resguarden con algun tipo de autenticacion.",Low,
2006 ,EN-Cifrado Debil (SSL weak ciphers),"El host remoto es compatible con el uso de sistemas de cifrado SSL que ofrecen ya sea cifrado debil o sin cifrado en absoluto.
2007 Esta vulnerabilidad afecta Server.",,Vuelva a configurar la aplicacion afectada para evitar el uso de cifrados debiles.,Medium,
0 cwe,name,desc_summary,description,resolution,exploitation,references
1 CWE-119,Improper Restriction of Operations within the Bounds of a Memory Buffer (Type: Class),"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
2 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127; Chapter 14, ""Prevent I18N Buffer Overruns"" Page 441
3 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
4 Safe C String Library v1.0.3: http://www.zork.org/safestr/
5 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
6 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
7 PaX: http://en.wikipedia.org/wiki/PaX
8 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
9 The Art of Software Security Assessment: Chapter 5, ""Memory Corruption"", Page 167.
10 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
11 CWE-123,Write-what-where Condition (Type: Base),"Any condition where the attacker has the ability to write an arbitrary value to an arbitrary location, often as the result of a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
12 CWE-129,Improper Validation of Array Index (Type: Base),"The product uses untrusted input when calculating or using an array index, but the product does not validate or incorrectly validates the index to ensure the index references a valid position within the array.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,High,"Writing Secure Code: Chapter 5, ""Array Indexing Errors"" Page 144
13 Top 25 Series - Rank 14 - Improper Validation of Array Index: http://blogs.sans.org/appsecstreetfighter/2010/03/12/top-25-series-rank-14-improper-validation-of-array-index/
14 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
15 PaX: http://en.wikipedia.org/wiki/PaX
16 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
17 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
18 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
19 CWE-194,Unexpected Sign Extension (Type: Base),"The software performs an operation on a number that causes it to be sign extended when it is transformed into a larger data type. When the original number is negative, this can produce unexpected values that lead to resultant weaknesses.",This can happen in signed and unsigned cases.,,High,"C Language Issues for Application Security: http://www.informit.com/articles/article.aspx?p=686170&seqNum=6
20 Integral Security: http://www.ddj.com/security/193501774"
21 CWE-20,Improper Input Validation (Type: Class),The product does not validate or incorrectly validates input that can affect the control flow or data flow of a program.,"When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution.",,High,"Input Validation with ESAPI - Very Important: http://manicode.blogspot.com/2008/08/input-validation-with-esapi.html
22 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
23 Hacking Exposed Web Applications, Second Edition: Input Validation Attacks
24 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
25 The importance of input validation: http://searchsoftwarequality.techtarget.com/tip/0,289483,sid92_gci1214373,00.html
26 Writing Secure Code: Chapter 10, ""All Input Is Evil!"" Page 341"
27 CWE-200,Information Exposure (Type: Class),An information exposure is the intentional or unintentional disclosure of information to an actor that is not explicitly authorized to have access to that information.,"The information either
28 is regarded as sensitive within the product's own functionality, such as a private message; or
29 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
30 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,High,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
31 CWE-209,Information Exposure Through an Error Message (Type: Base),"The software generates an error message that includes sensitive information about its environment, users, or associated data.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,High,"Information Leakage: http://www.webappsec.org/projects/threat/classes/information_leakage.shtml
32 Secure Programming with Static Analysis: Section 9.2, page 326.
33 Writing Secure Code: Chapter 16, ""General Good Practices."" Page 415
34 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
35 24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
36 Top 25 Series - Rank 16 - Information Exposure Through an Error Message: http://software-security.sans.org/blog/2010/03/17/top-25-series-rank-16-information-exposure-through-an-error-message
37 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
38 CWE-234,Failure to Handle Missing Parameter (Type: Variant),"If too few arguments are sent to a function, the function will still pop the expected number of arguments from the stack. Potentially, a variable number of arguments could be exhausted in a function as well.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,High,
39 CWE-242,Use of Inherently Dangerous Function (Type: Base),The program calls a function that can never be guaranteed to work safely.,"Certain functions behave in dangerous ways regardless of how they are used. Functions in this category were often implemented without taking security concerns into account. The gets() function is unsafe because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to gets() and overflow the destination buffer. Similarly, the >> operator is unsafe to use when reading into a statically-allocated character array because it does not perform bounds checking on the size of its input. An attacker can easily send arbitrarily-sized input to the >> operator and overflow the destination buffer.",,High,"Herb Schildt's C++ Programming Cookbook: Chapter 5. Working with I/O
40 Writing Secure Code: Chapter 5, ""gets and fgets"" Page 163"
41 CWE-243,Creation of chroot Jail Without Changing Working Directory (Type: Variant),"The program uses the chroot() system call to create a jail, but does not change the working directory afterward. This does not prevent access to files outside of the jail.","Improper use of chroot() may allow attackers to escape from the chroot jail. The chroot() function call does not change the process's current working directory, so relative paths may still refer to file system resources outside of the chroot jail after chroot() has been called.",,High,
42 CWE-268,Privilege Chaining (Type: Base),"Two distinct privileges, roles, capabilities, or rights can be combined in a way that allows an entity to perform unsafe actions that would not be allowed without that combination.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,High,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
43 CWE-271,Privilege Dropping / Lowering Errors (Type: Class),The software does not drop privileges before passing control of a resource to an actor that does not have those privileges.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,High,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
44 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
45 CWE-285,Improper Authorization (Type: Class),The software does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
46 When access control checks are not applied consistently - or not at all - users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
47 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
48 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
49 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
50 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
51 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39.
52 The Art of Software Security Assessment: Chapter 11, ""ACL Inheritance"", Page 649."
53 CWE-291,Reliance on IP Address for Authentication (Type: Variant),The software uses an IP address for authentication.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
54 CWE-292,DEPRECATED (Duplicate): Trusting Self-reported DNS Name (Type: Variant),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,
55 CWE-293,Using Referer Field for Authentication (Type: Variant),"The referer field in HTTP requests can be easily modified and, as such, is not a valid means of message integrity checking.","IP addresses can be easily spoofed. Attackers can forge the source IP address of the packets they send, but response packets will return to the forged IP address. To see the response packets, the attacker has to sniff the traffic between the victim machine and the forged IP address. In order to accomplish the required sniffing, attackers typically attempt to locate themselves on the same subnet as the victim machine. Attackers may be able to circumvent this requirement by using source routing, but source routing is disabled across much of the Internet today. In summary, IP address verification can be a useful part of an authentication scheme, but it should not be the single factor required for authentication.",,High,"The Art of Software Security Assessment: Chapter 17, ""Referer Request Header"", Page 1030."
56 CWE-294,Authentication Bypass by Capture-replay (Type: Base),A capture-replay flaw exists when the design of the software makes it possible for a malicious user to sniff network traffic and bypass authentication by replaying it to the server in question to the same effect as the original message (or with minor changes).,"Capture-replay attacks are common and can be difficult to defeat without cryptography. They are a subset of network injection attacks that rely on observing previously-sent valid commands, then changing them slightly if necessary and resending the same commands to the server.",,High,
57 CWE-297,Improper Validation of Certificate with Host Mismatch (Type: Variant),"The software communicates with a host that provides a certificate, but the software does not properly ensure that the certificate is actually associated with that host.","Even if a certificate is well-formed, signed, and follows the chain of trust, it may simply be a valid certificate for a different site than the site that the software is interacting with. If the certificate's host-specific data is not properly checked - such as the Common Name (CN) in the Subject or the Subject Alternative Name (SAN) extension of an X.509 certificate - it may be possible for a redirection or spoofing attack to allow a malicious host with a valid certificate to provide data, impersonating a trusted host. In order to ensure data integrity, the certificate must be valid and it must pertain to the site that is being accessed.
58 Even if the software attempts to check the hostname, it is still possible to incorrectly check the hostname. For example, attackers could create a certificate with a name that begins with a trusted name followed by a NUL byte, which could cause some string-based comparisons to only examine the portion that contains the trusted name.",,High,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
59 Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
60 Secure programming with the OpenSSL API, Part 2: Secure handshake: http://www.ibm.com/developerworks/library/l-openssl2/index.html
61 An Introduction to OpenSSL Programming (Part I): http://www.rtfm.com/openssl-examples/part1.pdf
62 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
63 CWE-308,Use of Single-factor Authentication (Type: Base),The use of single-factor authentication can lead to unnecessary risk of compromise when compared with the benefits of a dual-factor authentication scheme.,"While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,High,
64 CWE-321,Use of Hard-coded Cryptographic Key (Type: Base),The use of a hard-coded cryptographic key significantly increases the possibility that encrypted data may be recovered.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
65 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,High,
66 CWE-322,Key Exchange without Entity Authentication (Type: Base),The software performs a key exchange with an actor without verifying the identity of that actor.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347
67 The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
68 CWE-323,"Reusing a Nonce, Key Pair in Encryption (Type: Base)",Nonces should be used for the present occasion and only once.,"Performing a key exchange will preserve the integrity of the information sent between two entities, but this will not guarantee that the entities are who they claim they are. This may enable a set of ""man-in-the-middle"" attacks. Typically, this involves a victim client that contacts a malicious server that is impersonating a trusted server. If the client skips authentication or ignores an authentication failure, the malicious server may request authentication information from the user. The malicious server can then use this authentication information to log in to the trusted server using the victim's credentials, sniff traffic between the victim and trusted server, etc.",,High,
69 CWE-360,Trust of System Event Data (Type: Base),Security based on event locations are insecure and can be spoofed.,"Events are a messaging system which may provide control data to programs listening for events. Events often do not have any type of authentication framework to allow them to be verified from a trusted source. Any application, in Windows, on a given desktop can send a message to any window on the same desktop. There is no authentication framework for these messages. Therefore, any message can be used to manipulate any process on the desktop if the process does not check the validity and safeness of those messages.",,High,
70 CWE-378,Creation of Temporary File With Insecure Permissions (Type: Base),"Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,High,
71 CWE-416,Use After Free (Type: Base),"Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
72 Error conditions and other exceptional circumstances.
73 Confusion over which part of the program is responsible for freeing the memory.
74 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
75 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,High,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
76 CWE-457,Use of Uninitialized Variable (Type: Variant),"The code uses a variable that has not been initialized, leading to unpredictable or unintended results.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,High,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
77 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
78 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
79 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
80 CWE-467,Use of sizeof() on a Pointer Type (Type: Variant),"The code calls sizeof() on a malloced pointer type, which always returns the wordsize/8. This can produce an unexpected result if the programmer intended to determine how much memory has been allocated.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High,EXP01-A. Do not take the sizeof a pointer to determine the size of a type: https://www.securecoding.cert.org/confluence/display/seccode/EXP01-A.+Do+not+take+the+sizeof+a+pointer+to+determine+the+size+of+a+type
81 CWE-486,Comparison of Classes by Name (Type: Variant),"The program compares classes by name, which can cause it to use the wrong class when multiple classes can have the same name.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,High,
82 CWE-493,Critical Public Variable Without Final Modifier (Type: Variant),"The product has a critical public variable that is not final, which allows the variable to be modified to contain unexpected values.","If a field is non-final and public, it can be changed once the value is set by any function that has access to the class which contains the field. This could lead to a vulnerability if other parts of the program make assumptions about the contents of that field.",,High,
83 CWE-499,Serializable Class Containing Sensitive Data (Type: Variant),"The code contains a class with sensitive data, but the class does not explicitly deny serialization. The data can be accessed by serializing the class through another class.","Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,High,
84 CWE-500,Public Static Field Not Marked Final (Type: Variant),"An object contains a public static field that is not marked final, which might allow it to be modified in unexpected ways.",Public static variables can be read without an accessor and changed without a mutator by any classes in the application.,,High,
85 CWE-515,Covert Storage Channel (Type: Base),A covert storage channel transfers information through the setting of bits by one program and the reading of those bits by another. What distinguishes this case from that of ordinary operation is that the bits are used to convey encoded information.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,High,
86 CWE-639,Authorization Bypass Through User-Controlled Key (Type: Base),The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.,"Retrieval of a user record occurs in the system based on some key value that is under user control. The key would typically identify a user related record stored in the system and would be used to lookup that record for presentation to the user. It is likely that an attacker would have to be an authenticated user in the system. However, the authorization process would not properly check the data access operation to ensure that the authenticated user performing the operation has sufficient entitlements to perform the requested data access, hence bypassing any other authorization checks present in the system. One manifestation of this weakness would be if a system used sequential or otherwise easily guessable session ids that would allow one user to easily switch to another user's session and read/modify their data.",,High,
87 CWE-640,Weak Password Recovery Mechanism for Forgotten Password (Type: Base),"The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.","It is common for an application to have a mechanism that provides a means for a user to gain access to their account in the event they forget their password. Very often the password recovery mechanism is weak, which has the effect of making it more likely that it would be possible for a person other than the legitimate system user to gain access to that user's account.
88 This weakness may be that the security question is too easy to guess or find an answer to (e.g. because it is too common). Or there might be an implementation weakness in the password recovery mechanism code that may for instance trick the system into e-mailing the new password to an e-mail account other than that of the user. There might be no throttling done on the rate of password resets so that a legitimate user can be denied service by an attacker if an attacker tries to recover their password in a rapid succession. The system may send the original password to the user rather than generating a new temporary password. In summary, password recovery functionality, if not carefully designed and implemented can often become the system's weakest link that can be misused in a way that would allow an attacker to gain unauthorized access to the system. Weak password recovery schemes completely undermine a strong password authentication scheme.",,High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
89 CWE-642,External Control of Critical State Data (Type: Class),"The software stores security-critical state information about its users, or the software itself, in a location that is accessible to unauthorized actors.","If an attacker can modify the state information without detection, then it could be used to perform unauthorized actions or access unexpected resources, since the application programmer does not expect that the state can be changed.
90 State information can be stored in various locations such as a cookie, in a hidden web form field, input parameter or argument, an environment variable, a database record, within a settings file, etc. All of these locations have the potential to be modified by an attacker. When this state information is used to control security or determine resource usage, then it may create a vulnerability. For example, an application may perform authentication, then save the state in an ""authenticated=true"" cookie. An attacker may simply create this cookie in order to bypass the authentication.",,High,"Top 10 2007-Insecure Direct Object Reference: http://www.owasp.org/index.php/Top_10_2007-A4
91 HMAC: http://en.wikipedia.org/wiki/Hmac
92 24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75"
93 CWE-643,Improper Neutralization of Data within XPath Expressions (XPath Injection) (Type: Base),"The software uses external input to dynamically construct an XPath expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,"XPath Injection: http://www.webappsec.org/projects/threat/classes/xpath_injection.shtml
94 The Art of Software Security Assessment: Chapter 17, ""XPath Injection"", Page 1070."
95 CWE-644,Improper Neutralization of HTTP Headers for Scripting Syntax (Type: Variant),"The application does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.","An attacker may be able to conduct cross-site scripting and other attacks against users who have these components enabled.
96 If an application does not neutralize user controlled data being placed in the header of an HTTP response coming from the server, the header may contain a script that will get executed in the client's browser context, potentially resulting in a cross site scripting vulnerability or possibly an HTTP response splitting attack. It is important to carefully control data that is being placed both in HTTP response header and in the HTTP response body to ensure that no scripting syntax is present, taking various encodings into account.",,High,
97 CWE-645,Overly Restrictive Account Lockout Mechanism (Type: Base),"The software contains an account lockout protection mechanism, but the mechanism is too restrictive and can be triggered too easily. This allows attackers to deny service to legitimate users by causing their accounts to be locked out.","Account lockout is a security feature often present in applications as a countermeasure to the brute force attack on the password based authentication mechanism of the system. After a certain number of failed login attempts, the users' account may be disabled for a certain period of time or until it is unlocked by an administrator. Other security events may also possibly trigger account lockout. However, an attacker may use this very security feature to deny service to legitimate system users. It is therefore important to ensure that the account lockout security mechanism is not overly restrictive.",,High,
98 CWE-646,Reliance on File Name or Extension of Externally-Supplied File (Type: Variant),"The software allows a file to be uploaded, but it relies on the file name or extension of the file to determine the appropriate behaviors. This could be used by attackers to cause the file to be misclassified and processed in a dangerous fashion.","An application might use the file name or extension of of a user-supplied file to determine the proper course of action, such as selecting the correct process to which control should be passed, deciding what data should be made available, or what resources should be allocated. If the attacker can cause the code to misclassify the supplied file, then the wrong action could occur. For example, an attacker could supply a file that ends in a "".php.gif"" extension that appears to be a GIF image, but would be processed as PHP code. In extreme cases, code execution is possible, but the attacker could also cause exhaustion of resources, denial of service, exposure of debug or system data (including application source code), or being bound to a particular server side process. This weakness may be due to a vulnerability in any of the technologies used by the web and application servers, due to misconfiguration, or resultant from another flaw in the application itself.",,High,
99 CWE-647,Use of Non-Canonical URL Paths for Authorization Decisions (Type: Variant),The software defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.,"If an application defines policy namespaces and makes authorization decisions based on the URL, but it does not require or convert to a canonical URL before making the authorization decision, then it opens the application to attack. For example, if the application only wants to allow access to http://www.example.com/mypage, then the attacker might be able to bypass this restriction using equivalent URLs such as:
100 http://WWW.EXAMPLE.COM/mypage
101 http://www.example.com/%6Dypage (alternate encoding)
102 http://192.168.1.1/mypage (IP address)
103 http://www.example.com/mypage/ (trailing /)
104 http://www.example.com:80/mypage
105 Therefore it is important to specify access control policy that is based on the path information in some canonical form with all alternate encodings rejected (which can be accomplished by a default deny rule).",,High,
106 CWE-649,Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking (Type: Base),"The software uses obfuscation or encryption of inputs that should not be mutable by an external actor, but the software does not use integrity checks to detect if those inputs have been modified.","When an application relies on obfuscation or incorrectly applied / weak encryption to protect client-controllable tokens or parameters, that may have an effect on the user state, system state, or some decision made on the server. Without protecting the tokens/parameters for integrity, the application is vulnerable to an attack where an adversary blindly traverses the space of possible values of the said token/parameter in order to attempt to gain an advantage. The goal of the attacker is to find another admissible value that will somehow elevate his or her privileges in the system, disclose information or change the behavior of the system in some way beneficial to the attacker. If the application does not protect these critical tokens/parameters for integrity, it will not be able to determine that these values have been tampered with. Measures that are used to protect data for confidentiality should not be relied upon to provide the integrity service.",,High,
107 CWE-650,Trusting HTTP Permission Methods on the Server Side (Type: Variant),"The server contains a protection mechanism that assumes that any URI that is accessed using HTTP GET will not cause a state change to the associated resource. This might allow attackers to bypass intended access restrictions and conduct resource modification and deletion attacks, since some applications allow GET to modify state.","An application may disallow the HTTP requests to perform DELETE, PUT and POST operations on the resource representation, believing that it will be enough to prevent unintended resource alterations. Even though the HTTP GET specification requires that GET requests should not have side effects, there is nothing in the HTTP protocol itself that prevents the HTTP GET method from performing more than just query of the data. For instance, it is a common practice with REST based Web Services to have HTTP GET requests modifying resources on the server side. Whenever that happens however, the access control needs to be properly enforced in the application. No assumptions should be made that only HTTP DELETE, PUT, and POST methods have the power to alter the representation of the resource being accessed in the request.",,High,
108 CWE-652,Improper Neutralization of Data within XQuery Expressions (XQuery Injection) (Type: Base),"The software uses external input to dynamically construct an XQuery expression used to retrieve data from an XML database, but it does not neutralize or incorrectly neutralizes that input. This allows an attacker to control the structure of the query.","The net effect is that the attacker will have control over the information selected from the XML database and may use that ability to control application flow, modify logic, retrieve unauthorized data, or bypass important checks (e.g. authentication).",,High,
109 CWE-676,Use of Potentially Dangerous Function (Type: Base),"The program invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,High,"Security Development Lifecycle (SDL) Banned Function Calls: http://msdn.microsoft.com/en-us/library/bb288454.aspx
110 Writing Secure Code: Chapter 5, ""Safe String Handling"" Page 156, 160
111 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
112 CWE-682,Incorrect Calculation (Type: Class),The software performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management..,"When software performs a security-critical calculation incorrectly, it might lead to incorrect resource allocations, incorrect privilege assignments, or failed comparisons among other things. Many of the direct results of an incorrect calculation can lead to even larger problems such as failed protection mechanisms or even arbitrary code execution.",,High,"SafeInt: http://safeint.codeplex.com/
113 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
114 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
115 CWE-78,Improper Neutralization of Special Elements used in an OS Command (OS Command Injection) (Type: Base),"The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component..","This could allow attackers to execute unexpected, dangerous commands directly on the operating system. This weakness can lead to a vulnerability in environments in which the attacker does not have direct access to the operating system, such as in web applications. Alternately, if the weakness occurs in a privileged program, it could allow the attacker to specify commands that normally would not be accessible, or to call alternate commands with privileges that the attacker does not have. The problem is exacerbated if the compromised process does not follow the principle of least privilege, because the attacker-controlled commands may run with special system privileges that increases the amount of damage.
116 There are at least two subtypes of OS command injection:
117 The application intends to execute a single, fixed program that is under its own control. It intends to use externally-supplied inputs as arguments to that program. For example, the program might use system(""nslookup [HOSTNAME]"") to run nslookup and allow the user to supply a HOSTNAME, which is used as an argument. Attackers cannot prevent nslookup from executing. However, if the program does not remove command separators from the HOSTNAME argument, attackers could place the separators into the arguments, which allows them to execute their own program after nslookup has finished executing.
118 The application accepts an input that it uses to fully select which program to run, as well as which commands to use. The application simply redirects this entire command to the operating system. For example, the program might use ""exec([COMMAND])"" to execute the [COMMAND] that was supplied by the user. If the COMMAND is under attacker control, then the attacker can execute arbitrary commands or programs. If the command is being executed using functions like exec() and CreateProcess(), the attacker might not be able to combine multiple commands together in the same line.
119 From a weakness standpoint, these variants represent distinct programmer errors. In the first variant, the programmer clearly intends that input from untrusted parties will be part of the arguments in the command to be executed. In the second variant, the programmer does not intend for the command to be accessible to any untrusted party, but the programmer probably has not accounted for alternate ways in which malicious attackers can provide input.",,High,"Exploiting Software: How to Break Code
120 Meta-Character Vulnerabilities: http://www.cs.purdue.edu/homes/cs390s/slides/week09.pdf
121 OS Commanding: http://projects.webappsec.org/OS-Commanding
122 The World Wide Web Security FAQ: http://www.w3.org/Security/Faq/wwwsf4.html
123 Security Issues in Perl Scripts: http://www.cgisecurity.com/lib/sips.html
124 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171
125 Top 25 Series - Rank 9 - OS Command Injection: http://blogs.sans.org/appsecstreetfighter/2010/02/24/top-25-series-rank-9-os-command-injection/
126 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
127 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
128 The Art of Software Security Assessment: Chapter 8, ""Shell Metacharacters"", Page 425."
129 CWE-784,Reliance on Cookies without Validation and Integrity Checking in a Security Decision (Type: Variant),"The application uses a protection mechanism that relies on the existence or values of a cookie, but it does not properly ensure that the cookie is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Attackers can bypass protection mechanisms such as authorization and authentication by modifying the cookie to contain an expected value.",,High,"Unforgivable Vulnerabilities: http://cve.mitre.org/docs/docs-2007/unforgivable.pdf
130 Writing Secure Code: Chapter 13, ""Sensitive Data in Cookies and Fields"" Page 435"
131 CWE-862,Missing Authorization (Type: Class),The software does not perform an authorization check when an actor attempts to access a resource or perform an action.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
132 When access control checks are not applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
133 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
134 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
135 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
136 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
137 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
138 CWE-863,Incorrect Authorization (Type: Class),"The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
139 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,High,"Role Based Access Control and Role Based Security: http://csrc.nist.gov/groups/SNS/rbac/
140 Writing Secure Code: Chapter 4, ""Authorization"" Page 114; Chapter 6, ""Determining Appropriate Access Control"" Page 171
141 Top 25 Series - Rank 5 - Improper Access Control (Authorization): http://blogs.sans.org/appsecstreetfighter/2010/03/04/top-25-series-rank-5-improper-access-control-authorization/
142 Authentication using JAAS: http://www.javaranch.com/journal/2008/04/authentication-using-JAAS.html
143 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
144 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authorization"", Page 39."
145 CWE-99,Improper Control of Resource Identifiers (Resource Injection) (Type: Base),"The software receives input from an upstream component, but it does not restrict or incorrectly restricts the input before it is used as an identifier for a resource that may be outside the intended sphere of control.",This may enable an attacker to access or modify otherwise protected system resources.,,High,
146 CWE-120,Buffer Copy without Checking Size of Input (Classic Buffer Overflow) (Type: Base),"The program copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer, leading to a buffer overflow.","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Public Enemy #1: The Buffer Overrun"" Page 127
147 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
148 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
149 Safe C String Library v1.0.3: http://www.zork.org/safestr/
150 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
151 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
152 PaX: http://en.wikipedia.org/wiki/PaX
153 Top 25 Series - Rank 3 - Classic Buffer Overflow: http://software-security.sans.org/blog/2010/03/02/top-25-series-rank-3-classic-buffer-overflow/
154 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
155 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
156 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
157 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189.
158 The Art of Software Security Assessment: Chapter 8, ""C String Handling"", Page 388."
159 CWE-122,Heap-based Buffer Overflow (Type: Variant),"A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,High to Very High,"Writing Secure Code: Chapter 5, ""Heap Overruns"" Page 138
160 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
161 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
162 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
163 CWE-131,Incorrect Calculation of Buffer Size (Type: Base),"The software does not correctly calculate the size to be used when allocating a buffer, which could lead to a buffer overflow.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,High to Very High,"SafeInt: http://safeint.codeplex.com/
164 Top 25 Series - Rank 18 - Incorrect Calculation of Buffer Size: http://software-security.sans.org/blog/2010/03/19/top-25-series-rank-18-incorrect-calculation-of-buffer-size
165 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
166 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
167 PaX: http://en.wikipedia.org/wiki/PaX
168 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
169 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
170 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
171 The Art of Software Security Assessment: Chapter 8, ""Incrementing Pointers Incorrectly"", Page 401."
172 CWE-22,Improper Limitation of a Pathname to a Restricted Directory (Path Traversal) (Type: Class),"The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
173 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,High to Very High,"Writing Secure Code: Chapter 11, ""Directory Traversal and Using Parent Paths (..)"" Page 370
174 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
175 Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
176 Top 25 Series - Rank 7 - Path Traversal: http://blogs.sans.org/appsecstreetfighter/2010/03/09/top-25-series-rank-7-path-traversal/
177 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
178 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
179 CWE-311,Missing Encryption of Sensitive Data (Type: Base),The software does not encrypt sensitive or critical information before storage or transmission.,"The lack of proper data encryption passes up the guarantees of confidentiality, integrity, and accountability that properly implemented encryption conveys.",,High to Very High,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
180 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253
181 Top 25 Series - Rank 10 - Missing Encryption of Sensitive Data: http://blogs.sans.org/appsecstreetfighter/2010/02/26/top-25-series-rank-10-missing-encryption-of-sensitive-data/
182 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
183 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf"
184 CWE-464,Addition of Data Structure Sentinel (Type: Base),The accidental addition of a data-structure sentinel can cause serious programming logic problems.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,High to Very High,
185 CWE-67,Improper Handling of Windows Device Names (Type: Variant),"The software constructs pathnames from user input, but it does not handle or incorrectly handles a pathname containing a Windows device name such as AUX or CON. This typically leads to denial of service or an information exposure when the application attempts to process the pathname as a regular file.","Not properly handling virtual filenames (e.g. AUX, CON, PRN, COM1, LPT1) can result in different types of vulnerabilities. In some cases an attacker can request a device via injection of a virtual filename in a URL, which may cause an error that leads to a denial of service or an error page that reveals sensitive information. A software system that allows device names to bypass filtering runs the risk of an attacker injecting malicious code in a file with the name of a device.",,High to Very High,"Writing Secure Code
186 The Art of Software Security Assessment: Chapter 11, ""Device Files"", Page 666."
187 CWE-73,External Control of File Name or Path (Type: Class),The software allows user input to control or influence paths or file names that are used in filesystem operations.,"This could allow an attacker to access or modify system files or other files that are critical to the application.
188 Path manipulation errors occur when the following two conditions are met:
189 1. An attacker can specify a path used in an operation on the filesystem.
190 2. By specifying the resource, the attacker gains a capability that would not otherwise be permitted.
191 For example, the program may give the attacker the ability to overwrite the specified file or run with a configuration controlled by the attacker.",,High to Very High,OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
192 CWE-76,Improper Neutralization of Equivalent Special Elements (Type: Base),"The software properly neutralizes certain special elements, but it improperly neutralizes equivalent special elements.","The software may have a fixed list of special characters it believes is complete. However, there may be alternate encodings, or representations that also have the same meaning. For example, the software may filter out a leading slash (/) to prevent absolute path names, but does not account for a tilde (~) followed by a user name, which on some *nix systems could be expanded to an absolute pathname. Alternately, the software might filter a dangerous ""-e"" command-line switch when calling an external program, but it might not account for ""--exec"" or other switches that have the same semantics.",,High to Very High,
193 CWE-79,Improper Neutralization of Input During Web Page Generation (Cross-site Scripting) (Type: Base),The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.,"Cross-site scripting (XSS) vulnerabilities occur when:
194 1. Untrusted data enters a web application, typically from a web request.
195 2. The web application dynamically generates a web page that contains this untrusted data.
196 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
197 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
198 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
199 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
200 There are three main kinds of XSS:
201 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
202 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
203 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
204 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
205 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,High to Very High,"XSS Attacks
206 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31
207 24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63
208 Cross-site scripting: http://en.wikipedia.org/wiki/Cross-site_scripting
209 Writing Secure Code: Chapter 13, ""Web-Specific Input Issues"" Page 413
210 XSS (Cross Site Scripting) Cheat Sheet: http://ha.ckers.org/xss.html
211 Mitigating Cross-site Scripting With HTTP-only Cookies: http://msdn.microsoft.com/en-us/library/ms533046.aspx
212 Anti-XSS 3.0 Beta and CAT.NET Community Technology Preview now Live!: http://blogs.msdn.com/cisg/archive/2008/12/15/anti-xss-3-0-beta-and-cat-net-community-technology-preview-now-live.aspx
213 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
214 XSS Defense HOWTO: http://blog.modsecurity.org/2008/07/do-you-know-how.html
215 Web Application Firewall: http://www.owasp.org/index.php/Web_Application_Firewall
216 Web Application Firewall Evaluation Criteria: http://www.webappsec.org/projects/wafec/v1/wasc-wafec-v1.0.html
217 Firefox Implements httpOnly And is Vulnerable to XMLHTTPRequest
218 XMLHttpRequest allows reading HTTPOnly cookies: https://bugzilla.mozilla.org/show_bug.cgi?id=380418
219 Apache Wicket: http://wicket.apache.org/
220 XSS (Cross Site Scripting) Prevention Cheat Sheet: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet
221 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
222 Top 25 series - Rank 1 - Cross Site Scripting: http://blogs.sans.org/appsecstreetfighter/2010/02/22/top-25-series-rank-1-cross-site-scripting/
223 The Art of Software Security Assessment: Chapter 17, ""Cross Site Scripting"", Page 1071."
224 CWE-80,Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as ""<"", "">"", and ""&"" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.","This may allow such characters to be treated as control characters, which are executed client-side in the context of the user's session. Although this can be classified as an injection problem, the more pertinent issue is the improper conversion of such special characters to respective context-appropriate entities before displaying them to the user.",,High to Very High,
225 CWE-98,Improper Control of Filename for Include/Require Statement in PHP Program (PHP Remote File Inclusion) (Type: Base),"The PHP application receives input from an upstream component, but it does not restrict or incorrectly restricts the input before its usage in ""require,"" ""include,"" or similar functions.","In certain versions and configurations of PHP, this can allow an attacker to specify a URL to a remote location from which the software will obtain the code to execute. In other cases in association with path traversal, the attacker can specify a local file that may contain executable statements that can be parsed by PHP.",,High to Very High,"Testing for Path Traversal (OWASP-AZ-001): http://www.owasp.org/index.php/Testing_for_Path_Traversal_(OWASP-AZ-001)
226 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
227 A Study in Scarlet: http://www.cgisecurity.com/lib/studyinscarlet.txt
228 Suhosin: http://www.hardened-php.net/suhosin/
229 Top 25 Series - Rank 13 - PHP File Inclusion: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-13-php-file-inclusion/"
230 CWE-188,Reliance on Data/Memory Layout (Type: Base),"The software makes invalid assumptions about how protocol data or memory is organized at a lower level, resulting in unintended program behavior.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Structure Padding"", Page 284."
231 CWE-197,Numeric Truncation Error (Type: Base),Truncation errors occur when a primitive is cast to a primitive of a smaller size and data is lost in the conversion.,"When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Truncation"", Page 259."
232 CWE-252,Unchecked Return Value (Type: Base),"The software does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341.
233 Writing Secure Code: Chapter 20, ""Checking Returns"" Page 624
234 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
235 ERR10-CPP. Check for error conditions: https://www.securecoding.cert.org/confluence/display/cplusplus/ERR10-CPP.+Check+for+error+conditions"
236 CWE-253,Incorrect Check of Function Return Value (Type: Base),"The software incorrectly checks a return value from a function, which prevents the software from detecting errors or exceptional conditions.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Low,"The Art of Software Security Assessment: Chapter 7, ""Return Value Testing and Interpretation"", Page 340."
237 CWE-296,Improper Following of a Certificates Chain of Trust (Type: Base),"The software does not follow, or incorrectly follows, the chain of trust for a certificate back to a trusted root certificate, resulting in incorrect trust of any resource that is associated with that certificate.","If a system does not follow the chain of trust of a certificate to a root server, the certificate loses all usefulness as a metric of trust. Essentially, the trust gained from a certificate is derived from a chain of trust -- with a reputable trusted entity at the end of that list. The end user must trust that reputable source, and this reputable source must vouch for the resource in question through the medium of the certificate.
238 In some cases, this trust traverses several entities who vouch for one another. The entity trusted by the end user is at one end of this trust chain, while the certificate-wielding resource is at the other end of the chain. If the user receives a certificate at the end of one of these trust chains and then proceeds to check only that the first link in the chain, no real trust has been derived, since the entire chain must be traversed back to a trusted source to verify the certificate.
239 There are several ways in which the chain of trust might be broken, including but not limited to:
240 Any certificate in the chain is self-signed, unless it the root.
241 Not every intermediate certificate is checked, starting from the original certificate all the way up to the root certificate.
242 An intermediate, CA-signed certificate does not have the expected Basic Constraints or other important extensions.
243 The root certificate has been compromised or authorized to the wrong party.",,Low,"The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software: http://www.cs.utexas.edu/~shmat/shmat_ccs12.pdf
244 24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
245 CWE-298,Improper Validation of Certificate Expiration (Type: Variant),"A certificate expiration is not validated or is incorrectly validated, so trust may be assigned to certificates that have been abandoned due to age.","When the expiration of a certificate is not taken into account, no trust has necessarily been conveyed through it. Therefore, the validity of the certificate cannot be verified and all benefit of the certificate is lost.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
246 CWE-324,Use of a Key Past its Expiration Date (Type: Base),"The product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key.","While the expiration of keys does not necessarily ensure that they are compromised, it is a significant concern that keys which remain in use for prolonged periods of time have a decreasing probability of integrity. For this reason, it is important to replace keys within a period of time proportional to their strength.",,Low,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
247 CWE-379,Creation of Temporary File in Directory with Incorrect Permissions (Type: Base),The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Low,"The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538."
248 CWE-462,Duplicate Key in Associative List (Alist) (Type: Base),Duplicate keys in associative lists can lead to non-unique keys being mistaken for an error.,"A duplicate key entry -- if the alist is designed properly -- could be used as a constant time replace function. However, duplicate key entries could be inserted by mistake. Because of this ambiguity, duplicate key entries in an association list are not recommended and should not be allowed.",,Low,
249 CWE-479,Signal Handler Use of a Non-reentrant Function (Type: Variant),The program defines a signal handler that calls a non-reentrant function.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
250 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
251 CWE-480,Use of Incorrect Operator (Type: Base),"The programmer accidentally uses the wrong operator, which changes the application logic in security-relevant ways.","Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
252 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
253 CWE-481,Assigning instead of Comparing (Type: Variant),The code uses an operator for assignment when the intention was to perform a comparison.,"In many languages the compare statement is very close in appearance to the assignment statement and are often confused. This bug is generally the result of a typo and usually causes obvious problems with program execution. If the comparison is in an if statement, the if statement will usually evaluate the value of the right-hand side of the predicate.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
254 CWE-482,Comparing instead of Assigning (Type: Variant),The code uses an operator for comparison when the intention was to perform an assignment.,"In many languages, the compare statement is very close in appearance to the assignment statement; they are often confused.",,Low,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
255 CWE-483,Incorrect Block Delimitation (Type: Variant),"The code does not explicitly delimit a block that is intended to contain 2 or more statements, creating a logic error.","In some languages, braces (or other delimiters) are optional for blocks. When the delimiter is omitted, it is possible to insert a logic error in which a statement is thought to be in a block but is not. In some cases, the logic error can have security implications.",,Low,
256 CWE-641,Improper Restriction of Names for Files and Other Resources (Type: Base),"The application constructs the name of a file or other resource using input from an upstream component, but does not restrict or incorrectly restricts the resulting name.","This may produce resultant weaknesses. For instance, if the names of these resources contain scripting characters, it is possible that a script may get executed in the client's browser if the application ever displays the name of the resource on a dynamically generated web page. Alternately, if the resources are consumed by some application parser, a specially crafted name can exploit some vulnerability internal to the parser, potentially resulting in execution of arbitrary code on the server machine. The problems will vary based on the context of usage of such malformed resource names and whether vulnerabilities are present in or assumptions are made by the targeted technology that would make code execution possible.",,Low,
257 CWE-648,Incorrect Use of Privileged APIs (Type: Base),The application does not conform to the API requirements for a function call that requires extra privileges. This could allow attackers to gain privileges by causing the function to be called incorrectly.,"When an application contains certain functions that perform operations requiring an elevated level of privilege, the caller of a privileged API must be careful to:
258 ensure that assumptions made by the APIs are valid, such as validity of arguments
259 account for known weaknesses in the design/implementation of the API
260 call the API from a safe context
261 If the caller of the API does not follow these requirements, then it may allow a malicious user or process to elevate their privilege, hijack the process, or steal sensitive data.
262 For instance, it is important to know if privileged APIs do not shed their privileges before returning to the caller or if the privileged function might make certain assumptions about the data, context or state information passed to it by the caller. It is important to always know when and how privileged APIs can be called in order to ensure that their elevated level of privilege cannot be exploited.",,Low,
263 CWE-762,Mismatched Memory Management Routines (Type: Variant),"The application attempts to return a memory resource to the system, but it calls a release function that is not compatible with the function that was originally used to allocate that resource.","This weakness can be generally described as mismatching memory management routines, such as:
264 The memory was allocated on the stack (automatically), but it was deallocated using the memory management routine free() (CWE-590), which is intended for explicitly allocated heap memory.
265 The memory was allocated explicitly using one set of memory management functions, and deallocated using a different set. For example, memory might be allocated with malloc() in C++ instead of the new operator, and then deallocated with the delete operator.
266 When the memory management functions are mismatched, the consequences may be as severe as code execution, memory corruption, or program crash. Consequences and ease of exploit will vary depending on the implementation of the routines and the object being managed.",,Low,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
267 Valgrind: http://valgrind.org/"
268 CWE-783,Operator Precedence Logic Error (Type: Variant),The program uses an expression in which operator precedence causes incorrect logic to be used.,"While often just a bug, operator precedence logic errors can have serious consequences if they are used in security-critical code, such as making an authentication decision.",,Low,"EXP00-C. Use parentheses for precedence of operation: https://www.securecoding.cert.org/confluence/display/seccode/EXP00-C.+Use+parentheses+for+precedence+of+operation
269 The Art of Software Security Assessment: Chapter 6, ""Precedence"", Page 287."
270 CWE-789,Uncontrolled Memory Allocation (Type: Variant),"The product allocates memory based on an untrusted size value, but it does not validate or incorrectly validates the size, allowing arbitrary amounts of memory to be allocated.","This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Low,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
271 CWE-333,Improper Handling of Insufficient Entropy in TRNG (Type: Variant),True random number generators (TRNG) generally have a limited source of entropy and therefore can fail or block.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Low to Medium,
272 CWE-367,Time-of-check Time-of-use (TOCTOU) Race Condition (Type: Base),"The software checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. This can cause the software to perform invalid actions when the resource is in an unexpected state.","This weakness can be security-relevant when an attacker can influence the state of the resource between check and use. This can happen with shared resources such as files, memory, or even variables in multithreaded programs.",,Low to Medium,"Portably Solving File TOCTTOU Races with Hardness Amplification: http://www.usenix.org/events/fast08/tech/tsafrir.html
273 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
274 The Art of Software Security Assessment: Chapter 9, ""TOCTOU"", Page 527."
275 CWE-404,Improper Resource Shutdown or Release (Type: Base),The program does not release or incorrectly releases a resource before it is made available for re-use.,"When a resource is created or allocated, the developer is responsible for properly releasing the resource as well as accounting for all potential paths of expiration or invalidation, such as a set period of time or revocation.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
276 CWE-407,Algorithmic Complexity (Type: Base),"An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Low to Medium,Algorithmic Complexity Attacks: http://www.cs.rice.edu/~scrosby/hash/CrosbyWallach_UsenixSec2003/index.html
277 CWE-415,Double Free (Type: Variant),"The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.","When a program calls free() twice with the same argument, the program's memory management data structures become corrupted. This corruption can cause the program to crash or, in some circumstances, cause two later calls to malloc() to return the same pointer. If malloc() returns the same value twice and the program later gives the attacker control over the data that is written into this doubly-allocated memory, the program becomes vulnerable to a buffer overflow attack.",,Low to Medium,"24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143
278 The Art of Software Security Assessment: Chapter 7, ""Double Frees"", Page 379."
279 CWE-59,Improper Link Resolution Before File Access (Link Following) (Type: Base),"The software attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.","Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Low to Medium,"The Art of Software Security Assessment: Chapter 9, ""Symbolic Link Attacks"", Page 518."
280 CWE-601,URL Redirection to Untrusted Site (Open Redirect) (Type: Variant),"A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.","An http parameter may contain a URL value and could cause the web application to redirect the request to the specified URL. By modifying the URL value to a malicious site, an attacker may successfully launch a phishing scam and steal user credentials. Because the server name in the modified link is identical to the original site, phishing attempts have a more trustworthy appearance.",,Low to Medium,"Exploitable Redirects on the Web: Identification, Prevalence, and Defense: http://www.cs.indiana.edu/cgi-pub/cshue/research/woot08.pdf
281 Open redirect vulnerabilities: definition and prevention: http://www.net-security.org/dl/insecure/INSECURE-Mag-17.pdf
282 Top 25 Series - Rank 23 - Open Redirect: http://software-security.sans.org/blog/2010/03/25/top-25-series-rank-23-open-redirect
283 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
284 CWE-749,Exposed Dangerous Method or Function (Type: Base),"The software provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.","This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
285 The exposure can occur in a few different ways:
286 1) The function/method was never intended to be exposed to outside actors.
287 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Low to Medium,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
288 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp"
289 CWE-755,Improper Handling of Exceptional Conditions (Type: Class),The software does not handle or incorrectly handles an exceptional condition.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
290 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Low to Medium,
291 CWE-766,Critical Variable Declared Public (Type: Variant),The software declares a critical variable or field to be public when intended security policy requires it to be private.,"When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Low to Medium,
292 CWE-767,Access to Critical Private Variable via Public Method (Type: Variant),The software defines a public method that reads or modifies a private variable.,"If an attacker modifies the variable to contain unexpected values, this could violate assumptions from other parts of the code. Additionally, if an attacker can read the private variable, it may expose sensitive information or make it easier to launch further attacks.",,Low to Medium,
293 CWE-776,Improper Restriction of Recursive Entity References in DTDs (XML Entity Expansion) (Type: Variant),"The software uses XML documents and allows their structure to be defined with a Document Type Definition (DTD), but it does not properly control the number of recursive definitions of entities.","If the DTD contains a large number of nested or recursive entities, this can lead to explosive growth of data when parsed, causing a denial of service.",,Low to Medium,"Multiple vendors XML parser (and SOAP/WebServices server) Denial of Service attack using DTD: http://www.securityfocus.com/archive/1/303509
294 XML security: Preventing XML bombs: http://searchsoftwarequality.techtarget.com/expert/KnowledgebaseAnswer/0,289625,sid92_gci1168442,00.html?asrc=SS_CLA_302%20%20558&psrc=CLT_92#
295 Dismantling an XML-Bomb: http://blog.didierstevens.com/2008/09/23/dismantling-an-xml-bomb/
296 XML Entity Expansion: http://projects.webappsec.org/XML-Entity-Expansion
297 Tip: Configure SAX parsers for secure processing: http://www.ibm.com/developerworks/xml/library/x-tipcfsx.html
298 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
299 Preventing Entity Expansion Attacks in JAXB: http://blog.bdoughan.com/2011/03/preventing-entity-expansion-attacks-in.html"
300 CWE-777,Regular Expression without Anchors (Type: Variant),"The software uses a regular expression to perform neutralization, but the regular expression is not anchored and may allow malicious or malformed data to slip through.","When performing tasks such as whitelist validation, data is examined and possibly modified to ensure that it is well-formed and adheres to a list of safe values. If the regular expression is not anchored, malicious or malformed data may be included before or after any string matching the regular expression. The type of malicious data that is allowed will depend on the context of the application and which anchors are omitted from the regular expression.",,Low to Medium,
301 CWE-779,Logging of Excessive Data (Type: Base),"The software logs too much information, making log files hard to process and possibly hindering recovery efforts or forensic analysis after an attack.","While logging is a good practice in general, and very high levels of logging are appropriate for debugging stages of development, too much logging in a production environment might hinder a system administrator's ability to detect anomalous conditions. This can provide cover for an attacker while attempting to penetrate a system, clutter the audit trail for forensic analysis, or make it more difficult to debug problems in a production environment.",,Low to Medium,
302 CWE-781,Improper Address Validation in IOCTL with METHOD_NEITHER I/O Control Code (Type: Variant),"The software defines an IOCTL that uses METHOD_NEITHER for I/O, but it does not validate or incorrectly validates the addresses that are provided.","When an IOCTL uses the METHOD_NEITHER option for I/O control, it is the responsibility of the IOCTL to validate the addresses that have been supplied to it. If validation is missing or incorrect, attackers can supply arbitrary memory addresses, leading to code execution or a denial of service.",,Low to Medium,"Exploiting Common Flaws in Drivers: http://reversemode.com/index.php?option=com_content&task=view&id=38&Itemid=1
303 Remote and Local Exploitation of Network Drivers: https://www.blackhat.com/presentations/bh-usa-07/Bulygin/Presentation/bh-usa-07-bulygin.pdf
304 Windows driver vulnerabilities: the METHOD_NEITHER odyssey: http://www.net-security.org/dl/insecure/INSECURE-Mag-18.pdf
305 Buffer Descriptions for I/O Control Codes: http://msdn.microsoft.com/en-us/library/ms795857.aspx
306 Using Neither Buffered Nor Direct I/O: http://msdn.microsoft.com/en-us/library/cc264614.aspx
307 Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
308 No description: http://www.piotrbania.com/all/articles/ewdd.pdf"
309 CWE-782,Exposed IOCTL with Insufficient Access Control (Type: Variant),"The software implements an IOCTL with functionality that should be restricted, but it does not properly enforce access control for the IOCTL.","When an IOCTL contains privileged functionality and is exposed unnecessarily, attackers may be able to access this functionality by invoking the IOCTL. Even if the functionality is benign, if the programmer has assumed that the IOCTL would only be accessed by a trusted process, there may be little or no validation of the incoming data, exposing weaknesses that would never be reachable if the attacker cannot call the IOCTL directly.
310 The implementations of IOCTLs will differ between operating system types and versions, so the methods of attack and prevention may vary widely.",,Low to Medium,Securing Device Objects: http://msdn.microsoft.com/en-us/library/ms794722.aspx
311 CWE-117,Improper Output Neutralization for Logs (Type: Base),The software does not neutralize or incorrectly neutralizes output that is written to logs.,"This can allow an attacker to forge log entries or inject malicious content into logs.
312 Log forging vulnerabilities occur when:
313 Data enters an application from an untrusted source.
314 The data is written to an application or system log file.",,Medium,"Exploiting Software: How to Break Code
315 The night the log was forged: http://doc.novsu.ac.ru/oreilly/tcpip/puis/ch10_05.htm
316 OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007"
317 CWE-124,Buffer Underwrite (Buffer Underflow) (Type: Base),The software writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Medium,"Buffer UNDERFLOWS: What do you know about it?: http://seclists.org/vuln-dev/2004/Jan/0022.html
318 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
319 CWE-128,Wrap-around Error (Type: Base),"Wrap around errors occur whenever a value is incremented past the maximum value for its type and therefore ""wraps around"" to a very small, negative, or undefined value.","This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Medium,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
320 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
321 CWE-170,Improper Null Termination (Type: Base),The software does not terminate or incorrectly terminates a string or array with a null character or equivalent terminator.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Medium,
322 CWE-190,Integer Overflow or Wraparound (Type: Base),"The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.","An integer overflow or wraparound occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc.",,Medium,"An overview of common programming security vulnerabilities and possible solutions: http://fort-knox.org/thesis.pdf
323 Basic Integer Overflows: http://www.phrack.org/issues.html?issue=60&id=10#article
324 Writing Secure Code: Chapter 20, ""Integer Overflows"" Page 620
325 24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119
326 SafeInt: http://safeint.codeplex.com/
327 Top 25 Series - Rank 17 - Integer Overflow Or Wraparound: http://software-security.sans.org/blog/2010/03/18/top-25-series-rank-17-integer-overflow-or-wraparound
328 The Art of Software Security Assessment: Chapter 6, ""Signed Integer Boundaries"", Page 220."
329 CWE-196,Unsigned to Signed Conversion Error (Type: Variant),An unsigned-to-signed conversion error takes place when a large unsigned primitive is used as a signed value.,It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Medium,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
330 CWE-202,Exposure of Sensitive Data Through Data Queries (Type: Variant),"When trying to keep information confidential, an attacker can often infer some of the information by using statistics.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Medium,
331 CWE-250,Execution with Unnecessary Privileges (Type: Class),"The software performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.","New weaknesses can be exposed because running with extra privileges, such as root or Administrator, can disable the normal security checks being performed by the operating system or surrounding environment. Other pre-existing weaknesses can turn into security vulnerabilities if they occur while operating at raised privileges.
332 Privilege management functions can behave in some less-than-obvious ways, and they have different quirks on different platforms. These inconsistencies are particularly pronounced if you are transitioning from one non-root user to another. Signal handlers and spawned processes run at the privilege of the owning process, so if a process is running as root when a signal fires or a sub-process is executed, the signal handler or sub-process will operate with root privileges.",,Medium,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
333 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
334 Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
335 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm
336 24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
337 The Art of Software Security Assessment: Chapter 9, ""Privilege Vulnerabilities"", Page 477."
338 CWE-269,Improper Privilege Management (Type: Base),"The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Medium,"24 Deadly Sins of Software Security: ""Sin 16: Executing Code With Too Much Privilege."" Page 243
339 The Art of Software Security Assessment: Chapter 9, ""Dropping Privileges Permanently"", Page 479."
340 CWE-273,Improper Check for Dropped Privileges (Type: Base),The software attempts to drop privileges but does not check or incorrectly checks to see if the drop succeeded.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,
341 CWE-276,Incorrect Default Permissions (Type: Variant),"The software, upon installation, sets incorrect permissions for an object that exposes it to an unintended actor.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Medium,"The Art of Software Security Assessment: Chapter 3, ""Insecure Defaults"", Page 69."
342 CWE-299,Improper Check for Certificate Revocation (Type: Variant),"The software does not check or incorrectly checks the revocation status of a certificate, which may cause it to use a certificate that has been compromised.","An improper check for certificate revocation is a far more serious flaw than related certificate failures. This is because the use of any revoked certificate is almost certainly malicious. The most common reason for certificate revocation is compromise of the system in question, with the result that no legitimate servers will be using a revoked certificate, unless they are sorely out of sync.",,Medium,"24 Deadly Sins of Software Security: ""Sin 23: Improper Use of PKI, Especially SSL."" Page 347"
343 CWE-301,Reflection Attack in an Authentication Protocol (Type: Variant),Simple authentication protocols are subject to reflection attacks if a malicious user can use the target machine to impersonate a trusted user.,"A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Insufficient Validation"", Page 38."
344 CWE-329,Not Using a Random IV with CBC Mode (Type: Variant),Not using a random initialization Vector (IV) with Cipher Block Chaining (CBC) Mode causes algorithms to be susceptible to dictionary attacks.,"This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Initialization Vectors"", Page 42."
345 CWE-332,Insufficient Entropy in PRNG (Type: Variant),"The lack of entropy available for, or used by, a Pseudo-Random Number Generator (PRNG) can be a stability and security threat.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
346 CWE-338,Use of Cryptographically Weak PRNG (Type: Base),"The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG is not cryptographically strong.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Medium,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
347 CWE-353,Missing Support for Integrity Check (Type: Base),"The software uses a transmission protocol that does not include a mechanism for verifying the integrity of the data during transmission, such as a checksum.","If integrity check values or ""checksums"" are omitted from a protocol, there is no way of determining if data has been corrupted in transmission. The lack of checksum functionality in a protocol removes the first application-level check of data that can be used. The end-to-end philosophy of checks states that integrity checks should be performed at the lowest level that they can be completely implemented. Excluding further sanity checks and input validation performed by applications, the protocol's checksum is the most important level of checksum, since it can be performed more completely than at any previous level and takes into account entire messages, as opposed to single packets.",,Medium,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
348 CWE-354,Improper Validation of Integrity Check Value (Type: Base),"The software does not validate or incorrectly validates the integrity check values or ""checksums"" of a message. This may prevent it from detecting if the data has been modified or corrupted in transmission.",Improper validation of checksums before use results in an unnecessary risk that can easily be mitigated. The protocol specification describes the algorithm used for calculating the checksum. It is then a simple matter of implementing the calculation and verifying that the calculated checksum and the received checksum match. Improper verification of the calculated checksum and the received checksum can lead to far greater consequences.,,Medium,
349 CWE-362,Concurrent Execution using Shared Resource with Improper Synchronization (Race Condition) (Type: Class),"The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.","This can have security implications when the expected synchronization is in security-critical code, such as recording whether a user is authenticated or modifying important state information that should not be influenced by an outsider.
350 A race condition occurs within concurrent environments, and is effectively a property of a code sequence. Depending on the context, a code sequence may be in the form of a function call, a small number of instructions, a series of program invocations, etc.
351 A race condition violates these properties, which are closely related:
352 Exclusivity - the code sequence is given exclusive access to the shared resource, i.e., no other code sequence can modify properties of the shared resource before the original sequence has completed execution.
353 Atomicity - the code sequence is behaviorally atomic, i.e., no other thread or process can concurrently execute the same sequence of instructions (or a subset) against the same resource.
354 A race condition exists when an ""interfering code sequence"" can still access the shared resource, violating exclusivity. Programmers may assume that certain code sequences execute too quickly to be affected by an interfering code sequence; when they are not, this violates atomicity. For example, the single ""x++"" statement may appear atomic at the code layer, but it is actually non-atomic at the instruction layer, since it involves a read (the original value of x), followed by a computation (x+1), followed by a write (save the result to x).
355 The interfering code sequence could be ""trusted"" or ""untrusted."" A trusted interfering code sequence occurs within the program; it cannot be modified by the attacker, and it can only be invoked indirectly. An untrusted interfering code sequence can be authored directly by the attacker, and typically it is external to the vulnerable program.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
356 volatile - Multithreaded Programmer's Best Friend: http://www.ddj.com/cpp/184403766
357 Thread-safe webapps using Spring: http://www.javalobby.org/articles/thread-safe/index.jsp
358 Prevent race conditions: http://www.ibm.com/developerworks/library/l-sprace.html
359 Race Conditions, Files, and Security Flaws; or the Tortoise and the Hare Redux: http://www.cs.ucdavis.edu/research/tech-reports/1995/CSE-95-9.pdf
360 Secure Programming for Linux and Unix HOWTO: http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/avoid-race.html
361 Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
362 On Race Vulnerabilities in Web Applications: http://security.dico.unimi.it/~roberto/pubs/dimva08-web.pdf
363 Avoiding Race Conditions and Insecure File Operations: http://developer.apple.com/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html
364 Top 25 Series - Rank 25 - Race Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/26/top-25-series-rank-25-race-conditions/
365 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
366 CWE-364,Signal Handler Race Condition (Type: Base),The software uses a signal handler that introduces a race condition.,"Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
367 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
368 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
369 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
370 Shared state between a signal handler and other signal handlers
371 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
372 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
373 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
374 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
375 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
376 Avoiding shared state
377 Using synchronization in the signal handler
378 Using synchronization in the regular code
379 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
380 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html
381 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
382 The Art of Software Security Assessment: Chapter 13, ""Signal Vulnerabilities"", Page 791."
383 CWE-365,Race Condition in Switch (Type: Base),"The code contains a switch statement in which the switched variable can be modified while the switch is still executing, resulting in unexpected behavior.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
384 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
385 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
386 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
387 Shared state between a signal handler and other signal handlers
388 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
389 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
390 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
391 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
392 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
393 Avoiding shared state
394 Using synchronization in the signal handler
395 Using synchronization in the regular code
396 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
397 CWE-366,Race Condition within a Thread (Type: Base),"If two threads of execution use a resource simultaneously, there exists the possibility that resources may be used while invalid, in turn making the state of execution undefined.","Race conditions frequently occur in signal handlers, since signal handlers support asynchronous actions. These race conditions have a variety of root causes and symptoms. Attackers may be able to exploit a signal handler race condition to cause the software state to be corrupted, possibly leading to a denial of service or even code execution.
398 These issues occur when non-reentrant functions, or state-sensitive actions occur in the signal handler, where they may be called at any time. These behaviors can violate assumptions being made by the ""regular"" code that is interrupted, or by other signal handlers that may also be invoked. If these functions are called at an inopportune moment - such as while a non-reentrant function is already running - memory corruption could occur that may be exploitable for code execution. Another signal race condition commonly found occurs when free is called within a signal handler, resulting in a double free and therefore a write-what-where condition. Even if a given pointer is set to NULL after it has been freed, a race condition still exists between the time the memory was freed and the pointer was set to NULL. This is especially problematic if the same signal handler has been set for more than one signal -- since it means that the signal handler itself may be reentered.
399 There are several known behaviors related to signal handlers that have received the label of ""signal handler race condition"":
400 Shared state (e.g. global data or static variables) that are accessible to both a signal handler and ""regular"" code
401 Shared state between a signal handler and other signal handlers
402 Use of non-reentrant functionality within a signal handler - which generally implies that shared state is being used. For example, malloc() and free() are non-reentrant because they may use global or static data structures for managing memory, and they are indirectly used by innocent-seeming functions such as syslog(); these functions could be exploited for memory corruption and, possibly, code execution.
403 Association of the same signal handler function with multiple signals - which might imply shared state, since the same code and resources are accessed. For example, this can be a source of double-free and use-after-free weaknesses.
404 Use of setjmp and longjmp, or other mechanisms that prevent a signal handler from returning control back to the original functionality
405 While not technically a race condition, some signal handlers are designed to be called at most once, and being called more than once can introduce security problems, even when there are not any concurrent calls to the signal handler. This can be a source of double-free and use-after-free weaknesses.
406 Signal handler vulnerabilities are often classified based on the absence of a specific protection mechanism, although this style of classification is discouraged in CWE because programmers often have a choice of several different mechanisms for addressing the weakness. Such protection mechanisms may preserve exclusivity of access to the shared resource, and behavioral atomicity for the relevant code:
407 Avoiding shared state
408 Using synchronization in the signal handler
409 Using synchronization in the regular code
410 Disabling or masking other signals, which provides atomicity (which effectively ensures exclusivity)",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205
411 The Art of Software Security Assessment: Chapter 13, ""Race Conditions"", Page 759."
412 CWE-369,Divide By Zero (Type: Base),The product divides a value by zero.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Medium,"No description: http://www.cprogramming.com/tutorial/exceptions.html
413 No description: http://msdn.microsoft.com/en-us/library/ms173160(VS.80).aspx"
414 CWE-370,Missing Check for Certificate Revocation after Initial Check (Type: Base),"The software does not check the revocation status of a certificate after its initial revocation check, which can cause the software to perform privileged actions even after the certificate is revoked at a later time.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
415 CWE-374,Passing Mutable Objects to an Untrusted Method (Type: Base),"Sending non-cloned mutable data as an argument may result in that data being altered or deleted by the called function, thereby putting the calling function into an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,"Does Java pass by reference or pass by value?: http://www.javaworld.com/javaworld/javaqa/2000-05/03-qa-0526-pass.html
416 Java: The Complete Reference, J2SE 5th Edition"
417 CWE-375,Returning a Mutable Object to an Untrusted Caller (Type: Base),"Sending non-cloned mutable data as a return value may result in that data being altered or deleted by the calling function, thereby putting the class in an undefined state.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Medium,
418 CWE-385,Covert Timing Channel (Type: Base),"Covert timing channels convey information by modulating some aspect of system behavior over time, so that the program receiving the information can observe system behavior and infer protected information.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
419 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
420 CWE-390,Detection of Error Condition Without Action (Type: Class),"The software detects a specific error, but takes no actions to handle the error.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
421 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
422 CWE-391,Unchecked Error Condition (Type: Base),Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
423 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Medium,
424 CWE-401,Improper Release of Memory Before Removing Last Reference (Memory Leak) (Type: Base),"The software does not sufficiently track and release allocated memory after it has been used, which slowly consumes remaining memory.",This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Medium,How to Break Software Security
425 CWE-460,Improper Cleanup on Thrown Exception (Type: Variant),"The product does not clean up its state or incorrectly cleans up its state when an exception is thrown, leading to unexpected state or control flow.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Medium,
426 CWE-468,Incorrect Pointer Scaling (Type: Base),"In C and C++, one may often accidentally refer to the wrong memory due to the semantics of when math operations are implicitly scaled.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
427 CWE-469,Use of Pointer Subtraction to Determine Size (Type: Base),"The application subtracts one pointer from another in order to determine size, but this calculation can be incorrect if the pointers do not exist in the same memory chunk.","Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Medium,
428 CWE-476,NULL Pointer Dereference (Type: Base),"A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Medium,
429 CWE-484,Omitted Break Statement in Switch (Type: Base),"The program omits a break statement within a switch or similar construct, causing code associated with multiple conditions to execute. This can cause problems when the programmer only intended to execute code associated with one condition.",This can lead to critical code executing in situations where it should not.,,Medium,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
430 CWE-487,Reliance on Package-level Scope (Type: Variant),"Java packages are not inherently closed; therefore, relying on them for code security is not a good practice.","If the decision to trust the methods and data of an object is based on the name of a class, it is possible for malicious users to send objects of the same name as trusted classes and thereby gain the trust afforded to known classes and types.",,Medium,
431 CWE-492,Use of Inner Class Containing Sensitive Data (Type: Variant),Inner classes are translated into classes that are accessible at package scope and may expose code that the programmer intended to keep private to attackers.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
432 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Medium,
433 CWE-494,Download of Code Without Integrity Check (Type: Base),The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Medium,"Introduction to Code Signing: http://msdn.microsoft.com/en-us/library/ms537361(VS.85).aspx
434 Authenticode: http://msdn.microsoft.com/en-us/library/ms537359(v=VS.85).aspx
435 Code Signing Guide: http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Introduction/chapter_1_section_1.html
436 Secure Software Updates: Disappointments and New Challenges: http://prisms.cs.umass.edu/~kevinfu/papers/secureupdates-hotsec06.pdf
437 24 Deadly Sins of Software Security: ""Sin 18: The Sins of Mobile Code."" Page 267
438 Top 25 Series - Rank 20 - Download of Code Without Integrity Check: http://blogs.sans.org/appsecstreetfighter/2010/04/05/top-25-series-rank-20-download-code-integrity-check/
439 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
440 CWE-498,Cloneable Class Containing Sensitive Information (Type: Variant),"The code contains a class with sensitive data, but the class is cloneable. The data can then be accessed by cloning the class.","Cloneable classes are effectively open classes, since data cannot be hidden in them. Classes that do not explicitly deny cloning can be cloned by any other class without running the constructor.",,Medium,
441 CWE-502,Deserialization of Untrusted Data (Type: Variant),The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.,"It is often convenient to serialize objects for communication or to save them for later use. However, deserialized data or code can often be modified without using the provided accessor functions if it does not use cryptography to protect itself. Furthermore, any cryptography would still be client-side security -- which is a dangerous security assumption.
442 Data that is untrusted can not be trusted to be well-formed.",,Medium,"Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
443 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
444 CWE-532,Information Exposure Through Log Files (Type: Variant),Information written to log files can be of a sensitive nature and give valuable guidance to an attacker or expose sensitive user information.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Medium,
445 CWE-602,Client-Side Enforcement of Server-Side Security (Type: Base),The software is composed of a server that relies on the client to implement a mechanism that is intended to protect the server.,"When the server relies on protection mechanisms placed on the client side, an attacker can modify the client-side behavior to bypass the protection mechanisms resulting in potentially unexpected interactions between the client and server. The consequences will vary, depending on what the mechanisms are trying to protect.",,Medium,"Writing Secure Code: Chapter 23, ""Client-Side Security Is an Oxymoron"" Page 687"
446 CWE-665,Improper Initialization (Type: Base),"The software does not initialize or incorrectly initializes a resource, which might leave the resource in an unexpected state when it is accessed or used.","This can have security implications when the associated resource is expected to have certain properties or values, such as a variable that determines whether a user has been authenticated or not.",,Medium,"Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
447 MS08-014 : The Case of the Uninitialized Stack Variable Vulnerability: http://blogs.technet.com/swi/archive/2008/03/11/the-case-of-the-uninitialized-stack-variable-vulnerability.aspx
448 The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
449 CWE-754,Improper Check for Unusual or Exceptional Conditions (Type: Class),The software does not check or improperly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the software.,"The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
450 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Medium,"The Art of Software Security Assessment: Chapter 7, ""Program Building Blocks"" Page 341
451 The Art of Software Security Assessment: Chapter 1, ""Exceptional Conditions,"" Page 22
452 24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183
453 Top 25 Series - Rank 15 - Improper Check for Unusual or Exceptional Conditions: http://blogs.sans.org/appsecstreetfighter/2010/03/15/top-25-series-rank-15-improper-check-for-unusual-or-exceptional-conditions/"
454 CWE-778,Insufficient Logging (Type: Base),"When a security-critical event occurs, the software either does not record the event or omits important details about the event when logging it.","When security-critical events are not logged properly, such as a failed login attempt, this can make malicious behavior more difficult to detect and may hinder forensic analysis after an attack succeeds.",,Medium,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
455 CWE-780,Use of RSA Algorithm without OAEP (Type: Variant),"The software uses the RSA algorithm but does not incorporate Optimal Asymmetric Encryption Padding (OAEP), which might weaken the encryption.",Padding schemes are often used with cryptographic algorithms to make the plaintext less predictable and complicate attack efforts. The OAEP scheme is often used with RSA to nullify the impact of predictable common text.,,Medium,"RSA Problem: http://people.csail.mit.edu/rivest/RivestKaliski-RSAProblem.pdf
456 Optimal Asymmetric Encryption Padding: http://en.wikipedia.org/wiki/Optimal_Asymmetric_Encryption_Padding"
457 CWE-908,Use of Uninitialized Resource (Type: Base),The software uses a resource that has not been properly initialized.,This can have security implications when the associated resource is expected to have certain properties or values.,,Medium,Exploiting Uninitialized Data: http://www.felinemenace.org/~mercy/papers/UBehavior/UBehavior.zip
458 CWE-909,Missing Initialization of Resource (Type: Base),The software does not initialize a critical resource.,"Many resources require initialization before they can be properly used. If a resource is not initialized, it could contain unpredictable or expired data, or it could be initialized to defaults that are invalid. This can have security implications when the resource is expected to have certain properties or values.",,Medium,
459 CWE-910,Use of Expired File Descriptor (Type: Base),The software uses or accesses a file descriptor after it has been closed.,"After a file descriptor for a particular file or device has been released, it can be reused. The code might not write to the original file, since the reused file descriptor might reference a different file or device.",,Medium,
460 CWE-911,Improper Update of Reference Count (Type: Base),"The software uses a reference count to manage a resource, but it does not update or incorrectly updates the reference count.","Reference counts can be used when tracking how many objects contain a reference to a particular resource, such as in memory management or garbage collection. When the reference count reaches zero, the resource can be de-allocated or reused because there are no more objects that use it. If the reference count accidentally reaches zero, then the resource might be released too soon, even though it is still in use. If all objects no longer use the resource, but the reference count is not zero, then the resource might not ever be released.",,Medium,Windows Kernel Reference Count Vulnerabilities - Case Study: http://j00ru.vexillium.org/dump/zn_slides.pdf
461 CWE-94,Improper Control of Generation of Code (Code Injection) (Type: Class),"The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.","When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution.
462 Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Medium,"24 Deadly Sins of Software Security: ""Sin 3: Web-Client Related Vulnerabilities (XSS)."" Page 63"
463 CWE-95,Improper Neutralization of Directives in Dynamically Evaluated Code (Eval Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. ""eval"").","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Medium,"No description: http://www.rubycentral.com/book/taint.html
464 The Art of Software Security Assessment: Chapter 18, ""Inline Evaluation"", Page 1095."
465 CWE-287,Improper Authentication (Type: Class),"When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Medium to High,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
466 Top 10 2007-Broken Authentication and Session Management: http://www.owasp.org/index.php/Top_10_2007-A7
467 Guide to Authentication: http://www.owasp.org/index.php/Guide_to_Authentication
468 Authentication: http://msdn.microsoft.com/en-us/library/aa374735(VS.85).aspx
469 Writing Secure Code: Chapter 4, ""Authentication"" Page 109"
470 CWE-306,Missing Authentication for Critical Function (Type: Variant),The software does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.,"Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Medium to High,"The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Authentication,"" Page 36
471 Top 25 Series - Rank 19 - Missing Authentication for Critical Function: http://blogs.sans.org/appsecstreetfighter/2010/02/23/top-25-series-rank-19-missing-authentication-for-critical-function/
472 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
473 CWE-319,Cleartext Transmission of Sensitive Information (Type: Base),The software transmits sensitive or security-critical data in cleartext in a communication channel that can be sniffed by unauthorized actors.,"Many communication channels can be ""sniffed"" by attackers during data transmission. For example, network traffic can often be sniffed by any attacker who has access to a network interface. This significantly lowers the difficulty of exploitation by attackers.",,Medium to High,"Top 10 2007-Insecure Communications: http://www.owasp.org/index.php/Top_10_2007-A9
474 Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
475 24 Deadly Sins of Software Security: ""Sin 22: Failing to Protect Network Traffic."" Page 337
476 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
477 CWE-327,Use of a Broken or Risky Cryptographic Algorithm (Type: Base),The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.,The use of a non-standard algorithm is dangerous because a determined attacker may be able to break the algorithm and compromise whatever data has been protected. Well-known techniques may exist to break the algorithm.,,Medium to High,"Applied Cryptography: http://www.schneier.com/book-applied.html
478 Handbook of Applied Cryptography: http://www.cacr.math.uwaterloo.ca/hac/
479 Avoiding bogus encryption products: Snake Oil FAQ: http://www.faqs.org/faqs/cryptography-faq/snake-oil/
480 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
481 Microsoft Scraps Old Encryption in New Code: http://www.eweek.com/c/a/Security/Microsoft-Scraps-Old-Encryption-in-New-Code/
482 Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
483 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315
484 Top 25 Series - Rank 24 - Use of a Broken or Risky Cryptographic Algorithm: http://blogs.sans.org/appsecstreetfighter/2010/03/25/top-25-series-rank-24-use-of-a-broken-or-risky-cryptographic-algorithm/
485 The Art of Software Security Assessment: Chapter 2, ""Insufficient or Obsolete Encryption"", Page 44."
486 CWE-330,Use of Insufficiently Random Values (Type: Class),The software may use insufficiently random numbers or values in a security context that depends on unpredictable numbers.,"When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Medium to High,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
487 Building Secure Software: How to Avoid Security Problems the Right Way
488 Writing Secure Code: Chapter 8, ""Using Poor Random Numbers"" Page 259
489 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
490 CWE-400,Uncontrolled Resource Consumption (Resource Exhaustion) (Type: Base),"The software does not properly restrict the size or amount of resources that are requested or influenced by an actor, which can be used to consume more resources than intended.","Limited resources include memory, file system storage, database connection pool entries, or CPU. If an attacker can trigger the allocation of these limited resources, but the number or size of the resources is not controlled, then the attacker could cause a denial of service that consumes all available resources. This would prevent valid users from accessing the software, and it could potentially have an impact on the surrounding environment. For example, a memory exhaustion attack against an application could slow down the application as well as its host operating system.
491 Resource exhaustion problems have at least two common causes:
492 Error conditions and other exceptional circumstances
493 Confusion over which part of the program is responsible for releasing the resource",,Medium to High,"Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
494 Resource exhaustion: http://cr.yp.to/docs/resources.html
495 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
496 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
497 CWE-434,Unrestricted Upload of File with Dangerous Type (Type: Base),The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Medium to High,"Dynamic File Uploads, Security and You: http://shsc.info/FileUploadSecurity
498 8 Basic Rules to Implement Secure File Uploads: http://blogs.sans.org/appsecstreetfighter/2009/12/28/8-basic-rules-to-implement-secure-file-uploads/
499 Top 25 Series - Rank 8 - Unrestricted Upload of Dangerous File Type: http://blogs.sans.org/appsecstreetfighter/2010/02/25/top-25-series-rank-8-unrestricted-upload-of-dangerous-file-type/
500 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
501 The Art of Software Security Assessment: Chapter 17, ""File Uploading"", Page 1068."
502 CWE-64,Windows Shortcut Following (.LNK) (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the file is a Windows shortcut (.LNK) whose target is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.",The shortcut (file with the .lnk extension) can permit an attacker to read/write a file that they originally did not have permissions to access.,,Medium to High,
503 CWE-681,Incorrect Conversion between Numeric Types (Type: Base),"When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Medium to High,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
504 CWE-732,Incorrect Permission Assignment for Critical Resource (Type: Class),The software specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Medium to High,"The Art of Software Security Assessment: Chapter 9, ""File Permissions."" Page 495.
505 Building Secure Software: How to Avoid Security Problems the Right Way: Chapter 8, ""Access Control."" Page 194.
506 Top 25 Series - Rank 21 - Incorrect Permission Assignment for Critical Response: http://software-security.sans.org/blog/2010/03/24/top-25-series-rank-21-incorrect-permission-assignment-for-critical-response
507 Federal Desktop Core Configuration: http://nvd.nist.gov/fdcc/index.cfm"
508 CWE-770,Allocation of Resources Without Limits or Throttling (Type: Base),"The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on how many resources can be allocated, in violation of the intended security policy for that actor.","Command injection vulnerabilities typically occur when:
509 1. Data enters the application from an untrusted source.
510 2. The data is part of a string that is executed as a command by the application.
511 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Medium to High,"Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
512 Detection and Prediction of Resource-Exhaustion Vulnerabilities: http://homepages.di.fc.ul.pt/~nuno/PAPERS/ISSRE08.pdf
513 Resource exhaustion: http://cr.yp.to/docs/resources.html
514 Resource exhaustion: http://homes.cerias.purdue.edu/~pmeunier/secprog/sanitized/class1/6.resource%20exhaustion.ppt
515 Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517
516 Top 25 Series - Rank 22 - Allocation of Resources Without Limits or Throttling: http://blogs.sans.org/appsecstreetfighter/2010/03/23/top-25-series-rank-22-allocation-of-resources-without-limits-or-throttling/
517 The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
518 CWE-771,Missing Reference to Active Allocated Resource (Type: Base),"The software does not properly maintain a reference to a resource that has been allocated, which prevents the resource from being reclaimed.","This does not necessarily apply in languages or frameworks that automatically perform garbage collection, since the removal of all references may act as a signal that the resource is ready to be reclaimed.",,Medium to High,
519 CWE-772,Missing Release of Resource after Effective Lifetime (Type: Base),"The software does not release a resource after its effective lifetime has ended, i.e., after the resource is no longer needed.","When a resource is not released after use, it can allow attackers to cause a denial of service.",,Medium to High,
520 CWE-773,Missing Reference to Active File Descriptor or Handle (Type: Variant),"The software does not properly maintain references to a file descriptor or handle, which prevents that file descriptor/handle from being reclaimed.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,
521 CWE-774,Allocation of File Descriptors or Handles Without Limits or Throttling (Type: Variant),"The software allocates file descriptors or handles on behalf of an actor without imposing any restrictions on how many descriptors can be allocated, in violation of the intended security policy for that actor.","This can cause the software to consume all available file descriptors or handles, which can prevent other processes from performing critical file processing operations.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""Resource Limits"", Page 574."
522 CWE-775,Missing Release of File Descriptor or Handle after Effective Lifetime (Type: Variant),"The software does not release a file descriptor or handle after its effective lifetime has ended, i.e., after the file descriptor/handle is no longer needed.","When a file descriptor or handle is not released after use (typically by explicitly closing it), attackers can cause a denial of service by consuming all available file descriptors/handles, or otherwise preventing other system processes from obtaining their own file descriptors/handles.",,Medium to High,"The Art of Software Security Assessment: Chapter 10, ""File Descriptor Leaks"", Page 582."
523 CWE-804,Guessable CAPTCHA (Type: Base),"The software uses a CAPTCHA challenge, but the challenge can be guessed or automatically recognized by a non-human actor.","An automated attacker could bypass the intended protection of the CAPTCHA challenge and perform actions at a higher frequency than humanly possible, such as launching spam attacks.
524 There can be several different causes of a guessable CAPTCHA:
525 An audio or visual image that does not have sufficient distortion from the unobfuscated source image.
526 A question is generated that with a format that can be automatically recognized, such as a math question.
527 A question for which the number of possible answers is limited, such as birth years or favorite sports teams.
528 A general-knowledge or trivia question for which the answer can be accessed using a data base, such as country capitals or popular actors.
529 Other data associated with the CAPTCHA may provide hints about its contents, such as an image whose filename contains the word that is used in the CAPTCHA.",,Medium to High,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
530 CWE-805,Buffer Access with Incorrect Length Value (Type: Base),"The software uses a sequential operation to read or write a buffer, but it uses an incorrect length value that causes it to access memory that is outside of the bounds of the buffer.","When the length value exceeds the size of the destination, a buffer overflow could occur.",,Medium to High,"Writing Secure Code: Chapter 6, ""Why ACLs Are Important"" Page 171
531 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
532 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
533 PaX: http://en.wikipedia.org/wiki/PaX
534 Top 25 Series - Rank 12 - Buffer Access with Incorrect Length Value: http://blogs.sans.org/appsecstreetfighter/2010/03/11/top-25-series-rank-12-buffer-access-with-incorrect-length-value/
535 Safe C String Library v1.0.3: http://www.zork.org/safestr/
536 Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
537 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx
538 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
539 CWE-806,Buffer Access Using Size of Source Buffer (Type: Variant),"The software uses the size of a source buffer when reading from or writing to a destination buffer, which may cause it to access memory that is outside of the bounds of the buffer.","When the size of the destination is smaller than the size of the source, a buffer overflow could occur.",,Medium to High,"Using the Strsafe.h Functions: http://msdn.microsoft.com/en-us/library/ms647466.aspx
540 Safe C String Library v1.0.3: http://www.zork.org/safestr/
541 Address Space Layout Randomization in Windows Vista: http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx
542 Limiting buffer overflows with ExecShield: http://www.redhat.com/magazine/009jul05/features/execshield/
543 PaX: http://en.wikipedia.org/wiki/PaX
544 Understanding DEP as a mitigation technology part 1: http://blogs.technet.com/b/srd/archive/2009/06/12/understanding-dep-as-a-mitigation-technology-part-1.aspx"
545 CWE-807,Reliance on Untrusted Inputs in a Security Decision (Type: Base),"The application uses a protection mechanism that relies on the existence or values of an input, but the input can be modified by an untrusted actor in a way that bypasses the protection mechanism.","Developers may assume that inputs such as cookies, environment variables, and hidden form fields cannot be modified. However, an attacker could change these inputs using customized clients or other attacks. This change might not be detected. When security decisions such as authentication and authorization are made based on the values of these inputs, attackers can bypass the security of the software.
546 Without sufficient encryption, integrity checking, or other mechanism, any input that originates from an outsider cannot be trusted.",,Medium to High,"Top 25 Series - Rank 6 - Reliance on Untrusted Inputs in a Security Decision: http://blogs.sans.org/appsecstreetfighter/2010/03/05/top-25-series-rank-6-reliance-on-untrusted-inputs-in-a-security-decision/
547 HMAC: http://en.wikipedia.org/wiki/Hmac
548 Understanding ASP.NET View State: http://msdn.microsoft.com/en-us/library/ms972976.aspx
549 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
550 CWE-93,Improper Neutralization of CRLF Sequences (CRLF Injection) (Type: Base),"The software uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.","Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Medium to High,CRLF Injection: http://marc.info/?l=bugtraq&m=102088154213630&w=2
551 CWE-102,Struts: Duplicate Validation Forms (Type: Variant),"The application uses multiple validation forms with the same name, which might cause the Struts Validator to validate a form that the programmer does not expect.","If two validation forms have the same name, the Struts Validator arbitrarily chooses one of the forms to use for input validation and discards the other. This decision might not correspond to the programmer's expectations, possibly leading to resultant weaknesses. Moreover, it indicates that the validation logic is not up-to-date, and can indicate that other, more subtle validation errors are present.",,Unknown,
552 CWE-103,Struts: Incomplete validate() Method Definition (Type: Variant),"The application has a validator form that either does not define a validate() method, or defines a validate() method but does not call super.validate().","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
553 CWE-104,Struts: Form Bean Does Not Extend Validation Class (Type: Variant),"If a form bean does not extend an ActionForm subclass of the Validator framework, it can expose the application to other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
554 CWE-105,Struts: Form Field Without Validator (Type: Variant),"The application has a form field that is not validated by a corresponding validation form, which can introduce other weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
555 CWE-106,Struts: Plug-in Framework not in Use (Type: Variant),"When an application does not use an input validation framework such as the Struts Validator, there is a greater risk of introducing weaknesses related to insufficient input validation.","If you do not call super.validate(), the Validation Framework cannot check the contents of the form against a validation form. In other words, the validation framework will be disabled for the given form.",,Unknown,
556 CWE-107,Struts: Unused Validation Form (Type: Variant),An unused validation form indicates that validation logic is not up-to-date.,It is easy for developers to forget to update validation logic when they remove or rename action form mappings. One indication that validation logic is not being properly maintained is the presence of an unused validation form.,,Unknown,
557 CWE-108,Struts: Unvalidated Action Form (Type: Variant),Every Action Form must have a corresponding validation form.,"If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
558 CWE-109,Struts: Validator Turned Off (Type: Variant),"Automatic filtering via a Struts bean has been turned off, which disables the Struts Validator and custom validation logic. This exposes the application to other weaknesses related to insufficient input validation.","If a Struts Action Form Mapping specifies a form, it must have a validation form defined under the Struts Validator.",,Unknown,
559 CWE-11,ASP.NET Misconfiguration: Creating Debug Binary (Type: Variant),Debugging messages help attackers learn about the system and plan a form of attack.,ASP .NET applications can be configured to produce debug binaries. These binaries give detailed debugging messages and should not be used in production environments. Debug binaries are meant to be used in a development or testing environment and can pose a security risk if they are deployed to production.,,Unknown,
560 CWE-110,Struts: Validator Without Form Field (Type: Variant),Validation fields that do not appear in forms they are associated with indicate that the validation logic is out of date.,It is easy for developers to forget to update validation logic when they make changes to an ActionForm class. One indication that validation logic is not being properly maintained is inconsistencies between the action form and the validation form.,,Unknown,
561 CWE-111,Direct Use of Unsafe JNI (Type: Base),"When a Java application uses the Java Native Interface (JNI) to call code written in another programming language, it can expose the application to weaknesses in that code, even if those weaknesses cannot occur in Java.","Many safety features that programmers may take for granted simply do not apply for native code, so you must carefully review all such code for potential problems. The languages used to implement native code may be more susceptible to buffer overflows and other attacks. Native code is unprotected by the security features enforced by the runtime environment, such as strong typing and array bounds checking.",,Unknown,"Fortify Descriptions: http://vulncat.fortifysoftware.com
562 The Java(TM) Tutorial: The Java Native Interface: http://java.sun.com/docs/books/tutorial/native1.1/"
563 CWE-112,Missing XML Validation (Type: Base),The software accepts XML from an untrusted source but does not validate the XML against the proper schema.,"Most successful attacks begin with a violation of the programmer's assumptions. By accepting an XML document without validating it against a DTD or XML schema, the programmer leaves a door open for attackers to provide unexpected, unreasonable, or malicious input.",,Unknown,
564 CWE-113,Improper Neutralization of CRLF Sequences in HTTP Headers (HTTP Response Splitting) (Type: Base),"The software receives data from an upstream component, but does not neutralize or incorrectly neutralizes CR and LF characters before the data is included in outgoing HTTP headers.","Including unvalidated data in an HTTP header allows an attacker to specify the entirety of the HTTP response rendered by the browser. When an HTTP request contains unexpected CR (carriage return, also given by %0d or \r) and LF (line feed, also given by %0a or \n) characters the server may respond with an output stream that is interpreted as two different HTTP responses (instead of one). An attacker can control the second response and mount attacks such as cross-site scripting and cache poisoning attacks.
565 HTTP response splitting weaknesses may be present when:
566 Data enters a web application through an untrusted source, most frequently an HTTP request.
567 The data is included in an HTTP response header sent to a web user without being validated for malicious characters.",,Unknown,"OWASP TOP 10: http://www.owasp.org/index.php/Top_10_2007
568 24 Deadly Sins of Software Security: ""Sin 2: Web-Server Related Vulnerabilities (XSS, XSRF, and Response Splitting)."" Page 31"
569 CWE-114,Process Control (Type: Base),Executing commands or loading libraries from an untrusted source or in an untrusted environment can cause an application to execute malicious commands (and payloads) on behalf of an attacker.,"Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
570 CWE-115,Misinterpretation of Input (Type: Base),"The software misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.","Process control vulnerabilities take two forms: 1. An attacker can change the command that the program executes: the attacker explicitly controls what the command is. 2. An attacker can change the environment in which the command executes: the attacker implicitly controls what the command means. Process control vulnerabilities of the first type occur when either data enters the application from an untrusted source and the data is used as part of a string representing a command that is executed by the application. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Unknown,
571 CWE-118,Improper Access of Indexable Resource (Range Error) (Type: Class),"The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.","This can allow an attacker to forge log entries or inject malicious content into logs.
572 Log forging vulnerabilities occur when:
573 Data enters an application from an untrusted source.
574 The data is written to an application or system log file.",,Unknown,
575 CWE-12,ASP.NET Misconfiguration: Missing Custom Error Page (Type: Variant),An ASP .NET application must enable custom error pages in order to prevent attackers from mining information from the framework's built-in responses.,"Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
576 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,Unknown,"19 Deadly Sins of Software Security
577 ASP.NET Misconfiguration: Missing Custom Error Handling: http://www.owasp.org/index.php/ASP.NET_Misconfiguration:_Missing_Custom_Error_Handling"
578 CWE-125,Out-of-bounds Read (Type: Base),"The software reads data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
579 CWE-126,Buffer Over-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations after the targeted buffer.,This typically occurs when the pointer or its index is incremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in exposure of sensitive information or possibly a crash.,,Unknown,
580 CWE-127,Buffer Under-read (Type: Variant),The software reads from a buffer using buffer access mechanisms such as indexes or pointers that reference memory locations prior to the targeted buffer.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,
581 CWE-13,ASP.NET Misconfiguration: Password in Configuration File (Type: Variant),Storing a plaintext password in a configuration file allows anyone who can read the file access to the password-protected resource making them an easy target for attackers.,"This typically occurs when the pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. This may result in exposure of sensitive information or possibly a crash.",,Unknown,"How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI: http://msdn.microsoft.com/en-us/library/ms998280.aspx
582 How To: Encrypt Configuration Sections in ASP.NET 2.0 Using RSA: http://msdn.microsoft.com/en-us/library/ms998283.aspx
583 .NET Framework Developer's Guide - Securing Connection Strings: http://msdn.microsoft.com/en-us/library/89211k9b(VS.80).aspx"
584 CWE-130,Improper Handling of Length Parameter Inconsistency (Type: Variant),"The software parses a formatted message or structure, but it does not handle or incorrectly handles a length field that is inconsistent with the actual length of the associated data.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
585 CWE-132,DEPRECATED (Duplicate): Miscalculated Null Termination (Type: Base),This entry has been deprecated because it was a duplicate of CWE-170. All content has been transferred to CWE-170.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,
586 CWE-135,Incorrect Calculation of Multi-Byte String Length (Type: Base),The software does not correctly calculate the length of strings that can contain wide or multi-byte characters.,"If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Unknown,"Writing Secure Code: Chapter 5, ""Unicode and ANSI Buffer Size Mismatches"" Page 153"
587 CWE-138,Improper Neutralization of Special Elements (Type: Class),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as control elements or syntactic markers when they are sent to a downstream component.","Most languages and protocols have their own special elements such as characters and reserved words. These special elements can carry control implications. If software does not prevent external control or influence over the inclusion of such special elements, the control flow of the program may be altered from what was intended. For example, both Unix and Windows interpret the symbol < (""less than"") as meaning ""read input from a file"".",,Unknown,
588 CWE-14,Compiler Removal of Code to Clear Buffers (Type: Base),"Sensitive memory is cleared according to the source code, but compiler optimizations leave the memory untouched when it is not read from again, aka ""dead store removal.""","This compiler optimization error occurs when:
589 1. Secret data are stored in memory.
590 2. The secret data are scrubbed from memory by overwriting its contents.
591 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322
592 When scrubbing secrets in memory doesn't work: http://cert.uni-stuttgart.de/archive/bugtraq/2002/11/msg00046.html
593 Some Bad News and Some Good News: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncode/html/secure10102002.asp
594 GNU GCC: Optimizer Removes Code Necessary for Security: http://www.derkeiler.com/Mailing-Lists/securityfocus/bugtraq/2002-11/0257.html"
595 CWE-140,Improper Neutralization of Delimiters (Type: Base),The software does not neutralize or incorrectly neutralizes delimiters.,"This compiler optimization error occurs when:
596 1. Secret data are stored in memory.
597 2. The secret data are scrubbed from memory by overwriting its contents.
598 3. The source code is compiled using an optimizing compiler, which identifies and removes the function that overwrites the contents as a dead store because the memory is not used subsequently.",,Unknown,
599 CWE-141,Improper Neutralization of Parameter/Argument Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as parameter or argument delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408.
600 The Art of Software Security Assessment: Chapter 10, ""IFS"", Page 604."
601 CWE-142,Improper Neutralization of Value Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as value delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
602 CWE-143,Improper Neutralization of Record Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as record delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
603 CWE-144,Improper Neutralization of Line Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as line delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
604 CWE-145,Improper Neutralization of Section Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as section delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.
605 One example of a section delimiter is the boundary string in a multipart MIME message. In many cases, doubled line delimiters can serve as a section delimiter.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
606 CWE-146,Improper Neutralization of Expression/Command Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as expression or command delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Embedded Delimiters"", Page 408."
607 CWE-147,Improper Neutralization of Input Terminators (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as input terminators when they are sent to a downstream component.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
608 CWE-148,Improper Neutralization of Input Leaders (Type: Variant),"The application does not properly handle when a leading character or sequence (""leader"") is missing or malformed, or if multiple leaders are used when only one should be allowed.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
609 CWE-149,Improper Neutralization of Quoting Syntax (Type: Variant),"Quotes injected into an application can be used to compromise a system. As data are parsed, an injected/absent/duplicate/malformed use of quotes may cause the process to take unexpected actions.","For example, a ""."" in SMTP signifies the end of mail message data, whereas a null character can be used for the end of a string.",,Unknown,
610 CWE-15,External Control of System or Configuration Setting (Type: Base),One or more system settings or configuration elements can be externally controlled by a user.,"Allowing external control of system settings can disrupt service or cause an application to behave in unexpected, and potentially malicious ways.",,Unknown,
611 CWE-150,"Improper Neutralization of Escape, Meta, or Control Sequences (Type: Variant)","The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
612 CWE-151,Improper Neutralization of Comment Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as comment delimiters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
613 CWE-152,Improper Neutralization of Macro Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as macro symbols when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
614 CWE-153,Improper Neutralization of Substitution Characters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as substitution characters when they are sent to a downstream component.","As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions.",,Unknown,
615 CWE-154,Improper Neutralization of Variable Name Delimiters (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as variable name delimiters when they are sent to a downstream component.","As data is parsed, an injected delimiter may cause the process to take unexpected actions that result in an attack. Example: ""$"" for an environment variable.",,Unknown,
616 CWE-155,Improper Neutralization of Wildcards or Matching Symbols (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as wildcards or matching symbols when they are sent to a downstream component.","As data is parsed, an injected element may cause the process to take unexpected actions.",,Unknown,
617 CWE-156,Improper Neutralization of Whitespace (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as whitespace when they are sent to a downstream component.","This can include space, tab, etc.",,Unknown,
618 CWE-157,Failure to Sanitize Paired Delimiters (Type: Variant),"The software does not properly handle the characters that are used to mark the beginning and ending of a group of entities, such as parentheses, brackets, and braces.","This can include space, tab, etc.",,Unknown,
619 CWE-158,Improper Neutralization of Null Byte or NUL Character (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes NUL characters or null bytes when they are sent to a downstream component.","As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL Character Injection"", Page 411."
620 CWE-159,Failure to Sanitize Special Element (Type: Class),Weaknesses in this attack-focused category do not properly filter and interpret special elements in user-controlled input which could cause adverse effect on the software behavior and integrity.,"As data is parsed, an injected NUL character or null byte may cause the software to believe the input is terminated earlier than it actually is, or otherwise cause the input to be misinterpreted. This could then be used to inject potentially dangerous input that occurs after the null byte or otherwise bypass validation routines and other protection mechanisms.",,Unknown,
621 CWE-160,Improper Neutralization of Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
622 CWE-161,Improper Neutralization of Multiple Leading Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple leading special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple leading special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
623 CWE-162,Improper Neutralization of Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
624 CWE-163,Improper Neutralization of Multiple Trailing Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple trailing special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple trailing special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
625 CWE-164,Improper Neutralization of Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
626 CWE-165,Improper Neutralization of Multiple Internal Special Elements (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes multiple internal special elements that could be interpreted in unexpected ways when they are sent to a downstream component.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
627 CWE-166,Improper Handling of Missing Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an expected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
628 CWE-167,Improper Handling of Additional Special Element (Type: Base),"The software receives input from an upstream component, but it does not handle or incorrectly handles when an additional unexpected special element is missing.","As data is parsed, improperly handled multiple internal special elements may cause the process to take unexpected actions that result in an attack.",,Unknown,
629 CWE-168,Improper Handling of Inconsistent Special Elements (Type: Base),The software does not handle when an inconsistency exists between two or more special characters or reserved words.,"An example of this problem would be if paired characters appear in the wrong order, or if the special characters are not properly nested.",,Unknown,
630 CWE-172,Encoding Error (Type: Class),"The software does not properly encode or decode the data, resulting in unexpected values.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
631 CWE-173,Improper Handling of Alternate Encoding (Type: Variant),The software does not properly handle when an input uses an alternate encoding that is valid for the control sphere to which the input is being sent.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
632 CWE-174,Double Decoding of the Same Data (Type: Variant),"The software decodes the same input twice, which can limit the effectiveness of any protection mechanism that occurs in between the decoding operations.","Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
633 CWE-175,Improper Handling of Mixed Encoding (Type: Variant),The software does not properly handle when the same input uses several different (mixed) encodings.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
634 CWE-176,Improper Handling of Unicode Encoding (Type: Variant),The software does not properly handle when an input contains Unicode encoding.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Sets and Unicode"", Page 446."
635 CWE-177,Improper Handling of URL Encoding (Hex Encoding) (Type: Variant),The software does not properly handle when all or part of an input has been URL encoded.,"Null termination errors frequently occur in two different ways. An off-by-one error could cause a null to be written out of bounds, leading to an overflow. Or, a program could use a strncpy() function call incorrectly, which prevents a null terminator from being added at all. Other scenarios are possible.",,Unknown,
636 CWE-178,Improper Handling of Case Sensitivity (Type: Base),"The software does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.","Improperly handled case sensitive data can lead to several possible consequences, including:
637 case-insensitive passwords reducing the size of the key space, making brute force attacks easier
638 bypassing filters or access controls using alternate names
639 multiple interpretation errors using alternate names.",,Unknown,
640 CWE-179,Incorrect Behavior Order: Early Validation (Type: Base),"The software validates input before applying protection mechanisms that modify the input, which could allow an attacker to bypass the validation via dangerous inputs that only arise after the modification.","Software needs to validate data at the proper time, after data has been canonicalized and cleansed. Early validation is susceptible to various manipulations that result in dangerous inputs that are produced by canonicalization and cleansing.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Escaping Metacharacters"", Page 439."
641 CWE-180,Incorrect Behavior Order: Validate Before Canonicalize (Type: Base),"The software validates input before it is canonicalized, which prevents the software from detecting data that becomes invalid after the canonicalization step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
642 CWE-181,Incorrect Behavior Order: Validate Before Filter (Type: Base),"The software validates data before it has been filtered, which prevents the software from detecting data that becomes invalid after the filtering step.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,
643 CWE-182,Collapse of Data into Unsafe Value (Type: Base),"The software filters data in a way that causes it to be reduced or ""collapsed"" into an unsafe value that violates an expected security property.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
644 CWE-183,Permissive Whitelist (Type: Base),"An application uses a ""whitelist"" of acceptable values, but the whitelist includes at least one unsafe value, leading to resultant weaknesses.","This can be used by an attacker to bypass the validation and launch attacks that expose weaknesses that would otherwise be prevented, such as injection.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
645 CWE-184,Incomplete Blacklist (Type: Base),"An application uses a ""blacklist"" of prohibited values, but the blacklist is incomplete.","If an incomplete blacklist is used as a security mechanism, then the software may allow unintended values to pass into the application logic.",,Unknown,"Exploiting Software: How to Break Code
646 Blacklist defenses as a breeding ground for vulnerability variants: http://seclists.org/fulldisclosure/2006/Feb/0040.html
647 The Art of Software Security Assessment: Chapter 8, ""Eliminating Metacharacters"", Page 435."
648 CWE-185,Incorrect Regular Expression (Type: Class),The software specifies a regular expression in a way that causes data to be improperly matched or compared.,"When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,"Writing Secure Code: Chapter 10, ""Using Regular Expressions for Checking Input"" Page 350"
649 CWE-186,Overly Restrictive Regular Expression (Type: Base),"A regular expression is overly restrictive, which prevents dangerous values from being detected.","When the regular expression is used in protection mechanisms such as filtering or validation, this may allow an attacker to bypass the intended restrictions on the incoming data.",,Unknown,
650 CWE-187,Partial Comparison (Type: Base),"The software performs a comparison that only examines a portion of a factor before determining whether there is a match, such as a substring, leading to resultant weaknesses.","For example, an attacker might succeed in authentication by providing a small password that matches the associated portion of the larger, correct password.",,Unknown,
651 CWE-191,Integer Underflow (Wrap or Wraparound) (Type: Base),"The product subtracts one value from another, such that the result is less than the minimum allowable integer value, which produces a value that is not equal to the correct result.",This can happen in signed and unsigned cases.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 7: Integer Overflows."" Page 119"
652 CWE-193,Off-by-one Error (Type: Base),"A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.",This can happen in signed and unsigned cases.,,Unknown,"Third Generation Exploits: http://www.blackhat.com/presentations/bh-europe-01/halvar-flake/bh-europe-01-halvarflake.ppt
653 Off-by-one errors: a brief explanation: http://marc.theaimsgroup.com/?l=secprog&m=108379742110553&w=2
654 The Frame Pointer Overwrite: http://kaizo.org/mirrors/phrack/phrack55/P55-08
655 Exploiting Software: How to Break Code (The buffer overflow chapter)
656 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
657 The Art of Software Security Assessment: Chapter 5, ""Off-by-One Errors"", Page 180."
658 CWE-195,Signed to Unsigned Conversion Error (Type: Variant),"A signed-to-unsigned conversion error takes place when a signed primitive is used as an unsigned value, usually as a size variable.",It is dangerous to rely on implicit casts between signed and unsigned numbers because the result can take on an unexpected value and violate assumptions made by the program.,,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversions"", Page 223."
659 CWE-198,Use of Incorrect Byte Ordering (Type: Base),"The software receives input from an upstream component, but it does not account for byte ordering (e.g. big-endian and little-endian) when processing the input, causing an incorrect number or value to be used.","When a primitive is cast to a smaller primitive, the high order bits of the large value are lost in the conversion, potentially resulting in an unexpected value that is not equal to the original value. This value may be required as an index into a buffer, a loop iterator, or simply necessary state data. In any case, the value cannot be trusted and the system will be in an undefined state. While this method may be employed viably to isolate the low bits of a value, this usage is rare, and truncation usually implies that an implementation error has occurred.",,Unknown,
660 CWE-201,Information Exposure Through Sent Data (Type: Variant),The accidental exposure of sensitive information through sent data refers to the transmission of data which are either sensitive in and of itself or useful in the further exploitation of the system through standard data channels.,"The information either
661 is regarded as sensitive within the product's own functionality, such as a private message; or
662 provides information about the product or its environment that could be useful in an attack but is normally not available to the attacker, such as the installation path of a product that is remotely accessible.
663 Many information exposures are resultant (e.g. PHP script error revealing the full path of the program), but they can also be primary (e.g. timing discrepancies in cryptography). There are many different types of problems that involve information exposures. Their severity can range widely depending on the type of information that is revealed.",,Unknown,
664 CWE-203,Information Exposure Through Discrepancy (Type: Class),"The product behaves differently or sends different responses in a way that exposes security-relevant information about the state of the product, such as whether a particular operation was successful or not.","In situations where data should not be tied to individual users, but a large number of users should be able to make queries that ""scrub"" the identity of users, it may be possible to get information about a user -- e.g., by specifying search terms that are known to be unique to that user.",,Unknown,
665 CWE-204,Response Discrepancy Information Exposure (Type: Base),The software provides different responses to incoming requests in a way that allows an actor to determine system state information that is outside of that actor's control sphere.,"This issue frequently occurs during authentication, where a difference in failed-login messages could allow an attacker to determine if the username is valid or not. These exposures can be inadvertent (bug) or intentional (design).",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
666 CWE-205,Information Exposure Through Behavioral Discrepancy (Type: Base),The product's actions indicate important differences based on (1) the internal state of the product or (2) differences from other products in the same class.,"For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
667 CWE-206,Information Exposure of Internal State Through Behavioral Inconsistency (Type: Variant),"Two separate operations in a product cause the product to behave differently in a way that is observable to an attacker and reveals security-relevant information about the internal state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
668 CWE-207,Information Exposure Through an External Behavioral Inconsistency (Type: Variant),"The product behaves differently than other products like it, in a way that is observable to an attacker and exposes security-relevant information about which product is being used.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
669 CWE-208,Information Exposure Through Timing Discrepancy (Type: Base),"Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.","For example, attacks such as OS fingerprinting rely heavily on both behavioral and response discrepancies.",,Unknown,
670 CWE-210,Information Exposure Through Self-generated Error Message (Type: Base),The software identifies an error condition and creates its own diagnostic or error messages that contain sensitive information.,"The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191
671 The Art of Software Security Assessment: Chapter 3, ""Overly Verbose Error Messages"", Page 75."
672 CWE-211,Information Exposure Through Externally-generated Error Message (Type: Base),"The software performs an operation that triggers an external diagnostic or error message that is not directly generated by the software, such as an error generated by the programming language interpreter that the software uses. The error can contain sensitive system information.","The sensitive information may be valuable information on its own (such as a password), or it may be useful for launching other, more deadly attacks. If an attack fails, an attacker may use error information provided by the server to launch another more focused attack. For example, an attempt to exploit a path traversal weakness (CWE-22) might yield the full pathname of the installed application. In turn, this could be used to select the proper number of "".."" sequences to navigate to the targeted file. An attack using SQL injection (CWE-89) might not initially succeed, but an error message could reveal the malformed query, which would expose query logic and possibly even passwords or other sensitive information used within the query.",,Unknown,
673 CWE-212,Improper Cross-boundary Removal of Sensitive Data (Type: Base),"The software uses a resource that contains sensitive data, but it does not properly remove that data before it stores, transfers, or shares the resource with actors in another control sphere.","Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
674 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
675 CWE-213,Intentional Information Exposure (Type: Base),A product's design or configuration explicitly requires the publication of information that could be regarded as sensitive by an administrator.,"Resources that may contain sensitive data include documents, packets, messages, databases, etc. While this data may be useful to an individual user or small set of users who share the resource, it may need to be removed before the resource can be shared outside of the trusted group. The process of removal is sometimes called cleansing or scrubbing.
676 For example, software that is used for editing documents might not remove sensitive data such as reviewer comments or the local pathname where the document is stored. Or, a proxy might not remove an internal IP address from headers before making an outgoing request to an Internet site.",,Unknown,
677 CWE-214,Information Exposure Through Process Environment (Type: Variant),"A process is invoked with sensitive arguments, environment variables, or other elements that can be seen by other processes on the operating system.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
678 CWE-215,Information Exposure Through Debug Information (Type: Variant),The application contains debugging code that can expose sensitive information to untrusted parties.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
679 CWE-216,Containment Errors (Container Errors) (Type: Class),"This tries to cover various problems in which improper data are included within a ""container.""","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
680 CWE-217,DEPRECATED: Failure to Protect Stored Data from Modification (Type: Base),This weakness has been deprecated because it incorporated and confused multiple weaknesses. The issues formerly covered in this weakness can be found at CWE-766 and CWE-767.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
681 CWE-218,DEPRECATED (Duplicate): Failure to provide confidentiality for stored data (Type: Base),This weakness has been deprecated because it was a duplicate of CWE-493. All content has been transferred to CWE-493.,"Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
682 CWE-219,Sensitive Data Under Web Root (Type: Variant),"The application stores sensitive data under the web document root with insufficient access control, which might make it accessible to untrusted parties.","Many operating systems allow a user to list information about processes that are owned by other users. This information could include command line arguments or environment variable settings. When this data contains sensitive information such as credentials, it might allow other users to launch an attack against the software or related resources.",,Unknown,
683 CWE-220,Sensitive Data Under FTP Root (Type: Variant),"The application stores sensitive data under the FTP document root with insufficient access control, which might make it accessible to untrusted parties.","Many file operations are intended to take place within a restricted directory. By using special elements such as "".."" and ""/"" separators, attackers can escape outside of the restricted location to access files or directories that are elsewhere on the system. One of the most common special elements is the ""../"" sequence, which in most modern operating systems is interpreted as the parent directory of the current location. This is referred to as relative path traversal. Path traversal also covers the use of absolute pathnames such as ""/usr/local/bin"", which may also be useful in accessing unexpected files. This is referred to as absolute path traversal.
684 In many programming languages, the injection of a null byte (the 0 or NUL) may allow an attacker to truncate a generated filename to widen the scope of attack. For example, the software may add "".txt"" to any pathname, thus limiting the attacker to text files, but a null injection may effectively remove this restriction.",,Unknown,
685 CWE-221,Information Loss or Omission (Type: Class),"The software does not record, or improperly records, security-relevant information that leads to an incorrect decision or hampers later analysis.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
686 CWE-222,Truncation of Security-relevant Information (Type: Base),"The application truncates the display, recording, or processing of security-relevant information in a way that can obscure the source or nature of an attack.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
687 CWE-223,Omission of Security-relevant Information (Type: Base),"The application does not record or display information that would be important for identifying the source or nature of an attack, or determining if an action is safe.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Accountability"", Page 40."
688 CWE-224,Obscured Security-relevant Information by Alternate Name (Type: Base),"The software records security-relevant information according to an alternate name of the affected entity, instead of the canonical name.","This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,Writing Secure Code
689 CWE-225,DEPRECATED (Duplicate): General Information Management Problems (Type: Base),This weakness can be found at CWE-199.,"This can be resultant, e.g. a buffer overflow might trigger a crash before the product can log the event.",,Unknown,
690 CWE-226,Sensitive Information Uncleared Before Release (Type: Base),"The software does not fully clear previously used information in a data structure, file, or other resource, before making that resource available to a party in another control sphere.","This typically results from new data that is not as long as the old data, which leaves portions of the old data still available. Equivalent errors can occur in other situations where the length of data is variable but the associated data structure is not. If memory is not cleared after use, it may allow unintended actors to read the data when the memory is reallocated.",,Unknown,
691 CWE-227,Improper Fulfillment of API Contract (API Abuse) (Type: Class),The software uses an API in a manner contrary to its intended use.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
692 CWE-228,Improper Handling of Syntactically Invalid Structure (Type: Class),The product does not handle or incorrectly handles input that is not syntactically well-formed with respect to the associated specification.,"An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
693 CWE-229,Improper Handling of Values (Type: Base),"The software does not properly handle when the expected number of values for parameters, fields, or arguments is not provided in input, or if those values are undefined.","An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated.",,Unknown,
694 CWE-23,Relative Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as "".."" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"OWASP Attack listing: http://www.owasp.org/index.php/Relative_Path_Traversal
695 The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
696 CWE-230,Improper Handling of Missing Values (Type: Variant),"The software does not handle or incorrectly handles when a parameter, field, or argument name is specified, but the associated value is missing, i.e. it is empty, blank, or null.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
697 CWE-231,Improper Handling of Extra Values (Type: Variant),The software does not handle or incorrectly handles when more values are provided than expected.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
698 CWE-232,Improper Handling of Undefined Values (Type: Variant),"The software does not handle or incorrectly handles when a value is not defined or supported for the associated parameter, field, or argument name.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
699 CWE-233,Improper Handling of Parameters (Type: Base),"The software does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
700 CWE-235,Improper Handling of Extra Parameters (Type: Variant),"The software does not handle or incorrectly handles when the number of parameters, fields, or arguments with the same name exceeds the expected amount.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
701 CWE-236,Improper Handling of Undefined Parameters (Type: Variant),"The software does not handle or incorrectly handles when a particular parameter, field, or argument name is not defined or supported by the product.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
702 CWE-237,Improper Handling of Structural Elements (Type: Base),The software does not handle or incorrectly handles inputs that are related to complex structures.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
703 CWE-238,Improper Handling of Incomplete Structural Elements (Type: Variant),The software does not handle or incorrectly handles when a particular structural element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
704 CWE-239,Failure to Handle Incomplete Element (Type: Variant),The software does not properly handle when a particular element is not completely specified.,This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,
705 CWE-24,Path Traversal: ../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
706 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
707 CWE-240,Improper Handling of Inconsistent Structural Elements (Type: Variant),"The software does not handle or incorrectly handles when two or more structural elements should be consistent, but are not.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
708 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
709 CWE-241,Improper Handling of Unexpected Data Type (Type: Base),"The software does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
710 The ""../"" manipulation is the canonical manipulation for operating systems that use ""/"" as directory separators, such as UNIX- and Linux-based systems. In some cases, it is useful for bypassing protection schemes in environments for which ""/"" is supported but not the primary separator, such as Windows, which uses ""\"" but can also accept ""/"".",,Unknown,
711 CWE-244,Improper Clearing of Heap Memory Before Release (Heap Inspection) (Type: Variant),"Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
712 CWE-245,J2EE Bad Practices: Direct Management of Connections (Type: Variant),"The J2EE application directly manages connections, instead of using the container's connection management facilities.","When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
713 CWE-246,J2EE Bad Practices: Direct Use of Sockets (Type: Variant),The J2EE application directly uses sockets instead of using framework method calls.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
714 CWE-247,DEPRECATED (Duplicate): Reliance on DNS Lookups in a Security Decision (Type: Base),This entry has been deprecated because it was a duplicate of CWE-350. All content has been transferred to CWE-350.,"When sensitive data such as a password or an encryption key is not removed from memory, it could be exposed to an attacker using a ""heap inspection"" attack that reads the sensitive data using memory dumps or other methods. The realloc() function is commonly used to increase the size of a block of allocated memory. This operation often requires copying the contents of the old memory block into a new and larger block. This operation leaves the contents of the original block intact but inaccessible to the program, preventing the program from being able to scrub sensitive data from memory. If an attacker can later examine the contents of a memory dump, the sensitive data could be exposed.",,Unknown,
715 CWE-248,Uncaught Exception (Type: Base),"An exception is thrown from a function, but it is not caught.","When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
716 CWE-249,DEPRECATED: Often Misused: Path Manipulation (Type: Variant),This entry has been deprecated because of name confusion and an accidental combination of multiple weaknesses. Most of its content has been transferred to CWE-785.,"When an exception is not caught, it may cause the program to crash or expose sensitive information.",,Unknown,
717 CWE-25,Path Traversal: /../filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
718 Sometimes a program checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
719 CWE-26,Path Traversal: /dir/../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""/dir/../filename"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
720 The '/dir/../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""../"" at the beginning of the input, so a ""/../"" can bypass that check.",,Unknown,
721 CWE-260,Password in Configuration File (Type: Variant),The software stores a password in a configuration file that might be accessible to actors who do not know the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
722 CWE-261,Weak Cryptography for Passwords (Type: Variant),Obscuring a password with a trivial encoding does not protect the password.,"This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Unknown,"Building Secure Software: How to Avoid Security Problems the Right Way
723 24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
724 CWE-266,Incorrect Privilege Assignment (Type: Base),"A product incorrectly assigns a privilege to a particular actor, creating an unintended sphere of control for that actor.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
725 CWE-267,Privilege Defined With Unsafe Actions (Type: Base),"A particular privilege, role, capability, or right can be used to perform unsafe actions that were not intended, even when it is assigned to the correct entity.","Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Unknown,Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
726 CWE-27,Path Traversal: dir/../../filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize multiple internal ""../"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
727 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,
728 CWE-270,Privilege Context Switching Error (Type: Base),The software does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
729 The 'directory/../../filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""../"" sequence, so multiple ""../"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""../"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"Writing Secure Code: Chapter 7, ""Running with Least Privilege"" Page 207
730 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
731 CWE-272,Least Privilege Violation (Type: Base),The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.,"In some contexts, a system executing with elevated permissions will hand off a process/file/etc. to another process or user. If the privileges of an entity are not reduced, then elevated privileges are spread throughout a system and possibly to an attacker.",,Unknown,
732 CWE-274,Improper Handling of Insufficient Privileges (Type: Base),"The software does not handle or incorrectly handles when it has insufficient privileges to perform an operation, leading to resultant weaknesses.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
733 CWE-277,Insecure Inherited Permissions (Type: Variant),A product defines a set of insecure permissions that are inherited by objects that are created by the program.,"If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
734 CWE-278,Insecure Preserved Inherited Permissions (Type: Variant),"A product inherits a set of insecure permissions for an object, e.g. when copying from an archive file, without user awareness or involvement.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
735 CWE-279,Incorrect Execution-Assigned Permissions (Type: Variant),"While it is executing, the software sets the permissions of an object in a way that violates the intended permissions that have been specified by the user.","If the drop fails, the software will continue to run with the raised privileges, which might provide additional access to unprivileged users.",,Unknown,
736 CWE-28,Path Traversal: ..\filedir (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize ""..\"" sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
737 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
738 CWE-280,Improper Handling of Insufficient Permissions or Privileges (Type: Base),The application does not handle or incorrectly handles when it has insufficient privileges to access resources or functionality as specified by their permissions. This may cause it to follow unexpected code paths that may leave the application in an invalid state.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
739 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
740 CWE-281,Improper Preservation of Permissions (Type: Base),"The software does not preserve permissions or incorrectly preserves permissions when copying, restoring, or sharing objects, which can cause them to have less restrictive permissions than intended.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
741 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
742 CWE-282,Improper Ownership Management (Type: Class),"The software assigns the wrong ownership, or does not properly verify the ownership, of an object or resource.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
743 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
744 CWE-283,Unverified Ownership (Type: Base),The software does not properly verify that a critical resource is owned by the proper entity.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
745 The '..\' manipulation is the canonical manipulation for operating systems that use ""\"" as directory separators, such as Windows. However, it is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
746 CWE-284,Improper Access Control (Type: Class),The software does not restrict or incorrectly restricts access to a resource from an unauthorized actor.,"Access control involves the use of several protection mechanisms such as authentication (proving the identity of an actor) authorization (ensuring that a given actor can access a resource), and accountability (tracking of activities that were performed). When any mechanism is not applied or otherwise fails, attackers can compromise the security of the software by gaining privileges, reading sensitive information, executing commands, evading detection, etc.
747 There are two distinct behaviors that can introduce access control weaknesses:
748 Specification: incorrect privileges, permissions, ownership, etc. are explicitly specified for either the user or the resource (for example, setting a password file to be world-writable, or giving administrator capabilities to a guest user). This action could be performed by the program or the administrator.
749 Enforcement: the mechanism contains errors that prevent it from properly enforcing the specified access control requirements (e.g., allowing the user to specify their own privileges, or allowing a syntactically-incorrect ACL to produce insecure settings). This problem occurs within the program itself, in that it does not actually enforce the intended security policy that the administrator specifies.",,Unknown,"Writing Secure Code: Chapter 6, ""Determining Appropriate Access Control"" Page 171
750 24 Deadly Sins of Software Security: ""Sin 17: Failure to Protect Stored Data."" Page 253"
751 CWE-286,Incorrect User Management (Type: Class),The software does not properly manage a user within its environment.,Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
752 CWE-288,Authentication Bypass Using an Alternate Path or Channel (Type: Base),"A product requires authentication, but the product has an alternate path or channel that does not require authentication.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
753 CWE-289,Authentication Bypass by Alternate Name (Type: Variant),"The software performs authentication based on the name of a resource being accessed, or the name of the actor performing the access, but it does not properly check all possible names for that resource or actor.",Users can be assigned to the wrong group (class) of permissions resulting in unintended access rights to sensitive objects.,,Unknown,
754 CWE-29,Path Traversal: \..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
755 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,
756 CWE-290,Authentication Bypass by Spoofing (Type: Base),This attack-focused weakness is caused by improperly implemented authentication schemes that are subject to spoofing attacks.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
757 This is similar to CWE-25, except using ""\"" instead of ""/"". Sometimes a program checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check. It is also useful for bypassing path traversal protection schemes that only assume that the ""/"" separator is valid.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""Spoofing and Identification"", Page 72."
758 CWE-295,Improper Certificate Validation (Type: Base),"The software does not validate, or incorrectly validates, a certificate.","When a certificate is invalid or malicious, it might allow an attacker to spoof a trusted entity by using a man-in-the-middle (MITM) attack. The software might connect to a malicious host while believing it is a trusted host, or the software might be deceived into accepting spoofed data that appears to originate from a trusted host.",,Unknown,"Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security: http://www2.dcsec.uni-hannover.de/files/android/p50-fahl.pdf
759 Computer Security: Art and Science"
760 CWE-30,Path Traversal: \dir\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\dir\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
761 This is similar to CWE-26, except using ""\"" instead of ""/"". The '\dir\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only checks for ""..\"" at the beginning of the input, so a ""\..\"" can bypass that check.",,Unknown,
762 CWE-300,Channel Accessible by Non-Endpoint (Man-in-the-Middle) (Type: Class),"The product does not adequately verify the identity of actors at both ends of a communication channel, or does not adequately ensure the integrity of the channel, in a way that allows the channel to be accessed or influenced by an actor that is not an endpoint.","In order to establish secure communication between two parties, it is often important to adequately verify the identity of entities at each end of the communication channel. Inadequate or inconsistent verification may result in insufficient or incorrect identification of either communicating entity. This can have negative consequences such as misplaced trust in the entity at the other end of the channel. An attacker can leverage this by interposing between the communicating entities and masquerading as the original entity. In the absence of sufficient verification of identity, such an attacker can eavesdrop and potentially modify the communication between the original entities.",,Unknown,Computer Security: Art and Science
763 CWE-302,Authentication Bypass by Assumed-Immutable Data (Type: Variant),"The authentication scheme or implementation uses key data elements that are assumed to be immutable, but can be controlled or modified by the attacker.","A mutual authentication protocol requires each party to respond to a random challenge by the other party by encrypting it with a pre-shared key. Often, however, such protocols employ the same pre-shared key for communication with a number of different entities. A malicious user or an attacker can easily compromise this protocol without possessing the correct key by employing a reflection attack on the protocol.",,Unknown,
764 CWE-303,Incorrect Implementation of Authentication Algorithm (Type: Base),"The requirements for the software dictate the use of an established authentication algorithm, but the implementation of the algorithm is incorrect.",This incorrect implementation may allow authentication to be bypassed.,,Unknown,
765 CWE-304,Missing Critical Step in Authentication (Type: Base),"The software implements an authentication technique, but it skips a step that weakens the technique.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
766 CWE-305,Authentication Bypass by Primary Weakness (Type: Base),"The authentication algorithm is sound, but the implemented mechanism can be bypassed as the result of a separate weakness that is primary to the authentication error.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,
767 CWE-307,Improper Restriction of Excessive Authentication Attempts (Type: Base),"The software does not implement sufficient measures to prevent multiple failed authentication attempts within in a short time frame, making it more susceptible to brute force attacks.","Authentication techniques should follow the algorithms that define them exactly, otherwise authentication can be bypassed or more easily subjected to brute force attacks.",,Unknown,"Weak Password Brings 'Happiness' to Twitter Hacker: http://www.wired.com/threatlevel/2009/01/professed-twitt/
768 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
769 CWE-31,Path Traversal: dir\..\..\filename (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize 'dir\..\..\filename' (multiple internal backslash dot dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
770 The 'dir\..\..\filename' manipulation is useful for bypassing some path traversal protection schemes. Sometimes a program only removes one ""..\"" sequence, so multiple ""..\"" can bypass that check. Alternately, this manipulation could be used to bypass a check for ""..\"" at the beginning of the pathname, moving up more than one directory level.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
771 CWE-312,Cleartext Storage of Sensitive Information (Type: Base),The application stores sensitive information in cleartext within a resource that might be accessible to another control sphere.,"Because the information is stored in cleartext, attackers could potentially read it. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,"Writing Secure Code: Chapter 9, ""Protecting Secret Data"" Page 299
772 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Encryption"", Page 43.
773 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
774 CWE-313,Cleartext Storage in a File or on Disk (Type: Variant),"The application stores sensitive information in cleartext in a file, or on disk.","The sensitive information could be read by attackers with access to the file, or with physical or administrator access to the raw disk. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
775 CWE-314,Cleartext Storage in the Registry (Type: Variant),The application stores sensitive information in cleartext in the registry.,"Attackers can read the information by accessing the registry key. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
776 CWE-315,Cleartext Storage of Sensitive Information in a Cookie (Type: Variant),The application stores sensitive information in cleartext in a cookie.,"Attackers can use widely-available tools to view the cookie and read the sensitive information. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
777 CWE-316,Cleartext Storage of Sensitive Information in Memory (Type: Variant),The application stores sensitive information in cleartext in memory.,"The sensitive memory might be saved to disk, stored in a core dump, or remain uncleared if the application crashes, or if the programmer does not properly clear the memory before freeing it.
778 It could be argued that such problems are usually only exploitable by those with administrator privileges. However, swapping could cause the memory to be written to disk and leave it accessible to physical attack afterwards. Core dump files might have insecure permissions or be stored in archive files that are accessible to untrusted people. Or, uncleared sensitive memory might be inadvertently exposed to attackers due to another weakness.",,Unknown,
779 CWE-317,Cleartext Storage of Sensitive Information in GUI (Type: Variant),The application stores sensitive information in cleartext within the GUI.,"An attacker can often obtain data from a GUI, even if hidden, by using an API to directly access GUI objects such as windows and menus. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
780 CWE-318,Cleartext Storage of Sensitive Information in Executable (Type: Variant),The application stores sensitive information in cleartext in an executable.,"Attackers can reverse engineer binary code to obtain secret data. This is especially easy when the cleartext is plain ASCII. Even if the information is encoded in a way that is not human-readable, certain techniques could determine which encoding is being used, then decode the information.",,Unknown,
781 CWE-32,Path Traversal: ... (Triple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '...' (triple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
782 The '...' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
783 CWE-325,Missing Required Cryptographic Step (Type: Base),"The software does not implement a required step in a cryptographic algorithm, resulting in weaker encryption than advertised by that algorithm.","Cryptographic implementations should follow the algorithms that define them exactly, otherwise encryption can be weaker than expected.",,Unknown,
784 CWE-326,Inadequate Encryption Strength (Type: Class),"The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.",A weak encryption scheme can be subjected to brute force attacks that have a reasonable chance of succeeding using current attack methods and resources.,,Unknown,"Writing Secure Code: Chapter 8, ""Cryptographic Foibles"" Page 259
785 24 Deadly Sins of Software Security: ""Sin 21: Using the Wrong Cryptography."" Page 315"
786 CWE-328,Reversible One-Way Hash (Type: Base),"The product uses a hashing algorithm that produces a hash value that can be used to determine the original input, or to find an input that can produce the same hash, more efficiently than brute force techniques.","This weakness is especially dangerous when the hash is used in security algorithms that require the one-way property to hold. For example, if an authentication system takes an incoming password and generates a hash, then compares the hash to another hash that it has stored in its authentication database, then the ability to create a collision could allow an attacker to provide an alternate password that produces the same target hash, bypassing authentication.",,Unknown,"MD5 considered harmful today: http://www.phreedom.org/research/rogue-ca/
787 The Art of Software Security Assessment: Chapter 2, ""Common Vulnerabilities of Integrity"", Page 47.
788 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
789 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
790 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
791 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
792 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
793 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
794 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
795 CWE-33,Path Traversal: .... (Multiple Dot) (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....' (multiple dot) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
796 The '....' manipulation is useful for bypassing some path traversal protection schemes. On some Windows systems, it is equivalent to ""..\..\.."" and might bypass checks that assume only two dots are valid. Incomplete filtering, such as removal of ""./"" sequences, can ultimately produce valid "".."" sequences due to a collapse into unsafe value (CWE-182).",,Unknown,
797 CWE-331,Insufficient Entropy (Type: Base),"The software uses an algorithm or scheme that produces insufficient entropy, leaving patterns or clusters of values that are more likely to occur than others.","When software generates predictable values in a context requiring unpredictability, it may be possible for an attacker to guess the next value that will be generated, and use this guess to impersonate another user or access sensitive information.",,Unknown,Building Secure Software: How to Avoid Security Problems the Right Way
798 CWE-334,Small Space of Random Values (Type: Base),"The number of possible random values is smaller than needed by the product, making it more susceptible to brute force attacks.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
799 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
800 CWE-335,PRNG Seed Error (Type: Class),A Pseudo-Random Number Generator (PRNG) uses seeds incorrectly.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
801 CWE-336,Same Seed in PRNG (Type: Base),"A PRNG uses the same seed each time the product is initialized. If an attacker can guess (or knows) the seed, then he/she may be able to determine the ""random"" number produced from the PRNG.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
802 CWE-337,Predictable Seed in PRNG (Type: Base),"A PRNG is initialized from a predictable seed, e.g. using process ID or system time.",The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
803 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
804 CWE-339,Small Seed Space in PRNG (Type: Base),A PRNG uses a relatively small space of seeds.,The rate at which true random numbers can be generated is limited. It is important that one uses them only when they are needed for security.,,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
805 CWE-34,Path Traversal: ....// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '....//' (doubled dot dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
806 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,
807 CWE-340,Predictability Problems (Type: Class),Weaknesses in this category are related to schemes that generate numbers or identifiers that are more predictable than required by the application.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
808 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
809 CWE-341,Predictable from Observable State (Type: Base),"A number or object is predictable based on observations that the attacker can make about the state of the system or network, such as time, process ID, etc.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
810 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
811 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
812 CWE-342,Predictable Exact Value from Previous Values (Type: Base),An exact value or random number can be precisely predicted by observing previous values.,"This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
813 The '....//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then ""....//"" can collapse into the ""../"" unsafe value (CWE-182). It could also be useful when "".."" is removed, if the operating system treats ""//"" and ""/"" as equivalent.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
814 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
815 CWE-343,Predictable Value Range from Previous Values (Type: Base),"The software's random number generator produces a series of values which, when observed, can be used to infer a relatively small range of possibilities for the next value that could be generated.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
816 Strange Attractors and TCP/IP Sequence Number Analysis: http://www.bindview.com/Services/Razor/Papers/2001/tcpseq.cfm
817 24 Deadly Sins of Software Security: ""Sin 20: Weak Random Numbers."" Page 299"
818 CWE-344,Use of Invariant Value in Dynamically Changing Context (Type: Base),"The product uses a constant value, name, or reference, but this value can (or should) vary across different environments.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
819 CWE-345,Insufficient Verification of Data Authenticity (Type: Class),"The software does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231"
820 CWE-346,Origin Validation Error (Type: Base),The software does not properly verify that the source of data or communication is valid.,"The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
821 CWE-347,Improper Verification of Cryptographic Signature (Type: Base),"The software does not verify, or incorrectly verifies, the cryptographic signature for data.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
822 CWE-348,Use of Less Trusted Source (Type: Base),"The software has two different sources of the same data or information, but it uses the source that has less support for verification, is less trusted, or is less resistant to attack.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
823 CWE-349,Acceptance of Extraneous Untrusted Data With Trusted Data (Type: Base),"The software, when processing trusted data, accepts any untrusted data that is also included with the trusted data, treating the untrusted data as if it were trusted.","The output of a random number generator should not be predictable based on observations of previous values. In some cases, an attacker cannot predict the exact value that will be produced next, but can narrow down the possibilities significantly. This reduces the amount of effort to perform a brute force attack. For example, suppose the product generates random numbers between 1 and 100, but it always produces a larger value until it reaches 100. If the generator produces an 80, then the attacker knows that the next value will be somewhere between 81 and 100. Instead of 100 possibilities, the attacker only needs to consider 20.",,Unknown,
824 CWE-35,Path Traversal: .../...// (Type: Variant),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '.../...//' (doubled triple dot slash) sequences that can resolve to a location that is outside of that directory.","This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.
825 The '.../...//' manipulation is useful for bypassing some path traversal protection schemes. If ""../"" is filtered in a sequential fashion, as done by some regular expression engines, then "".../...//"" can collapse into the ""../"" unsafe value (CWE-182). Removing the first ""../"" yields ""....//""; the second removal yields ""../"". Depending on the algorithm, the software could be susceptible to CWE-34 but not CWE-35, or vice versa.",,Unknown,
826 CWE-350,Reliance on Reverse DNS Resolution for a Security-Critical Action (Type: Variant),"The software performs reverse DNS resolution on an IP address to obtain the hostname and make a security decision, but it does not properly ensure that the IP address is truly associated with the hostname.","When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
827 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
828 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 15: Not Updating Easily."" Page 231
829 24 Deadly Sins of Software Security: ""Sin 24: Trusting Network Name Resolution."" Page 361
830 The Art of Software Security Assessment: Chapter 16, ""DNS Spoofing"", Page 1002."
831 CWE-351,Insufficient Type Distinction (Type: Base),The software does not properly distinguish between different types of elements in a way that leads to insecure behavior.,"When the software performs a reverse DNS resolution for an IP address, if an attacker controls the server for that IP address, then the attacker can cause the server to return an arbitrary hostname. As a result, the attacker may be able to bypass authentication, cause the wrong hostname to be recorded in log files to hide activities, or perform other attacks.
832 Attackers can spoof DNS names by either (1) compromising a DNS server and modifying its records (sometimes called DNS cache poisoning), or (2) having legitimate control over a DNS server associated with their IP address.
833 Since DNS names can be easily spoofed or misreported, and it may be difficult for the software to detect if a trusted DNS server has not been compromised, they do not constitute a valid authentication mechanism.",,Unknown,
834 CWE-356,Product UI does not Warn User of Unsafe Actions (Type: Base),The software's user interface does not warn the user before undertaking an unsafe action on behalf of that user. This makes it easier for attackers to trick users into inflicting damage to their system.,"Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
835 CWE-357,Insufficient UI Warning of Dangerous Operations (Type: Base),"The user interface provides a warning to a user regarding dangerous or sensitive operations, but the warning is not noticeable enough to warrant attention.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
836 CWE-358,Improperly Implemented Security Check for Standard (Type: Base),"The software does not implement or incorrectly implements one or more security-relevant checks as specified by the design of a standardized algorithm, protocol, or technique.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,
837 CWE-359,Privacy Violation (Type: Class),"Mishandling private information, such as customer passwords or social security numbers, can compromise user privacy and is often illegal.","Software systems should warn users that a potentially dangerous action may occur if the user proceeds. For example, if the user downloads a file from an unknown source and attempts to execute the file on their machine, then the application's GUI can indicate that the file is unsafe.",,Unknown,"AOL man pleads guilty to selling 92m email addies: http://www.theregister.co.uk/2005/02/07/aol_email_theft/
838 Safe Harbor Privacy Framework: http://www.export.gov/safeharbor/
839 Financial Privacy: The Gramm-Leach Bliley Act (GLBA): http://www.ftc.gov/privacy/glbact/index.html
840 Health Insurance Portability and Accountability Act (HIPAA): http://www.hhs.gov/ocr/hipaa/
841 California SB-1386: http://info.sen.ca.gov/pub/01-02/bill/sen/sb_1351-1400/sb_1386_bill_20020926_chaptered.html
842 SECURITY REQUIREMENTS FOR CRYPTOGRAPHIC MODULES: http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf
843 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
844 CWE-36,Absolute Path Traversal (Type: Base),"The software uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as ""/abs/path"" that can resolve to a location that is outside of that directory.",This allows attackers to traverse the file system to access files or directories that are outside of the restricted directory.,,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Filenames and Paths"", Page 503."
845 CWE-363,Race Condition Enabling Link Following (Type: Base),"The software checks the status of a file or directory before accessing it, which produces a race condition in which the file can be replaced with a link before the access is performed, causing the software to access the wrong file.","While developers might expect that there is a very narrow time window between the time of check and time of use, there is still a race condition. An attacker could cause the software to slow down (e.g. with memory consumption), causing the time window to become larger. Alternately, in some situations, the attacker could win the race by performing a large number of attacks.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Race Conditions"", Page 526."
846 CWE-368,Context Switching Race Condition (Type: Base),"A product performs a series of non-atomic actions to switch between contexts that cross privilege or other security boundaries, but a race condition allows an attacker to modify or misrepresent the product's behavior during the switch.","This is commonly seen in web browser vulnerabilities in which the attacker can perform certain actions while the browser is transitioning from a trusted to an untrusted domain, or vice versa, and the browser performs the actions on one domain using the trust level and resources of the other domain.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
847 CWE-37,Path Traversal: /absolute/pathname/here (Type: Variant),A software system that accepts input in the form of a slash absolute path ('/absolute/pathname/here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This weakness typically occurs when an unexpected value is provided to the product, or if an error occurs that is not properly detected. It frequently occurs in calculations involving physical dimensions such as size, length, width, and height.",,Unknown,
848 CWE-372,Incomplete Internal State Distinction (Type: Base),"The software does not properly determine which state it is in, causing it to assume it is in state X when in fact it is in state Y, causing it to perform incorrect operations in a security-relevant manner.","If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
849 CWE-373,DEPRECATED: State Synchronization Error (Type: Base),This entry was deprecated because it overlapped the same concepts as race condition (CWE-362) and Improper Synchronization (CWE-662).,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,
850 CWE-377,Insecure Temporary File (Type: Base),Creating and using insecure temporary files can leave application and system data vulnerable to attack.,"If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.",,Unknown,"Writing Secure Code: Chapter 23, ""Creating Temporary Files Securely"" Page 682
851 The Art of Software Security Assessment: Chapter 9, ""Temporary Files"", Page 538.
852 The Art of Software Security Assessment: Chapter 11, ""File Squatting"", Page 662."
853 CWE-38,Path Traversal: \absolute\pathname\here (Type: Variant),A software system that accepts input in the form of a backslash absolute path ('\absolute\pathname\here') without appropriate validation can allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
854 CWE-382,J2EE Bad Practices: Use of System.exit() (Type: Variant),"A J2EE application uses System.exit(), which also shuts down its container.","On some operating systems, the fact that the temporary file exists may be apparent to any user with sufficient privileges to access that directory. Since the file is visible, the application that is using the temporary file could be known. If one has access to list the processes on the system, the attacker has gained information about what the user is doing at that time. By correlating this with the applications the user is running, an attacker could potentially discover what a user's actions are. From this, higher levels of security could be breached.",,Unknown,
855 CWE-383,J2EE Bad Practices: Direct Use of Threads (Type: Variant),Thread management in a Web application is forbidden in some circumstances and is always highly error prone.,"Thread management in a web application is forbidden by the J2EE standard in some circumstances and is always highly error prone. Managing threads is difficult and is likely to interfere in unpredictable ways with the behavior of the application container. Even without interfering with the container, thread management usually leads to bugs that are hard to detect and diagnose like deadlock, race conditions, and other synchronization errors.",,Unknown,
856 CWE-386,Symbolic Name not Mapping to Correct Object (Type: Base),"A constant symbolic reference to an object is used, even though the reference can resolve to a different object over time.","In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
857 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
858 CWE-39,Path Traversal: C:dirname (Type: Variant),An attacker can inject a drive letter or Windows volume letter ('C:dirname') into a software system to potentially redirect access to an unintended location or arbitrary file.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
859 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
860 CWE-392,Missing Report of Error Condition (Type: Base),The software encounters an error but does not provide a status code or return value to indicate that an error has occurred.,"In some instances, knowing when data is transmitted between parties can provide a malicious user with privileged information. Also, externally monitoring the timing of operations can potentially reveal sensitive data. For example, a cryptographic operation can expose its internal state if the time it takes to perform the operation varies, based on the state.
861 Covert channels are frequently classified as either storage or timing channels. Some examples of covert timing channels are the system's paging rate, the time a certain transaction requires to execute, and the time it takes to gain access to a shared bus.",,Unknown,
862 CWE-393,Return of Wrong Status Code (Type: Base),"A function or operation returns an incorrect return value or status code that does not indicate an error, but causes the product to modify its behavior based on the incorrect result.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
863 CWE-394,Unexpected Status Code or Return Value (Type: Base),"The software does not properly check when a function or operation returns a value that is legitimate for the function, but is not expected by the software.","This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
864 CWE-395,Use of NullPointerException Catch to Detect NULL Pointer Dereference (Type: Base),Catching NullPointerException should not be used as an alternative to programmatic checks to prevent dereferencing a null pointer.,"This can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the software to assume that an action is safe, even when it is not.",,Unknown,
865 CWE-396,Declaration of Catch for Generic Exception (Type: Base),Catching overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Multiple catch blocks can get ugly and repetitive, but ""condensing"" catch blocks by catching a high-level class like Exception can obscure exceptions that deserve special treatment or that should not be caught at this point in the program. Catching an overly broad exception essentially defeats the purpose of Java's typed exceptions, and can become particularly dangerous if the program grows and begins to throw new types of exceptions. The new exception types will not receive any attention.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 9: Catching Exceptions."" Page 157"
866 CWE-397,Declaration of Throws for Generic Exception (Type: Base),Throwing overly broad exceptions promotes complex error handling code that is more likely to contain security vulnerabilities.,"Declaring a method to throw Exception or Throwable makes it difficult for callers to perform proper error handling and error recovery. Java's exception mechanism, for example, is set up to make it easy for callers to anticipate what can go wrong and write code to handle each specific exceptional circumstance. Declaring that a method throws a generic form of exception defeats this system.",,Unknown,
867 CWE-398,Indicator of Poor Code Quality (Type: Class),"The code has features that do not directly introduce a weakness or vulnerability, but indicate that the product has not been carefully developed or maintained.","Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,
868 CWE-40,Path Traversal: \\UNC\share\name\ (Windows UNC Share) (Type: Variant),An attacker can inject a Windows UNC share ('\\UNC\share\name') into a software system to potentially redirect access to an unintended location or arbitrary file.,"Programs are more likely to be secure when good development practices are followed. If a program is complex, difficult to maintain, not portable, or shows evidence of neglect, then there is a higher likelihood that weaknesses are buried in the code.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Filelike Objects"", Page 664."
869 CWE-402,Transmission of Private Resources into a New Sphere (Resource Leak) (Type: Class),The software makes resources available to untrusted parties when those resources are only intended to be accessed by the software.,This is often triggered by improper handling of malformed data or unexpectedly interrupted sessions.,,Unknown,
870 CWE-403,Exposure of File Descriptor to Unintended Control Sphere (File Descriptor Leak) (Type: Base),"A process does not close sensitive file descriptors before invoking a child process, which allows the child to perform unauthorized I/O operations using those descriptors.","When a new process is forked or executed, the child process inherits any open file descriptors. When the child process has fewer privileges than the parent process, this might introduce a vulnerability if the child process can access the file descriptor but does not have the privileges to access the associated file.",,Unknown,"File descriptors and setuid applications: https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
871 Introduction to Secure Coding Guide: https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/AccessControl.html"
872 CWE-405,Asymmetric Resource Consumption (Amplification) (Type: Class),Software that does not appropriately monitor or control resource consumption can lead to adverse system performance.,"This situation is amplified if the software allows malicious users or attackers to consume more resources than their access level permits. Exploiting such a weakness can lead to asymmetric resource consumption, aiding in amplification attacks against the system or the network.",,Unknown,
873 CWE-406,Insufficient Control of Network Message Volume (Network Amplification) (Type: Base),"The software does not sufficiently monitor or control transmitted network traffic volume, so that an actor can cause the software to transmit more traffic than should be allowed for that actor.","In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
874 CWE-408,Incorrect Behavior Order: Early Amplification (Type: Base),The software allows an entity to perform a legitimate but expensive operation before authentication or authorization has taken place.,"In the absence of a policy to restrict asymmetric resource consumption, the application or system cannot distinguish between legitimate transmissions and traffic intended to serve as an amplifying attack on target systems. Systems can often be configured to restrict the amount of traffic sent out on behalf of a client, based on the client's origin or access level. This is usually defined in a resource allocation policy. In the absence of a mechanism to keep track of transmissions, the system or application can be easily abused to transmit asymmetrically greater traffic than the request or client should be permitted to.",,Unknown,
875 CWE-409,Improper Handling of Highly Compressed Data (Data Amplification) (Type: Base),The software does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.,"An example of data amplification is a ""decompression bomb,"" a small ZIP file that can produce a large amount of data when it is decompressed.",,Unknown,
876 CWE-41,Improper Resolution of Path Equivalence (Type: Base),The system or application is vulnerable to file system contents disclosure through path equivalence. Path equivalence involves the use of special characters in file and directory names. The associated manipulations are intended to generate multiple names for the same object.,"Path equivalence is usually employed in order to circumvent access controls expressed using an incomplete set of file name or file path representations. This is different from path traversal, wherein the manipulations are performed to generate a name for a different object.",,Unknown,
877 CWE-410,Insufficient Resource Pool (Type: Base),"The software's resource pool is not large enough to handle peak demand, which allows an attacker to prevent others from accessing the resource by using a (relatively) large number of requests for resources.","Frequently the consequence is a ""flood"" of connection or sessions.",,Unknown,"Writing Secure Code: Chapter 17, ""Protecting Against Denial of Service Attacks"" Page 517"
878 CWE-412,Unrestricted Externally Accessible Lock (Type: Base),"The software properly checks for the existence of a lock, but the lock can be externally controlled or influenced by an actor that is outside of the intended sphere of control.","This prevents the software from acting on associated resources or performing other behaviors that are controlled by the presence of the lock. Relevant locks might include an exclusive lock or mutex, or modifying a shared resource that is treated as a lock. If the lock can be held for an indefinite period of time, then the denial of service could be permanent.",,Unknown,
879 CWE-413,Improper Resource Locking (Type: Base),The software does not lock or does not correctly lock a resource when the software must have exclusive access to the resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
880 CWE-414,Missing Lock Check (Type: Base),A product does not check to see if a lock is present before performing sensitive operations on a resource.,"When a resource is not properly locked, an attacker could modify the resource while it is being operated on by the software. This might violate the software's assumption that the resource will not change, potentially leading to unexpected behaviors.",,Unknown,
881 CWE-419,Unprotected Primary Channel (Type: Base),"The software uses a primary channel for administration or restricted functionality, but it does not properly protect the channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
882 Error conditions and other exceptional circumstances.
883 Confusion over which part of the program is responsible for freeing the memory.
884 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
885 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
886 CWE-42,Path Equivalence: filename. (Trailing Dot) (Type: Variant),A software system that accepts path input in the form of trailing dot ('filedir.') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
887 Error conditions and other exceptional circumstances.
888 Confusion over which part of the program is responsible for freeing the memory.
889 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
890 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
891 CWE-420,Unprotected Alternate Channel (Type: Base),"The software protects a primary channel, but it does not use the same level of protection for an alternate channel.","The use of previously-freed memory can have any number of adverse consequences, ranging from the corruption of valid data to the execution of arbitrary code, depending on the instantiation and timing of the flaw. The simplest way data corruption may occur involves the system's reuse of the freed memory. Use-after-free errors have two common and sometimes overlapping causes:
892 Error conditions and other exceptional circumstances.
893 Confusion over which part of the program is responsible for freeing the memory.
894 In this scenario, the memory in question is allocated to another pointer validly at some point after it has been freed. The original pointer to the freed memory is used again and points to somewhere within the new allocation. As the data is changed, it corrupts the validly used memory; this induces undefined behavior in the process.
895 If the newly allocated data chances to hold a class, in C++ for example, various function pointers may be scattered within the heap data. If one of these function pointers is overwritten with an address to valid shellcode, execution of arbitrary code can be achieved.",,Unknown,
896 CWE-421,Race Condition During Access to Alternate Channel (Type: Base),"The product opens an alternate channel to communicate with an authorized user, but the channel is accessible to other actors.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Discovering and Exploiting Named Pipe Security Flaws for Fun and Profit: http://www.blakewatts.com/namedpipepaper.html
897 24 Deadly Sins of Software Security: ""Sin 13: Race Conditions."" Page 205"
898 CWE-422,Unprotected Windows Messaging Channel (Shatter) (Type: Variant),"The software does not properly verify the source of a message in the Windows Messaging System while running at elevated privileges, creating an alternate channel through which an attacker can directly send a message to the product.",This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,"Exploiting design flaws in the Win32 API for privilege escalation. Or... Shatter Attacks - How to break Windows: http://web.archive.org/web/20060115174629/http://security.tombom.co.uk/shatter.html
899 The Art of Software Security Assessment: Chapter 2, ""Design Review."" Page 34.
900 The Art of Software Security Assessment: Chapter 12, ""Shatter Attacks"", Page 694."
901 CWE-423,DEPRECATED (Duplicate): Proxied Trusted Channel (Type: Base),This entry has been deprecated because it was a duplicate of CWE-441. All content has been transferred to CWE-441.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
902 CWE-424,Improper Protection of Alternate Path (Type: Class),The product does not sufficiently protect all possible paths that a user can take to access restricted functionality or resources.,This creates a race condition that allows an attacker to access the channel before the authorized user does.,,Unknown,
903 CWE-425,Direct Request (Forced Browsing) (Type: Base),"The web application does not adequately enforce appropriate authorization on all restricted URLs, scripts, or files.",Web applications susceptible to direct request attacks often make the false assumption that such resources can only be reached through a given navigation path and so only apply authorization at certain points in the path.,,Unknown,
904 CWE-427,Uncontrolled Search Path Element (Type: Base),"The product uses a fixed or controlled search path to find resources, but one or more locations in that path can be under the control of unintended actors.","Although this weakness can occur with any type of resource, it is frequently introduced when a product uses a directory search path to find executables or code libraries, but the path contains a directory that can be modified by an attacker, such as ""/tmp"" or the current working directory.
905 In Windows-based systems, when the LoadLibrary or LoadLibraryEx function is called with a DLL name that does not contain a fully qualified path, the function follows a search order that includes two path elements that might be uncontrolled:
906 the directory from which the program has been loaded
907 the current working directory.
908 In some cases, the attack can be conducted remotely, such as when SMB or WebDAV network shares are used.
909 In some Unix-based systems, a PATH might be created that contains an empty element, e.g. by splicing an empty variable into the PATH. This empty element can be interpreted as equivalent to the current working directory, which might be an untrusted search element.",,Unknown,"Double clicking on MS Office documents from Windows Explorer may execute arbitrary programs in some cases
910 ACROS Security: Remote Binary Planting in Apple iTunes for Windows (ASPR #2010-08-18-1)
911 Automatic Detection of Vulnerable Dynamic Component Loadings: http://www.cs.ucdavis.edu/research/tech-reports/2010/CSE-2010-2.pdf
912 Dynamic-Link Library Search Order: http://msdn.microsoft.com/en-us/library/ms682586%28v=VS.85%29.aspx
913 Dynamic-Link Library Security: http://msdn.microsoft.com/en-us/library/ff919712%28VS.85%29.aspx
914 An update on the DLL-preloading remote attack vector: http://blogs.technet.com/b/srd/archive/2010/08/23/an-update-on-the-dll-preloading-remote-attack-vector.aspx
915 Insecure Library Loading Could Allow Remote Code Execution: http://www.microsoft.com/technet/security/advisory/2269637.mspx
916 Application DLL Load Hijacking: http://blog.rapid7.com/?p=5325
917 DLL Hijacking: Facts and Fiction: http://threatpost.com/en_us/blogs/dll-hijacking-facts-and-fiction-082610"
918 CWE-428,Unquoted Search Path or Element (Type: Base),"The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.","If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Process Loading"", Page 654."
919 CWE-43,Path Equivalence: filename.... (Multiple Trailing Dot) (Type: Variant),A software system that accepts path input in the form of multiple trailing dot ('filedir....') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"If a malicious individual has access to the file system, it is possible to elevate privileges by inserting such a file as ""C:\Program.exe"" to be run by a privileged program making use of WinExec.",,Unknown,
920 CWE-430,Deployment of Wrong Handler (Type: Base),"The wrong ""handler"" is assigned to process an object.","An example of deploying the wrong handler would be calling a servlet to reveal source code of a .JSP file, or automatically ""determining"" type of the object even if it is contradictory to an explicitly specified type.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
921 CWE-431,Missing Handler (Type: Base),A handler is not available or implemented.,"When an exception is thrown and not caught, the process has given up an opportunity to decide if a given failure or event is worth a change in execution.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
922 CWE-432,Dangerous Signal Handler not Disabled During Sensitive Operations (Type: Base),"The application uses a signal handler that shares state with other signal handlers, but it does not properly mask or prevent those signal handlers from being invoked while the original signal handler is still running.","During the execution of a signal handler, it can be interrupted by another handler when a different signal is sent. If the two handlers share state - such as global variables - then an attacker can corrupt the state by sending another signal before the first handler has completed execution.",,Unknown,
923 CWE-433,Unparsed Raw Web Content Delivery (Type: Variant),The software stores raw content or supporting code under the web document root with an extension that is not specifically handled by the server.,"If code is stored in a file with an extension such as "".inc"" or "".pl"", and the web server does not have a handler for that extension, then the server will likely send the contents of the file directly to the requester without the pre-processing that was expected. When that file contains sensitive information such as database credentials, this may allow the attacker to compromise the application or associated components.",,Unknown,"The Art of Software Security Assessment: Chapter 3, ""File Handlers"", Page 74."
924 CWE-435,Interaction Error (Type: Class),"An interaction error occurs when two entities work correctly when running independently, but they interact in unexpected ways when they are run together.","This could apply to products, systems, components, etc.",,Unknown,
925 CWE-436,Interpretation Conflict (Type: Base),"Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,"On Interpretation Conflict Vulnerabilities
926 Insertion, Evasion, and Denial of Service: Eluding Network Intrusion Detection: http://www.insecure.org/stf/secnet_ids/secnet_ids.pdf
927 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
928 Poison NULL byte
929 Re: Corsaire Security Advisory - Multiple vendor MIME RFC2047 encoding: http://marc.theaimsgroup.com/?l=bugtraq&m=109525864717484&w=2"
930 CWE-437,Incomplete Model of Endpoint Features (Type: Base),"A product acts as an intermediary or monitor between two or more endpoints, but it does not have a complete model of an endpoint's features, behaviors, or state, potentially causing the product to perform incorrect actions based on this incomplete model.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
931 CWE-439,Behavioral Change in New Version or Environment (Type: Base),"A's behavior or functionality changes with a new version of A, or a new environment, which is not known (or manageable) by B.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
932 CWE-44,Path Equivalence: file.name (Internal Dot) (Type: Variant),A software system that accepts path input in the form of internal dot ('file.ordir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
933 CWE-440,Expected Behavior Violation (Type: Base),"A feature, API, or function being used by a product behaves differently than the product expects.","This is generally found in proxies, firewalls, anti-virus software, and other intermediary devices that allow, deny, or modify traffic based on how the client or server is expected to behave.",,Unknown,
934 CWE-441,Unintended Proxy or Intermediary (Confused Deputy) (Type: Class),"The software receives a request, message, or directive from an upstream component, but the software does not sufficiently preserve the original source of the request before forwarding the request to an external actor that is outside of the software's control sphere. This causes the software to appear to be the source of the request, leading it to act as a proxy or other intermediary between the upstream component and the external actor.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
935 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
936 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
937 The attacker is prevented from making the request directly to the target; and
938 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,The Confused Deputy (or why capabilities might have been invented): http://www.cap-lore.com/CapTheory/ConfusedDeputy.html
939 CWE-443,DEPRECATED (Duplicate): HTTP response splitting (Type: Base),This weakness can be found at CWE-113.,"If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
940 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
941 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
942 The attacker is prevented from making the request directly to the target; and
943 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,
944 CWE-444,Inconsistent Interpretation of HTTP Requests (HTTP Request Smuggling) (Type: Base),"When malformed or abnormal HTTP requests are interpreted by one or more entities in the data flow between the user and the web server, such as a proxy or firewall, they can be interpreted inconsistently, allowing the attacker to ""smuggle"" a request to one device without the other device being aware of it.","If an attacker cannot directly contact a target, but the software has access to the target, then the attacker can send a request to the software and have it be forwarded from the target. The request would appear to be coming from the software's system, not the attacker's system. As a result, the attacker can bypass access controls (such as firewalls) or hide the source of malicious requests, since the requests would not be coming directly from the attacker.
945 Since proxy functionality and message-forwarding often serve a legitimate purpose, this issue only becomes a vulnerability when:
946 The software runs with different privileges or on a different system, or otherwise has different levels of access than the upstream component;
947 The attacker is prevented from making the request directly to the target; and
948 The attacker can create a request that the proxy does not explicitly intend to be forwarded on the behalf of the requester. Such a request might point to an unexpected hostname, port number, or service. Or, the request might be sent to an allowed service, but the request could contain disallowed directives, commands, or resources.",,Unknown,HTTP Request Smuggling: http://www.cgisecurity.com/lib/HTTP-Request-Smuggling.pdf
949 CWE-446,UI Discrepancy for Security Feature (Type: Base),"The user interface does not correctly enable or configure a security feature, but the interface provides feedback that causes the user to believe that the feature is in a secure state.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
950 CWE-447,Unimplemented or Unsupported Feature in UI (Type: Base),"A UI function for a security feature appears to be supported and gives feedback to the user that suggests that it is supported, but the underlying functionality is not implemented.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
951 CWE-448,Obsolete Feature in UI (Type: Base),A UI function is obsolete and the product does not warn the user.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
952 CWE-449,The UI Performs the Wrong Action (Type: Base),The UI performs the wrong action with respect to the user's request.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
953 CWE-45,Path Equivalence: file...name (Multiple Internal Dot) (Type: Variant),A software system that accepts path input in the form of multiple internal dot ('file...dir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
954 CWE-450,Multiple Interpretations of UI Input (Type: Base),The UI has multiple interpretations of user input but does not prompt the user when it selects the less secure interpretation.,"When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
955 CWE-451,UI Misrepresentation of Critical Information (Type: Base),"The UI does not properly represent critical information to the user, allowing the information - or its source - to be obscured or spoofed. This is often a component in phishing attacks.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
956 CWE-453,Insecure Default Variable Initialization (Type: Base),"The software, by default, initializes an internal variable with an insecure or less secure value than is possible.","When the user interface does not properly reflect what the user asks of it, then it can lead the user into a false sense of security. For example, the user might check a box to enable a security option to enable encrypted communications, but the software does not actually enable the encryption. Alternately, the user might provide a ""restrict ALL'"" access control rule, but the software only implements ""restrict SOME"".",,Unknown,
957 CWE-454,External Initialization of Trusted Variables or Data Stores (Type: Base),The software initializes critical internal variables or data stores using inputs that can be modified by untrusted actors.,"A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
958 CWE-455,Non-exit on Failed Initialization (Type: Base),"The software does not exit or otherwise modify its operation when security-relevant errors occur during initialization, such as when a configuration file has a format error, which can cause the software to execute in a less secure fashion than intended by the administrator.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,
959 CWE-456,Missing Initialization of a Variable (Type: Base),"The software does not initialize critical variables, which causes the execution environment to use unexpected values.","A software system should be reluctant to trust variables that have been initialized outside of its trust boundary, especially if they are initialized by users. They may have been initialized incorrectly. If an attacker can initialize the variable, then he/she can influence what the vulnerable system will do.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
960 CWE-458,DEPRECATED: Incorrect Initialization (Type: Base),"This weakness has been deprecated because its name and description did not match. The description duplicated CWE-454, while the name suggested a more abstract initialization problem. Please refer to CWE-665 for the more abstract problem.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
961 CWE-459,Incomplete Cleanup (Type: Base),"The software does not properly ""clean up"" and remove temporary or supporting resources after they have been used.","In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
962 CWE-46,Path Equivalence: filename (Trailing Space) (Type: Variant),A software system that accepts path input in the form of trailing space ('filedir ') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"In some languages such as C and C++, stack variables are not initialized by default. They generally contain junk data with the contents of stack memory before the function was invoked. An attacker can sometimes control or read these contents. In other languages or conditions, a variable that is not explicitly initialized can be given a default value that has security implications, depending on the logic of the program. The presence of an uninitialized variable can sometimes indicate a typographic error in the code.",,Unknown,
963 CWE-463,Deletion of Data Structure Sentinel (Type: Base),The accidental deletion of a data-structure sentinel can cause serious programming logic problems.,"Often times data-structure sentinels are used to mark structure of the data structure. A common example of this is the null character at the end of strings. Another common example is linked lists which may contain a sentinel to mark the end of the list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the deletion or modification outside of some wrapper interface which provides safety.",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""NUL-Termination Problems"", Page 452."
964 CWE-466,Return of Pointer Value Outside of Expected Range (Type: Base),A function can return a pointer to memory that is outside of the buffer that the pointer is expected to reference.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89"
965 CWE-47,Path Equivalence: filename (Leading Space) (Type: Variant),A software system that accepts path input in the form of leading space (' filedir') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data-structure sentinels are often used to mark the structure of data. A common example of this is the null character at the end of strings or a special sentinel to mark the end of a linked list. It is dangerous to allow this type of control data to be easily accessible. Therefore, it is important to protect from the addition or modification of sentinels.",,Unknown,
966 CWE-470,Use of Externally-Controlled Input to Select Classes or Code (Unsafe Reflection) (Type: Base),"The application uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.","If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
967 CWE-471,Modification of Assumed-Immutable Data (MAID) (Type: Base),The software does not properly protect an assumed-immutable element from being modified by an attacker.,"If the application uses external inputs to determine which class to instantiate or which method to invoke, then an attacker could supply values to select unexpected classes or methods. If this occurs, then the attacker could create control flow paths that were not intended by the developer. These paths could bypass authentication or access control checks, or otherwise cause the application to behave in an unexpected manner. This situation becomes a doomsday scenario if the attacker can upload files into a location that appears on the application's classpath (CWE-427) or add new entries to the application's classpath (CWE-426). Under either of these conditions, the attacker can use reflection to introduce new, malicious behavior into the application.",,Unknown,
968 CWE-472,External Control of Assumed-Immutable Web Parameter (Type: Base),"The web application does not sufficiently verify inputs that are assumed to be immutable but are actually externally controllable, such as hidden form fields.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
969 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 4: Use of Magic URLs, Predictable Cookies, and Hidden Form Fields."" Page 75
970 The Art of Software Security Assessment: Chapter 17, ""Embedding State in HTML and URLs"", Page 1032."
971 CWE-473,PHP External Variable Modification (Type: Variant),"A PHP application does not properly protect against the modification of variables from external sources, such as query parameters or cookies. This can expose the application to numerous weaknesses that would not exist otherwise.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
972 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
973 CWE-474,Use of Function with Inconsistent Implementations (Type: Base),"The code uses a function that has inconsistent implementations across operating systems and versions, which might cause security-relevant portability problems.","If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
974 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
975 CWE-475,Undefined Behavior for Input to API (Type: Base),The behavior of this function is undefined unless its control parameter is set to a specific value.,"If a web product does not properly protect assumed-immutable values from modification in hidden form fields, parameters, cookies, or URLs, this can lead to modification of critical data. Web applications often mistakenly make the assumption that data passed to the client in hidden fields or cookies is not susceptible to tampering. Improper validation of data that are user-controllable can lead to the application processing incorrect, and often malicious, input.
976 For example, custom cookies commonly store session data or persistent data across sessions. This kind of session data is normally involved in security related decisions on the server side, such as user authentication and access control. Thus, the cookies might contain sensitive data such as user credentials and privileges. This is a dangerous practice, as it can often lead to improper reliance on the value of the client-provided cookie by the server side application.",,Unknown,
977 CWE-477,Use of Obsolete Functions (Type: Base),"The code uses deprecated or obsolete functions, which suggests that the code has not been actively reviewed or maintained.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,
978 CWE-478,Missing Default Case in Switch Statement (Type: Variant),"The code does not have a default case in a switch statement, which might lead to complex logical errors and resultant weaknesses.","NULL pointer dereference issues can occur through a number of flaws, including race conditions, and simple programming omissions.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Switch Statements"", Page 337."
979 CWE-48,Path Equivalence: file name (Internal Whitespace) (Type: Variant),A software system that accepts path input in the form of internal space ('file(SPACE)name') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Non-reentrant functions are functions that cannot safely be called, interrupted, and then recalled before the first call has finished without resulting in memory corruption. This can lead to an unexpected system state an unpredictable results with a variety of potential consequences depending on context, including denial of service and code execution.
980 Many functions are not reentrant, but some of them can result in the corruption of memory if they are used in a signal handler. The function call syslog() is an example of this. In order to perform its functionality, it allocates a small amount of memory as ""scratch space."" If syslog() is suspended by a signal call and the signal handler calls syslog(), the memory used by both of these functions enters an undefined, and possibly, exploitable state. Implementations of malloc() and free() manage metadata in global structures in order to track which memory is allocated versus which memory is available, but they are non-reentrant. Simultaneous calls to these functions can cause corruption of the metadata.",,Unknown,
981 CWE-485,Insufficient Encapsulation (Type: Class),The product does not sufficiently encapsulate critical data or functionality.,"Encapsulation is about drawing strong boundaries. In a web browser that might mean ensuring that your mobile code cannot be abused by other mobile code. On the server it might mean differentiation between validated data and unvalidated data, between one user's data and another's, or between data users are allowed to see and data that they are not.",,Unknown,
982 CWE-488,Exposure of Data Element to Wrong Session (Type: Variant),"The product does not sufficiently enforce boundaries between the states of different sessions, causing data to be provided to, or used by, the wrong session.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
983 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
984 CWE-489,Leftover Debug Code (Type: Base),The application can be deployed with active debugging code that can create unintended entry points.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
985 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
986 CWE-49,Path Equivalence: filename/ (Trailing Slash) (Type: Variant),A software system that accepts path input in the form of trailing slash ('filedir/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
987 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,
988 CWE-491,Public cloneable() Method Without Final (Object Hijack) (Type: Variant),"A class has a cloneable() method that is not declared final, which allows an object to be created without calling the constructor. This can cause the object to be in an unexpected state.","Data can ""bleed"" from one session to another through member variables of singleton objects, such as Servlets, and objects from a shared pool.
989 In the case of Servlets, developers sometimes do not understand that, unless a Servlet implements the SingleThreadModel interface, the Servlet is a singleton; there is only one instance of the Servlet, and that single instance is used and re-used to handle multiple requests that are processed simultaneously by different threads. A common result is that developers use Servlet member fields in such a way that one user may inadvertently see another user's data. In other words, storing user data in Servlet member fields introduces a data access race condition.",,Unknown,"OWASP , Attack Category : Mobile code: object hijack: http://www.owasp.org/index.php/Mobile_code:_object_hijack"
990 CWE-495,Private Array-Typed Field Returned From A Public Method (Type: Variant),"The product has a method that is declared public, but returns a reference to a private array, which could then be modified in unexpected ways.","An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
991 CWE-496,Public Data Assigned to Private Array-Typed Field (Type: Variant),Assigning public data to a private array is equivalent to giving public access to the array.,"An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit.",,Unknown,
992 CWE-497,Exposure of System Data to an Unauthorized Control Sphere (Type: Variant),Exposing system data or debugging information helps an adversary learn about the system and form an attack plan.,"An information exposure occurs when system data or debugging information leaves the program through an output stream or logging function that makes it accessible to unauthorized parties. An attacker can also cause errors to occur by submitting unusual requests to the web application. The response to these errors can reveal detailed system information, deny service, cause security mechanisms to fail, and crash the server. An attacker can use error messages that reveal technologies, operating systems, and product versions to tune the attack against known vulnerabilities in these technologies. An application may use diagnostic methods that provide significant implementation details such as stack traces as part of its error handling mechanism.",,Unknown,
993 CWE-5,J2EE Misconfiguration: Data Transmission Without Encryption (Type: Variant),Information sent over a network can be compromised while in transit. An attacker may be able to read/modify the contents if the data are sent in plaintext or are weakly encrypted.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
994 CWE-50,Path Equivalence: //multiple/leading/slash (Type: Variant),A software system that accepts path input in the form of multiple leading slash ('//multiple/leading/slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Serializable classes are effectively open classes since data cannot be hidden in them. Classes that do not explicitly deny serialization can be serialized by any other class, which can then in turn use the data stored inside it.",,Unknown,
995 CWE-501,Trust Boundary Violation (Type: Base),The product mixes trusted and untrusted data in the same data structure or structured message.,"By combining trusted and untrusted data in the same data structure, it becomes easier for programmers to mistakenly trust unvalidated data.",,Unknown,
996 CWE-506,Embedded Malicious Code (Type: Class),The application contains code that appears to be malicious in nature.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
997 CWE-507,Trojan Horse (Type: Base),"The software appears to contain benign or useful functionality, but it also contains code that is hidden from normal operation that violates the intended security policy of the user or the system administrator.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,"Writing Secure Code: Chapter 7, ""Viruses, Trojans, and Worms In a Nutshell"" Page 208"
998 CWE-508,Non-Replicating Malicious Code (Type: Base),Non-replicating malicious code only resides on the target system or software that is attacked; it does not attempt to spread to other systems.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
999 CWE-509,Replicating Malicious Code (Virus or Worm) (Type: Base),"Replicating malicious code, including viruses and worms, will attempt to attack other systems once it has successfully compromised the target system or software.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1000 CWE-51,Path Equivalence: /multiple//internal/slash (Type: Variant),A software system that accepts path input in the form of multiple internal slash ('/multiple//internal/slash/') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1001 CWE-510,Trapdoor (Type: Base),"A trapdoor is a hidden piece of code that responds to a special input, allowing its user access to resources without passing through the normal security enforcement mechanism.","Malicious flaws have acquired colorful names, including Trojan horse, trapdoor, timebomb, and logic-bomb. A developer might insert malicious code with the intent to subvert the security of an application or its host system at some time in the future. It generally refers to a program that performs a useful service but exploits rights of the program's user in a way the user does not intend.",,Unknown,
1002 CWE-511,Logic/Time Bomb (Type: Base),"The software contains code that is designed to disrupt the legitimate operation of the software (or its environment) when a certain time passes, or when a certain logical condition is met.","When the time bomb or logic bomb is detonated, it may perform a denial of service such as crashing the system, deleting critical data, or degrading system response time. This bomb might be placed within either a replicating or non-replicating Trojan horse.",,Unknown,Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/
1003 CWE-512,Spyware (Type: Base),"The software collects personally identifiable information about a human user or the user's activities, but the software accesses this information using other resources besides itself, and it does not require that user's explicit approval or direct input into the software.","""Spyware"" is a commonly used term with many definitions and interpretations. In general, it is meant to software that collects information or installs functionality that human users might not allow if they were fully aware of the actions being taken by the software. For example, a user might expect that tax software would collect a social security number and include it when filing a tax return, but that same user would not expect gaming software to obtain the social security number from that tax software's data.",,Unknown,
1004 CWE-514,Covert Channel (Type: Class),A covert channel is a path that can be used to transfer information in a way not intended by the system's designers.,Typically the system has not given authorization for the transmission and has no knowledge of its occurrence.,,Unknown,
1005 CWE-516,DEPRECATED (Duplicate): Covert Timing Channel (Type: Base),This weakness can be found at CWE-385.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1006 CWE-52,Path Equivalence: /multiple/trailing/slash// (Type: Variant),A software system that accepts path input in the form of multiple trailing slash ('/multiple/trailing/slash//') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1007 CWE-520,.NET Misconfiguration: Use of Impersonation (Type: Variant),Allowing a .NET application to run at potentially escalated levels of access to the underlying operating and file systems can be dangerous and result in various forms of attacks.,"Covert storage channels occur when out-of-band data is stored in messages for the purpose of memory reuse. Covert channels are frequently classified as either storage or timing channels. Examples would include using a file intended to hold only audit information to convey user passwords--using the name of a file or perhaps status bits associated with it that can be read by all users to signal the contents of the file. Steganography, concealing information in such a manner that no one but the intended recipient knows of the existence of the message, is a good example of a covert storage channel.",,Unknown,
1008 CWE-521,Weak Password Requirements (Type: Base),"The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1009 CWE-522,Insufficiently Protected Credentials (Type: Base),This weakness occurs when the application transmits or stores authentication credentials and uses an insecure method that is susceptible to unauthorized interception and/or retrieval.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1010 CWE-523,Unprotected Transport of Credentials (Type: Variant),Login pages not using adequate measures to protect the user name and password while they are in transit from the client to the server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1011 CWE-524,Information Exposure Through Caching (Type: Variant),"The application uses a cache to maintain a pool of objects, threads, connections, pages, or passwords to minimize the time it takes to access them or the resources to which they connect. If implemented improperly, these caches can allow access to unauthorized information or cause a denial of service vulnerability.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1012 CWE-525,Information Exposure Through Browser Caching (Type: Variant),"For each web page, the application should have an appropriate caching policy specifying the extent to which the page and its form fields should be cached.","An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1013 CWE-526,Information Exposure Through Environmental Variables (Type: Variant),Environmental variables may contain sensitive information about a remote server.,"An authentication mechanism is only as strong as its credentials. For this reason, it is important to require users to have strong passwords. Lack of password complexity significantly reduces the search space when trying to guess user's passwords, making brute-force attacks easier.",,Unknown,
1014 CWE-527,Exposure of CVS Repository to an Unauthorized Control Sphere (Type: Variant),The product stores a CVS repository in a directory or other container that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1015 CWE-528,Exposure of Core Dump File to an Unauthorized Control Sphere (Type: Variant),The product generates a core dump file in a directory that is accessible to actors outside of the intended control sphere.,"Information contained within a CVS subdirectory on a web server or other server could be recovered by an attacker and used for malicious purposes. This information may include usernames, filenames, path root, and IP addresses.",,Unknown,
1016 CWE-529,Exposure of Access Control List Files to an Unauthorized Control Sphere (Type: Variant),The product stores access control list files in a directory or other container that is accessible to actors outside of the intended control sphere.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1017 CWE-53,Path Equivalence: \multiple\\internal\backslash (Type: Variant),A software system that accepts path input in the form of multiple internal backslash ('\multiple\trailing\\slash') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,Exposure of these access control list files may give the attacker information about the configuration of the site or system. This information may then be used to bypass the intended security policy or identify trusted systems from which an attack can be launched.,,Unknown,
1018 CWE-530,Exposure of Backup File to an Unauthorized Control Sphere (Type: Variant),A backup file is stored in a directory that is accessible to actors outside of the intended control sphere.,"Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1019 CWE-531,Information Exposure Through Test Code (Type: Variant),"Accessible test applications can pose a variety of security risks. Since developers or administrators rarely consider that someone besides themselves would even know about the existence of these applications, it is common for them to contain sensitive information or functions.","Often, old files are renamed with an extension such as .~bk to distinguish them from production files. The source code for old files that have been renamed in this manner and left in the webroot can often be retrieved. This renaming may have been performed automatically by the web server, or manually by the administrator.",,Unknown,
1020 CWE-533,Information Exposure Through Server Log Files (Type: Variant),"A server.log file was found. This can give information on whatever application left the file. Usually this can give full path names and system information, and sometimes usernames and passwords.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1021 CWE-534,Information Exposure Through Debug Log Files (Type: Variant),The application does not sufficiently restrict access to a log file that is used for debugging.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1022 CWE-535,Information Exposure Through Shell Error Message (Type: Variant),"A command shell error message indicates that there exists an unhandled exception in the web application code. In many cases, an attacker can leverage the conditions that cause these errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1023 CWE-536,Information Exposure Through Servlet Runtime Error Message (Type: Variant),A servlet error message indicates that there exists an unhandled exception in your web application code and may provide useful information to an attacker.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1024 CWE-537,Information Exposure Through Java Runtime Error Message (Type: Variant),"In many cases, an attacker can leverage the conditions that cause unhandled exception errors in order to gain unauthorized access to the system.","While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,
1025 CWE-538,File and Directory Information Exposure (Type: Base),The product stores sensitive information in files or directories that are accessible to actors outside of the intended control sphere.,"While logging all information may be helpful during development stages, it is important that logging levels be set appropriately before a product ships so that sensitive user data and system information are not accidentally exposed to potential attackers.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 12: Information Leakage."" Page 191"
1026 CWE-539,Information Exposure Through Persistent Cookies (Type: Variant),Persistent cookies are cookies that are stored on the browser's hard drive. This can cause security and privacy issues depending on the information stored in the cookie and how it is accessed.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1027 CWE-54,Path Equivalence: filedir\ (Trailing Backslash) (Type: Variant),A software system that accepts path input in the form of trailing backslash ('filedir\') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies just live in the browser's memory, and are not stored anywhere, but persistent cookies are stored on the browser's hard drive.",,Unknown,
1028 CWE-540,Information Exposure Through Source Code (Type: Variant),Source code on a web server often contains sensitive information and should generally not be accessible to users.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1029 CWE-541,Information Exposure Through Include Source Code (Type: Variant),"If an include file source is accessible, the file can contain usernames and passwords, as well as sensitive information pertaining to the application and system.","There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1030 CWE-542,Information Exposure Through Cleanup Log Files (Type: Variant),The application does not properly protect or delete a log file related to cleanup.,"There are situations where it is critical to remove source code from an area or server. For example, obtaining Perl source code on a system allows an attacker to understand the logic of the script and extract extremely useful information such as code bugs or logins and passwords.",,Unknown,
1031 CWE-543,Use of Singleton Pattern Without Synchronization in a Multithreaded Context (Type: Variant),The software uses the singleton pattern when creating a resource within a multithreaded environment.,The use of a singleton pattern may not be thread-safe.,,Unknown,Thread-Specifc Storage for C/C++: http://www.cs.wustl.edu/~schmidt/PDF/TSS-pattern.pdf
1032 CWE-544,Missing Standardized Error Handling Mechanism (Type: Base),"The software does not use a standardized method for handling errors throughout the code, which might introduce inconsistent error handling and resultant weaknesses.","If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1033 CWE-545,Use of Dynamic Class Loading (Type: Variant),Dynamically loaded code has the potential to be malicious.,"If the application handles error messages individually, on a one-by-one basis, this is likely to result in inconsistent error handling. The causes of errors may be lost. Also, detailed information about the causes of an error may be unintentionally returned to the user.",,Unknown,
1034 CWE-546,Suspicious Comment (Type: Variant),"The code contains comments that suggest the presence of bugs, incomplete functionality, or weaknesses.","Many suspicious comments, such as BUG, HACK, FIXME, LATER, LATER2, TODO, in the code indicate missing security functionality and checking. Others indicate code problems that programmers should fix, such as hard-coded variables, error handling, not using stored procedures, and performance issues.",,Unknown,
1035 CWE-547,"Use of Hard-coded, Security-relevant Constants (Type: Variant)","The program uses hard-coded constants instead of symbolic names for security-critical values, which increases the likelihood of mistakes during code maintenance or security policy change.","If the developer does not find all occurrences of the hard-coded constants, an incorrect policy decision may be made if one of the constants is not changed. Making changes to these values will require code changes that may be difficult or impossible once the system is released to the field. In addition, these hard-coded values may become available to attackers if the code is ever disclosed.",,Unknown,
1036 CWE-548,Information Exposure Through Directory Listing (Type: Variant),"A directory listing is inappropriately exposed, yielding potentially sensitive information to attackers.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1037 CWE-549,Missing Password Field Masking (Type: Variant),"The software does not mask passwords during entry, increasing the potential for attackers to observe and capture passwords.",A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1038 CWE-55,Path Equivalence: /./ (Single Dot Directory) (Type: Variant),A software system that accepts path input in the form of single dot directory exploit ('/./') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,A directory listing provides an attacker with the complete index of all the resources located inside of the directory. The specific risks and consequences vary depending on which files are listed and accessible.,,Unknown,
1039 CWE-550,Information Exposure Through Server Error Message (Type: Variant),"Certain conditions, such as network failure, will cause a server error message to be displayed.","While error messages in and of themselves are not dangerous, per se, it is what an attacker can glean from them that might cause eventual problems.",,Unknown,
1040 CWE-551,Incorrect Behavior Order: Authorization Before Parsing and Canonicalization (Type: Base),"If a web server does not fully parse requested URLs before it examines them for authorization, it may be possible for an attacker to bypass authorization protection.","For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1041 CWE-552,Files or Directories Accessible to External Parties (Type: Base),Files or directories are accessible in the environment that should not be.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1042 CWE-553,Command Shell in Externally Accessible Directory (Type: Variant),A possible shell file exists in /cgi-bin/ or other accessible directories. This is extremely dangerous and can be used by an attacker to execute commands on the web server.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1043 CWE-554,ASP.NET Misconfiguration: Not Using Input Validation Framework (Type: Variant),The ASP.NET application does not use an input validation framework.,"For instance, the character strings /./ and / both mean current directory. If /SomeDirectory is a protected directory and an attacker requests /./SomeDirectory, the attacker may be able to gain access to the resource if /./ is not converted to / before the authorization check is performed.",,Unknown,
1044 CWE-555,J2EE Misconfiguration: Plaintext Password in Configuration File (Type: Variant),The J2EE application stores a plaintext password in a configuration file.,"Storing a plaintext password in a configuration file allows anyone who can read the file to access the password-protected resource, making it an easy target for attackers.",,Unknown,
1045 CWE-556,ASP.NET Misconfiguration: Use of Identity Impersonation (Type: Variant),Configuring an ASP.NET application to run with impersonated credentials may give the application unnecessary privileges.,The use of impersonated credentials allows an ASP.NET application to run with either the privileges of the client on whose behalf it is executing or with arbitrary privileges granted in its configuration.,,Unknown,
1046 CWE-558,Use of getlogin() in Multithreaded Application (Type: Variant),"The application uses the getlogin() function in a multithreaded context, potentially causing it to return incorrect values.","The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1047 CWE-56,Path Equivalence: filedir* (Wildcard) (Type: Variant),A software system that accepts path input in the form of asterisk wildcard ('filedir*') without appropriate validation can lead to ambiguous path resolution and allow an attacker to traverse the file system to unintended locations or access arbitrary files.,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1048 CWE-560,Use of umask() with chmod-style Argument (Type: Variant),The product calls umask() with an incorrect argument that is specified as if it is an argument to chmod().,"The getlogin() function returns a pointer to a string that contains the name of the user associated with the calling process. The function is not reentrant, meaning that if it is called from another process, the contents are not locked out and the value of the string can be changed by another process. This makes it very risky to use because the username can be changed by other processes, so the results of the function cannot be trusted.",,Unknown,
1049 CWE-561,Dead Code (Type: Variant),"The software contains dead code, which can never be executed.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1050 CWE-562,Return of Stack Variable Address (Type: Base),"A function returns the address of a stack variable, which will cause unintended program behavior, typically in the form of a crash.",Dead code is source code that can never be executed in a running program. The surrounding code makes it impossible for a section of code to ever be executed.,,Unknown,
1051 CWE-563,Unused Variable (Type: Variant),"The variable's value is assigned but never used, making it a dead store.","It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1052 CWE-564,SQL Injection: Hibernate (Type: Variant),Using Hibernate to execute a dynamic SQL statement built with user-controlled input can allow an attacker to modify the statement's meaning or to execute arbitrary SQL commands.,"It is likely that the variable is simply vestigial, but it is also possible that the unused variable points out a bug.",,Unknown,
1053 CWE-565,Reliance on Cookies without Validation and Integrity Checking (Type: Base),"The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user.","Attackers can easily modify cookies, within the browser or by implementing the client-side code outside of the browser. Reliance on cookies without detailed validation and integrity checking can allow attackers to bypass authentication, conduct injection attacks such as SQL injection and cross-site scripting, or otherwise modify inputs in unexpected ways.",,Unknown,
1054 CWE-566,Authorization Bypass Through User-Controlled SQL Primary Key (Type: Variant),"The software uses a database table that includes records that should not be accessible to an actor, but it executes a SQL statement with a primary key that can be controlled by that actor.","When a user can set a primary key to any value, then the user can modify the key to point to unauthorized records.
1055 Database access control errors occur when:
1056 Data enters a program from an untrusted source.
1057 The data is used to specify the value of a primary key in a SQL query.
1058 The untrusted source does not have the permissions to be able to access all rows in the associated table.",,Unknown,
1059 CWE-567,Unsynchronized Access to Shared Data in a Multithreaded Context (Type: Base),"The product does not properly synchronize shared data, such as static variables across threads, which can lead to undefined behavior and unpredictable data changes.","Within servlets, shared static variables are not protected from concurrent access, but servlets are multithreaded. This is a typical programming mistake in J2EE applications, since the multithreading is handled by the framework. When a shared variable can be influenced by an attacker, one thread could wind up modifying the variable to contain data that is not valid for a different thread that is also using the data within the variable.
1060 Note that this weakness is not unique to servlets.",,Unknown,
1061 CWE-568,finalize() Method Without super.finalize() (Type: Variant),The software contains a finalize() method that does not call super.finalize().,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1062 CWE-57,Path Equivalence: fakedir/../realdir/filename (Type: Variant),"The software contains protection mechanisms to restrict access to 'realdir/filename', but it constructs pathnames using external input in the form of 'fakedir/../realdir/filename' that are not handled by those mechanisms. This allows attackers to perform unauthorized actions against the targeted file.",The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1063 CWE-570,Expression is Always False (Type: Variant),The software contains an expression that will always evaluate to false.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1064 CWE-571,Expression is Always True (Type: Variant),The software contains an expression that will always evaluate to true.,The Java Language Specification states that it is a good practice for a finalize() method to call super.finalize().,,Unknown,
1065 CWE-572,Call to Thread run() instead of start() (Type: Variant),"The program calls a thread's run() method instead of calling start(), which causes the code to run in the thread of the caller instead of the callee.","In most cases a direct call to a Thread object's run() method is a bug. The programmer intended to begin a new thread of control, but accidentally called run() instead of start(), so the run() method will execute in the caller's thread of control.",,Unknown,
1066 CWE-573,Improper Following of Specification by Caller (Type: Class),"The software does not follow or incorrectly follows the specifications as required by the implementation language, environment, framework, protocol, or platform.","When leveraging external functionality, such as an API, it is important that the caller does so in accordance with the requirements of the external functionality or else unintended behaviors may result, possibly leaving the system vulnerable to any number of exploits.",,Unknown,
1067 CWE-574,EJB Bad Practices: Use of Synchronization Primitives (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using thread synchronization primitives.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use thread synchronization primitives to synchronize execution of multiple instances."" The specification justifies this requirement in the following way: ""This rule is required to ensure consistent runtime semantics because while some EJB containers may use a single JVM to execute all enterprise bean's instances, others may distribute the instances across multiple JVMs.""",,Unknown,
1068 CWE-575,EJB Bad Practices: Use of AWT Swing (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using AWT/Swing.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the AWT functionality to attempt to output information to a display, or to input information from a keyboard."" The specification justifies this requirement in the following way: ""Most servers do not allow direct interaction between an application program and a keyboard/display attached to the server system.""",,Unknown,
1069 CWE-576,EJB Bad Practices: Use of Java I/O (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the java.io package.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not use the java.io package to attempt to access files and directories in the file system."" The specification justifies this requirement in the following way: ""The file system APIs are not well-suited for business components to access data. Business components should use a resource manager API, such as JDBC, to store data.""",,Unknown,
1070 CWE-577,EJB Bad Practices: Use of Sockets (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using sockets.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""An enterprise bean must not attempt to listen on a socket, accept connections on a socket, or use a socket for multicast."" The specification justifies this requirement in the following way: ""The EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server. Allowing the instance to become a network server would conflict with the basic function of the enterprise bean-- to serve the EJB clients.""",,Unknown,
1071 CWE-578,EJB Bad Practices: Use of Class Loader (Type: Variant),The program violates the Enterprise JavaBeans (EJB) specification by using the class loader.,"The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1072 CWE-579,J2EE Bad Practices: Non-serializable Object Stored in Session (Type: Variant),"The application stores a non-serializable object as an HttpSession attribute, which can hurt reliability.","The Enterprise JavaBeans specification requires that every bean provider follow a set of programming guidelines designed to ensure that the bean will be portable and behave consistently in any EJB container. In this case, the program violates the following EJB guideline: ""The enterprise bean must not attempt to create a class loader; obtain the current class loader; set the context class loader; set security manager; create a new security manager; stop the JVM; or change the input, output, and error streams."" The specification justifies this requirement in the following way: ""These functions are reserved for the EJB container. Allowing the enterprise bean to use these functions could compromise security and decrease the container's ability to properly manage the runtime environment.""",,Unknown,
1073 CWE-58,Path Equivalence: Windows 8.3 Filename (Type: Variant),"The software contains a protection mechanism that restricts access to a long filename on a Windows operating system, but the software does not properly restrict access to the equivalent short ""8.3"" filename.","On later Windows operating systems, a file can have a ""long name"" and a short name that is compatible with older Windows file systems, with up to 8 characters in the filename and 3 characters for the extension. These ""8.3"" filenames, therefore, act as an alternate name for files with long names, so they are useful pathname equivalence manipulations.",,Unknown,"Writing Secure Code
1074 The Art of Software Security Assessment: Chapter 11, ""DOS 8.3 Filenames"", Page 673."
1075 CWE-580,clone() Method Without super.clone() (Type: Variant),The software contains a clone() method that does not call super.clone() to obtain the new object.,"All implementations of clone() should obtain the new object by calling super.clone(). If a class does not follow this convention, a subclass's clone() method will return an object of the wrong type.",,Unknown,
1076 CWE-581,Object Model Violation: Just One of Equals and Hashcode Defined (Type: Base),The software does not maintain equal hashcodes for equal objects.,"Java objects are expected to obey a number of invariants related to equality. One of these invariants is that equal objects must have equal hashcodes. In other words, if a.equals(b) == true then a.hashCode() == b.hashCode().",,Unknown,
1077 CWE-582,"Array Declared Public, Final, and Static (Type: Variant)","The program declares an array public, final, and static, which is not sufficient to prevent the array's contents from being modified.","Because arrays are mutable objects, the final constraint requires that the array object itself be assigned only once, but makes no guarantees about the values of the array elements. Since the array is public, a malicious program can change the values stored in the array. As such, in most cases an array declared public, final and static is a bug.",,Unknown,
1078 CWE-583,finalize() Method Declared Public (Type: Variant),The program violates secure coding principles for mobile code by declaring a finalize() method public.,"A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1079 CWE-584,Return Inside Finally Block (Type: Base),"The code has a return statement inside a finally block, which will cause any thrown exception in the try block to be discarded.","A program should never call finalize explicitly, except to call super.finalize() inside an implementation of finalize(). In mobile code situations, the otherwise error prone practice of manual garbage collection can become a security threat if an attacker can maliciously invoke one of your finalize() methods because it is declared with public access.",,Unknown,
1080 CWE-585,Empty Synchronized Block (Type: Variant),The software contains an empty synchronized block.,An empty synchronized block does not actually accomplish any synchronization and may indicate a troubled section of code. An empty synchronized block can occur because code no longer needed within the synchronized block is commented out without removing the synchronized block.,,Unknown,Intrinsic Locks and Synchronization (in Java): http://java.sun.com/docs/books/tutorial/essential/concurrency/locksync.html
1081 CWE-586,Explicit Call to Finalize() (Type: Variant),The software makes an explicit call to the finalize() method from outside the finalizer.,"While the Java Language Specification allows an object's finalize() method to be called from outside the finalizer, doing so is usually a bad idea. For example, calling finalize() explicitly means that finalize() will be called more than once: the first time will be the explicit call and the last time will be the call that is made after the object is garbage collected.",,Unknown,
1082 CWE-587,Assignment of a Fixed Address to a Pointer (Type: Base),The software sets a pointer to a specific address other than NULL or 0.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1083 CWE-588,Attempt to Access Child of a Non-structure Pointer (Type: Variant),Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption.,Using a fixed address is not portable because that address will probably not be valid in all environments or platforms.,,Unknown,
1084 CWE-589,Call to Non-ubiquitous API (Type: Variant),The software uses an API function that does not exist on all versions of the target platform. This could cause portability problems or inconsistencies that allow denial of service or other consequences.,"Some functions that offer security features supported by the OS are not available on all versions of the OS in common use. Likewise, functions are often deprecated or made obsolete for security reasons and should not be used.",,Unknown,
1085 CWE-590,Free of Memory not on the Heap (Type: Variant),"The application calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().","When free() is called on an invalid pointer, the program's memory management data structures may become corrupted. This corruption can cause the program to crash or, in some circumstances, an attacker may be able to cause free() to operate on controllable memory locations to modify critical program variables or execute code.",,Unknown,Valgrind: http://valgrind.org/
1086 CWE-591,Sensitive Data Storage in Improperly Locked Memory (Type: Variant),"The application stores sensitive data in memory that is not locked, or that has been incorrectly locked, which might cause the memory to be written to swap files on disk by the virtual memory manager. This can make the data more accessible to external actors.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,
1087 CWE-592,Authentication Bypass Issues (Type: Class),"The software does not properly perform authentication, allowing it to be bypassed through various methods.","On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.",,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1088 CWE-593,Authentication Bypass: OpenSSL CTX Object Modified after SSL Objects are Created (Type: Variant),The software modifies the SSL context after connection creation has begun.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1089 CWE-594,J2EE Framework: Saving Unserializable Objects to Disk (Type: Variant),When the J2EE container attempts to write unserializable objects to disk there is no guarantee that the process will complete successfully.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1090 CWE-595,Comparison of Object References Instead of Object Contents (Type: Base),"The program compares object references instead of the contents of the objects themselves, preventing it from detecting equivalent objects.","If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1091 CWE-596,Incorrect Semantic Object Comparison (Type: Base),The software does not correctly compare two objects based on their conceptual content.,"If the program modifies the SSL_CTX object after creating SSL objects from it, there is the possibility that older SSL objects created from the original context could all be affected by that change.",,Unknown,
1092 CWE-597,Use of Wrong Operator in String Comparison (Type: Variant),"The product uses the wrong operator when comparing a string, such as using ""=="" when the equals() method should be used instead.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Typos"", Page 289."
1093 CWE-598,Information Exposure Through Query Strings in GET Request (Type: Variant),"The web application uses the GET method to process requests that contain sensitive information, which can expose that information through the browser's history, Referers, web logs, and other sources.","In Java, using == or != to compare two strings for equality actually compares two objects for equality, not their values. Chances are good that the two references will never be equal. While this weakness often only affects program correctness, if the equality is used for a security decision, it could be leveraged to affect program security.",,Unknown,
1094 CWE-599,Missing Validation of OpenSSL Certificate (Type: Variant),The software uses OpenSSL and trusts or uses a certificate without using the SSL_get_verify_result() function to ensure that the certificate satisfies all necessary security requirements.,"This could allow an attacker to use an invalid certificate to claim to be a trusted host, use expired certificates, or conduct other attacks that could be detected if the certificate is properly validated.",,Unknown,
1095 CWE-6,J2EE Misconfiguration: Insufficient Session-ID Length (Type: Variant),The J2EE application is configured to use an insufficient session ID length.,"If an attacker can guess or steal a session ID, then he/she may be able to take over the user's session (called session hijacking). The number of possible session IDs increases with increased session ID length, making it more difficult to guess or steal a session ID.",,Unknown,No description: http://www.securiteam.com/securityreviews/5TP0F0UEVQ.html
1096 CWE-600,Uncaught Exception in Servlet (Type: Base),"The Servlet does not catch all exceptions, which may reveal sensitive debugging information.","When a Servlet throws an exception, the default error response the Servlet container sends back to the user typically includes debugging information. This information is of great value to an attacker. For example, a stack trace might show the attacker a malformed SQL query string, the type of database being used, and the version of the application container. This information enables the attacker to target known vulnerabilities in these components.",,Unknown,
1097 CWE-603,Use of Client-Side Authentication (Type: Base),"A client/server product performs authentication within client code but not in server code, allowing server-side authentication to be bypassed via a modified client that omits the authentication check.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 2, ""Untrustworthy Credentials"", Page 37."
1098 CWE-605,Multiple Binds to the Same Port (Type: Base),"When multiple sockets are allowed to bind to the same port, other services on that port may be stolen or spoofed.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1099 CWE-606,Unchecked Input for Loop Condition (Type: Base),"The product does not properly check inputs that are used for loop conditions, potentially leading to a denial of service because of excessive looping.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1100 CWE-607,Public Static Final Field References Mutable Object (Type: Variant),"A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1101 CWE-608,Struts: Non-private Field in ActionForm Class (Type: Variant),"An ActionForm class contains a field that has not been declared private, which can be accessed without using a setter or getter.",Client-side authentication is extremely weak and may be breached easily. Any attacker may read the source code and reverse-engineer the authentication mechanism to access parts of the application which would otherwise be protected.,,Unknown,
1102 CWE-609,Double-Checked Locking (Type: Base),"The program uses double-checked locking to access a resource without the overhead of explicit synchronization, but the locking is insufficient.","Double-checked locking refers to the situation where a programmer checks to see if a resource has been initialized, grabs a lock, checks again to see if the resource has been initialized, and then performs the initialization if it has not occurred yet. This should not be done, as is not guaranteed to work in all languages and on all architectures. In summary, other threads may not be operating inside the synchronous block and are not guaranteed to see the operations execute in the same order as they would appear inside the synchronous block.",,Unknown,"The ""Double-Checked Locking is Broken"" Declaration: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
1103 JSR 133 (Java Memory Model) FAQ: http://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html#dcl
1104 The Art of Software Security Assessment: Chapter 13, ""Threading Vulnerabilities"", Page 815."
1105 CWE-610,Externally Controlled Reference to a Resource in Another Sphere (Type: Class),The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.,,,Unknown,
1106 CWE-611,Improper Restriction of XML External Entity Reference (XXE) (Type: Variant),"The software 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.","XML documents optionally contain a Document Type Definition (DTD), which, among other features, enables the definition of XML entities. It is possible to define an entity by providing a substitution string in the form of a URI. The XML parser can access the contents of this URI and embed these contents back into the XML document for further processing.
1107 By submitting an XML file that defines an external entity with a file:// URI, an attacker can cause the processing application to read the contents of a local file. For example, a URI such as ""file:///c:/winnt/win.ini"" designates (in Windows) the file C:\Winnt\win.ini, or file:///etc/passwd designates the password file in Unix-based systems. Using URIs with other schemes such as http://, the attacker can force the application to make outgoing requests to servers that the attacker cannot reach directly, which can be used to bypass firewall restrictions or hide the source of attacks such as port scanning.
1108 Once the content of the URI is read, it is fed back into the application that is processing the XML. This application may echo back the data (e.g. in an error message), thereby exposing the file contents.",,Unknown,"XML External Entity (XXE) Processing: https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
1109 XML External Entity Attacks (XXE): https://www.owasp.org/images/5/5d/XML_Exteral_Entity_Attack.pdf
1110 XXE (Xml eXternal Entity) Attack: http://www.securiteam.com/securitynews/6D0100A5PU.html
1111 XML External Entities (XXE) Attack: http://projects.webappsec.org/w/page/13247003/XML%20External%20Entities
1112 XML Denial of Service Attacks and Defenses: http://msdn.microsoft.com/en-us/magazine/ee335713.aspx
1113 Preventing XXE in PHP: http://websec.io/2012/08/27/Preventing-XEE-in-PHP.html"
1114 CWE-612,Information Exposure Through Indexing of Private Data (Type: Variant),"The product performs an indexing routine against private documents, but does not sufficiently verify that the actors who can access the index also have the privileges to access the private documents.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1115 CWE-613,Insufficient Session Expiration (Type: Base),"According to WASC, ""Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.""","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1116 CWE-614,Sensitive Cookie in HTTPS Session Without Secure Attribute (Type: Variant),"The Secure attribute for sensitive cookies in HTTPS sessions is not set, which could cause the user agent to send those cookies in plaintext over an HTTP session.","When an indexing routine is applied against a group of private documents, and that index's results are available to outsiders who do not have access to those documents, then outsiders might be able to obtain sensitive information by conducting targeted searches. The risk is especially dangerous if search results include surrounding text that was not part of the search query. This issue can appear in search engines that are not configured (or implemented) to ignore critical files that should remain hidden; even without permissions to download these files directly, the remote user could read them.",,Unknown,
1117 CWE-615,Information Exposure Through Comments (Type: Variant),"While adding general comments is very useful, some programmers tend to leave important data, such as: filenames related to the web application, old links or links which were not meant to be browsed by users, old code fragments, etc.","An attacker who finds these comments can map the application's structure and files, expose hidden parts of the site, and study the fragments of code to reverse engineer the application, which may help develop further attacks against the site.",,Unknown,
1118 CWE-616,Incomplete Identification of Uploaded File Variables (PHP) (Type: Variant),"The PHP application uses an old method for processing uploaded files by referencing the four global variables that are set for each file (e.g. $varname, $varname_size, $varname_name, $varname_type). These variables could be overwritten by attackers, causing the application to process unauthorized files.","These global variables could be overwritten by POST requests, cookies, or other methods of populating or overwriting these variables. This could be used to read or process arbitrary files by providing values such as ""/etc/passwd"".",,Unknown,"A Study in Scarlet - section 5, ""File Upload"""
1119 CWE-617,Reachable Assertion (Type: Variant),"The product contains an assert() or similar statement that can be triggered by an attacker, which leads to an application exit or other behavior that is more severe than necessary.","For example, if a server handles multiple simultaneous connections, and an assert() occurs in one single connection that causes all other connections to be dropped, this is a reachable assertion that leads to a denial of service.",,Unknown,
1120 CWE-618,Exposed Unsafe ActiveX Method (Type: Base),"An ActiveX control is intended for use in a web browser, but it exposes dangerous methods that perform actions that are outside of the browser's security model (e.g. the zone or domain).","ActiveX controls can exercise far greater control over the operating system than typical Java or javascript. Exposed methods can be subject to various vulnerabilities, depending on the implemented behaviors of those methods, and whether input validation is performed on the provided arguments. If there is no integrity checking or origin validation, this method could be invoked by attackers.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1121 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1122 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1123 CWE-619,Dangling Database Cursor (Cursor Injection) (Type: Base),"If a database cursor is not closed properly, then it could become accessible to other users while retaining the same privileges that were originally assigned, leaving the cursor ""dangling.""","For example, an improper dangling cursor could arise from unhandled exceptions. The impact of the issue depends on the cursor's role, but SQL injection attacks are commonly possible.",,Unknown,"The Oracle Hacker's Handbook
1124 Cursor Injection: http://www.databasesecurity.com/dbsec/cursor-injection.pdf"
1125 CWE-62,UNIX Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently account for when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. /etc/passwd). When the process opens the file, the attacker can assume the privileges of that process.",,Unknown,"The Art of Software Security Assessment: Chapter 9, ""Hard Links"", Page 518."
1126 CWE-620,Unverified Password Change (Type: Variant),"When setting a new password for a user, the product does not require knowledge of the original password, or using another form of authentication.","This could be used by an attacker to change passwords for another user, thus gaining the privileges associated with that user.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1127 CWE-621,Variable Extraction Error (Type: Base),"The product uses external input to determine the names of variables into which information is extracted, without verifying that the names of the specified variables are valid. This could cause the program to overwrite unintended variables.","For example, in PHP, calling extract() or import_request_variables() without the proper arguments could allow arbitrary global variables to be overwritten, including superglobals. Similar functionality might be possible in other interpreted languages, including custom languages.",,Unknown,
1128 CWE-622,Improper Validation of Function Hook Arguments (Type: Variant),"A product adds hooks to user-accessible API functions, but does not properly validate the arguments. This could lead to resultant vulnerabilities.","Such hooks can be used in defensive software that runs with privileges, such as anti-virus or firewall, which hooks kernel calls. When the arguments are not validated, they could be used to bypass the protection scheme or attack the product itself.",,Unknown,
1129 CWE-623,Unsafe ActiveX Control Marked Safe For Scripting (Type: Variant),"An ActiveX control is intended for restricted use, but it has been marked as safe-for-scripting.","This might allow attackers to use dangerous functionality via a web page that accesses the control, which can lead to different resultant vulnerabilities, depending on the control's behavior.",,Unknown,"No description: http://msdn.microsoft.com/workshop/components/activex/safety.asp
1130 No description: http://msdn.microsoft.com/workshop/components/activex/security.asp
1131 No description: http://support.microsoft.com/kb/240797
1132 Writing Secure Code: Chapter 16, ""What ActiveX Components Are Safe for Initialization and Safe for Scripting?"" Page 510
1133 The Art of Software Security Assessment: Chapter 12, ""ActiveX Security"", Page 749."
1134 CWE-624,Executable Regular Expression Error (Type: Base),"The product uses a regular expression that either (1) contains an executable component with user-controlled inputs, or (2) allows a user to enable execution by inserting pattern modifiers.","Case (2) is possible in the PHP preg_replace() function, and possibly in other languages when a user-controlled input is inserted into a string that is later parsed as a regular expression.",,Unknown,
1135 CWE-625,Permissive Regular Expression (Type: Base),The product uses a regular expression that does not sufficiently restrict the set of allowed values.,"This effectively causes the regexp to accept substrings that match the pattern, which produces a partial comparison to the target. In some cases, this can lead to other weaknesses. Common errors include:
1136 not identifying the beginning and end of the target string
1137 using wildcards instead of acceptable character ranges
1138 others",,Unknown,"The Art of Software Security Assessment: Chapter 8, ""Character Stripping Vulnerabilities"", Page 437."
1139 CWE-626,Null Byte Interaction Error (Poison Null Byte) (Type: Variant),The product does not properly handle null bytes or NUL characters when passing data between different representations or components.,"A null byte (NUL character) can have different meanings across representations or languages. For example, it is a string terminator in standard C libraries, but Perl and PHP strings do not treat it as a terminator. When two representations are crossed - such as when Perl or PHP invokes underlying C functionality - this can produce an interaction error with unexpected results. Similar issues have been reported for ASP. Other interpreters written in C might also be affected.",,Unknown,"Poison NULL byte: http://insecure.org/news/P55-07.txt
1140 0x00 vs ASP file upload scripts: http://www.security-assessment.com/Whitepapers/0x00_vs_ASP_File_Uploads.pdf
1141 ShAnKaR: multiple PHP application poison NULL byte vulnerability: http://seclists.org/fulldisclosure/2006/Sep/0185.html"
1142 CWE-627,Dynamic Variable Evaluation (Type: Base),"In a language where the user can influence the name of a variable at runtime, if the variable names are not controlled, an attacker can read or write to arbitrary variables, or access arbitrary functions.","The resultant vulnerabilities depend on the behavior of the application, both at the crossover point and in any control/data flow that is reachable by the related variables or functions.",,Unknown,"Dynamic Evaluation Vulnerabilities in PHP applications: http://seclists.org/fulldisclosure/2006/May/0035.html
1143 A Study In Scarlet: Exploiting Common Vulnerabilities in PHP Applications: http://www.securereality.com.au/studyinscarlet.txt"
1144 CWE-628,Function Call with Incorrectly Specified Arguments (Type: Base),"The product calls a function, procedure, or routine with arguments that are not correctly specified, leading to always-incorrect behavior and resultant weaknesses.","There are multiple ways in which this weakness can be introduced, including:
1145 the wrong variable or reference;
1146 an incorrect number of arguments;
1147 incorrect order of arguments;
1148 wrong type of arguments; or
1149 wrong value.",,Unknown,
1150 CWE-636,Not Failing Securely (Failing Open) (Type: Class),"When the product encounters an error condition or failure, its design requires it to fall back to a state that is less secure than other options that are available, such as selecting the weakest encryption algorithm or using the most permissive access control restrictions.","By entering a less secure state, the product inherits the weaknesses associated with that state, making it easier to compromise. At the least, it causes administrators to have a false sense of security. This weakness typically occurs as a result of wanting to ""fail functional"" to minimize administration and support costs, instead of ""failing safe.""",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1151 Failing Securely: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/349.html"
1152 CWE-637,Unnecessary Complexity in Protection Mechanism (Not Using Economy of Mechanism) (Type: Class),"The software uses a more complex mechanism than necessary, which could lead to resultant weaknesses when the mechanism is not correctly understood, modeled, configured, implemented, or used.","Security mechanisms should be as simple as possible. Complex security mechanisms may engender partial implementations and compatibility problems, with resulting mismatches in assumptions and implemented security. A corollary of this principle is that data specifications should be as simple as possible, because complex data specifications result in complex validation code. Complex tasks and systems may also need to be guarded by complex security checks, so simple systems should be preferred.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1153 Economy of Mechanism: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/348.html"
1154 CWE-638,Not Using Complete Mediation (Type: Class),"The software does not perform access checks on a resource every time the resource is accessed by an entity, which can create resultant weaknesses if that entity's rights or privileges change over time.",,,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1155 Complete Mediation: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/346.html"
1156 CWE-65,Windows Hard Link (Type: Variant),"The software, when opening a file or directory, does not sufficiently handle when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the software to operate on unauthorized files.","Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. AUTOEXEC.BAT). When the process opens the file, the attacker can assume the privileges of that process, or prevent the program from accurately processing data.",,Unknown,"The Art of Software Security Assessment: Chapter 11, ""Links"", Page 676."
1157 CWE-651,Information Exposure Through WSDL File (Type: Variant),The Web services architecture may require exposing a WSDL file that contains information on the publicly accessible services and how callers of these services should interact with them (e.g. what parameters they expect and what types they return).,"An information exposure may occur if any of the following apply:
1158 The WSDL file is accessible to a wider audience than intended.
1159 The WSDL file contains information on the methods/services that should not be publicly accessible or information about deprecated methods. This problem is made more likely due to the WSDL often being automatically generated from the code.
1160 Information in the WSDL file helps guess names/locations of methods/resources that should not be publicly accessible.",,Unknown,
1161 CWE-653,Insufficient Compartmentalization (Type: Base),"The product does not sufficiently compartmentalize functionality or processes that require different privilege levels, rights, or permissions.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1162 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1163 CWE-654,Reliance on a Single Factor in a Security Decision (Type: Base),"A protection mechanism relies exclusively, or to a large extent, on the evaluation of a single condition or the integrity of a single object or entity in order to make a decision about granting access to restricted resources or functionality.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1164 Separation of Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/357.html"
1165 CWE-655,Insufficient Psychological Acceptability (Type: Base),"The software has a protection mechanism that is too difficult or inconvenient to use, encouraging non-malicious users to disable or bypass the mechanism, whether by accident or on purpose.","When a weakness occurs in functionality that is accessible by lower-privileged users, then without strong boundaries, an attack might extend the scope of the damage to higher-privileged users.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1166 Psychological Acceptability: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/354.html
1167 Usability of Security: A Case Study: http://reports-archive.adm.cs.cmu.edu/anon/1998/CMU-CS-98-155.pdf
1168 24 Deadly Sins of Software Security: ""Sin 14: Poor Usability."" Page 217"
1169 CWE-656,Reliance on Security Through Obscurity (Type: Base),"The software uses a protection mechanism whose strength depends heavily on its obscurity, such that knowledge of its algorithms or key data is sufficient to defeat the mechanism.","This reliance on ""security through obscurity"" can produce resultant weaknesses if an attacker is able to reverse engineer the inner workings of the mechanism. Note that obscurity can be one small part of defense in depth, since it can create more work for an attacker; however, it is a significant risk if used as the primary means of protection.",,Unknown,"RFC: 793, TRANSMISSION CONTROL PROTOCOL: http://www.ietf.org/rfc/rfc0793.txt
1170 The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1171 Never Assuming that Your Secrets Are Safe: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/352.html"
1172 CWE-657,Violation of Secure Design Principles (Type: Class),The product violates well-established principles for secure design.,"This can introduce resultant weaknesses or make it easier for developers to introduce related weaknesses during implementation. Because code is centered around design, it can be resource-intensive to fix design problems.",,Unknown,"The Protection of Information in Computer Systems: http://web.mit.edu/Saltzer/www/publications/protection/
1173 Design Principles: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/358.html"
1174 CWE-66,Improper Handling of File Names that Identify Virtual Resources (Type: Base),"The product does not handle or incorrectly handles a file name that identifies a ""virtual"" resource that is not directly specified within the directory that is associated with the file name, causing the product to perform file-based operations on a resource that is not a file.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1175 CWE-662,Improper Synchronization (Type: Base),"The software attempts to use a shared resource in an exclusive manner, but does not prevent or incorrectly prevents use of the resource by another thread or process.","Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,
1176 CWE-663,Use of a Non-reentrant Function in a Concurrent Context (Type: Base),The software calls a non-reentrant function in a concurrent context in which a competing code sequence (e.g. thread or signal handler) may have an opportunity to call the same function or otherwise influence its state.,"Virtual file names are represented like normal file names, but they are effectively aliases for other resources that do not behave like normal files. Depending on their functionality, they could be alternate entities. They are not necessarily listed in directories.",,Unknown,"Java Concurrency API: http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantLock.html
1177 Use reentrant functions for safer signal handling: http://www.ibm.com/developerworks/linux/library/l-reent.html"
1178 CWE-664,Improper Control of a Resource Through its Lifetime (Type: Class),"The software does not maintain or incorrectly maintains control over a resource throughout its lifetime of creation, use, and release.","Resources often have explicit instructions on how to be created, used and destroyed. When software does not follow these instructions, it can lead to unexpected behaviors and potentially exploitable states.
1179 Even without explicit instructions, various principles are expected to be adhered to, such as ""Do not use an object until after its creation is complete,"" or ""do not use an object after it has been slated for destruction.""",,Unknown,
1180 CWE-666,Operation on Resource in Wrong Phase of Lifetime (Type: Base),"The software performs an operation on a resource at the wrong phase of the resource's lifecycle, which can lead to unexpected behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1181 CWE-667,Improper Locking (Type: Base),"The software does not properly acquire a lock on a resource, or it does not properly release a lock on a resource, leading to unexpected resource state changes and behaviors.","When a developer wants to initialize, use or release a resource, it is important to follow the specifications outlined for how to operate on that resource and to ensure that the resource is in the expected state. In this case, the software wants to perform a normally valid operation, initialization, use or release, on a resource when it is in the incorrect phase of its lifetime.",,Unknown,
1182 CWE-668,Exposure of Resource to Wrong Sphere (Type: Class),"The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1183 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
1184 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1185 CWE-669,Incorrect Resource Transfer Between Spheres (Type: Class),"The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.","Resources such as files and directories may be inadvertently exposed through mechanisms such as insecure permissions, or when a program accidentally operates on the wrong object. For example, a program may intend that private files can only be provided to a specific user. This effectively defines a control sphere that is intended to prevent attackers from accessing these private files. If the file permissions are insecure, then parties other than the user will be able to access those files.
1186 A separate control sphere might effectively require that the user can only access the private files, but not any other files on the system. If the program does not ensure that the user is only requesting private files, then the user might be able to access other files on the system.
1187 In either case, the end result is that a resource has been exposed to the wrong party.",,Unknown,
1188 CWE-670,Always-Incorrect Control Flow Implementation (Type: Class),"The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.","This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.",,Unknown,
1189 CWE-671,Lack of Administrator Control over Security (Type: Class),The product uses security features in a way that prevents the product's administrator from tailoring security settings to reflect the environment in which the product is being used. This introduces resultant weaknesses or prevents it from operating at a level of security that is desired by the administrator.,"If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1190 CWE-672,Operation on a Resource after Expiration or Release (Type: Base),"The software uses, accesses, or otherwise operates on a resource after that resource has been expired, released, or revoked.","If the product's administrator does not have the ability to manage security-related decisions at all times, then protecting the product from outside threats - including the product's developer - can become impossible. For example, a hard-coded account name and password cannot be changed by the administrator, thus exposing that product to attacks that the administrator can not prevent.",,Unknown,
1191 CWE-673,External Influence of Sphere Definition (Type: Class),The product does not prevent the definition of control spheres from external actors.,"Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1192 CWE-674,Uncontrolled Recursion (Type: Base),"The product does not properly control the amount of recursion that takes place, which consumes excessive resources, such as allocated memory or the program stack.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1193 CWE-675,Duplicate Operations on Resource (Type: Class),"The product performs the same operation on a resource two or more times, when the operation should only be applied once.","Typically, a product defines its control sphere within the code itself, or through configuration by the product's administrator. In some cases, an external party can change the definition of the control sphere. This is typically a resultant weakness.",,Unknown,
1194 CWE-683,Function Call With Incorrect Order of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the arguments in an incorrect order, leading to resultant weaknesses.","While this weakness might be caught by the compiler in some languages, it can occur more frequently in cases in which the called function accepts variable numbers or types of arguments, such as format strings in C. It also can occur in languages or environments that do not enforce strong typing.",,Unknown,
1195 CWE-684,Incorrect Provision of Specified Functionality (Type: Base),"The code does not function according to its published specifications, potentially leading to incorrect usage.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1196 CWE-685,Function Call With Incorrect Number of Arguments (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies too many arguments, or too few arguments, which may lead to undefined behavior and resultant weaknesses.","When providing functionality to an external party, it is important that the software behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.",,Unknown,
1197 CWE-686,Function Call With Incorrect Argument Type (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that is the wrong data type, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1198 CWE-687,Function Call With Incorrectly Specified Argument Value (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies an argument that contains the wrong value, which may lead to resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1199 CWE-688,Function Call With Incorrect Variable or Reference as Argument (Type: Variant),"The software calls a function, procedure, or routine, but the caller specifies the wrong variable or reference as one of the arguments, which may lead to undefined behavior and resultant weaknesses.","This weakness is most likely to occur in loosely typed languages, or in strongly typed languages in which the types of variable arguments cannot be enforced at compilation time, or where there is implicit casting.",,Unknown,
1200 CWE-69,Improper Handling of Windows ::DATA Alternate Data Stream (Type: Variant),"The software does not properly prevent access to, or detect usage of, alternate data streams (ADS).","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,"Windows NTFS Alternate Data Streams: http://www.securityfocus.com/infocus/1822
1201 Writing Secure Code"
1202 CWE-691,Insufficient Control Flow Management (Type: Class),"The code does not sufficiently manage its control flow during execution, creating conditions in which the control flow can be modified in unexpected ways.","An attacker can use an ADS to hide information about a file (e.g. size, the name of the process) from a system or file browser tools such as Windows Explorer and 'dir' at the command line utility. Alternately, the attacker might be able to bypass intended access restrictions for the associated data fork.",,Unknown,
1203 CWE-693,Protection Mechanism Failure (Type: Class),The product does not use or incorrectly uses a protection mechanism that provides sufficient defense against directed attacks against the product.,"This weakness covers three distinct situations. A ""missing"" protection mechanism occurs when the application does not define any mechanism against a certain class of attack. An ""insufficient"" protection mechanism might provide some defenses - for example, against the most common attacks - but it does not protect against everything that is intended. Finally, an ""ignored"" mechanism occurs when a mechanism is available and in active use within the product, but the developer has not applied it in some code path.",,Unknown,
1204 CWE-694,Use of Multiple Resources with Duplicate Identifier (Type: Base),"The software uses multiple resources that can have the same identifier, in a context in which unique identifiers are required.","If the software assumes that each resource has a unique identifier, the software could operate on the wrong resource if attackers can cause multiple resources to be associated with the same identifier.",,Unknown,
1205 CWE-695,Use of Low-Level Functionality (Type: Base),The software uses low-level functionality that is explicitly prohibited by the framework or specification under which the software is supposed to operate.,"The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1206 CWE-696,Incorrect Behavior Order (Type: Class),"The software performs multiple related behaviors, but the behaviors are performed in the wrong order in ways which may produce resultant weaknesses.","The use of low-level functionality can violate the specification in unexpected ways that effectively disable built-in protection mechanisms, introduce exploitable inconsistencies, or otherwise expose the functionality to attack.",,Unknown,
1207 CWE-697,Insufficient Comparison (Type: Class),"The software compares two entities in a security-relevant context, but the comparison is insufficient, which may lead to resultant weaknesses.","This weakness class covers several possibilities:
1208 the comparison checks one factor incorrectly;
1209 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,
1210 CWE-698,Execution After Redirect (EAR) (Type: Base),"The web application sends a redirect to another location, but instead of exiting, it executes additional code.","This weakness class covers several possibilities:
1211 the comparison checks one factor incorrectly;
1212 the comparison should consider multiple factors, but it does not check some of those factors at all.",,Unknown,Fear the EAR: Discovering and Mitigating Execution After Redirect Vulnerabilities: http://cs.ucsb.edu/~bboe/public/pubs/fear-the-ear-ccs2011.pdf
1213 CWE-7,J2EE Misconfiguration: Missing Custom Error Page (Type: Variant),The default error page of a web application should not display sensitive information about the software system.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,19 Deadly Sins of Software Security
1214 CWE-703,Improper Check or Handling of Exceptional Conditions (Type: Class),The software does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the software.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,"A Taxonomy of Security Faults in the UNIX Operating System: http://ftp.cerias.purdue.edu/pub/papers/taimur-aslam/aslam-taxonomy-msthesis.pdf
1215 Use of A Taxonomy of Security Faults: http://csrc.nist.gov/nissc/1996/papers/NISSC96/paper057/PAPER.PDF
1216 24 Deadly Sins of Software Security: ""Sin 8: C++ Catastrophes."" Page 143"
1217 CWE-704,Incorrect Type Conversion or Cast (Type: Class),"The software does not correctly convert an object, resource or structure from one type to a different type.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1218 CWE-705,Incorrect Control Flow Scoping (Type: Class),The software does not properly return control flow to the proper location after it has completed a task or detected an unusual condition.,"A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1219 CWE-706,Use of Incorrectly-Resolved Name or Reference (Type: Class),"The software uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.","A Web application must define a default error page for 4xx errors (e.g. 404), 5xx (e.g. 500) errors and catch java.lang.Throwable exceptions to prevent attackers from mining information from the application container's built-in error response.",,Unknown,
1220 CWE-707,Improper Enforcement of Message or Data Structure (Type: Class),The software does not enforce or incorrectly enforces that structured messages or data are well-formed before being read from an upstream component or sent to a downstream component.,"If a message is malformed it may cause the message to be incorrectly interpreted.
1221 This weakness typically applies in cases where the product prepares a control message that another process must act on, such as a command or query, and malicious input that was intended as data, can enter the control plane instead. However, this weakness also applies to more general cases where there are not always control implications.",,Unknown,
1222 CWE-708,Incorrect Ownership Assignment (Type: Base),"The software assigns an owner to a resource, but the owner is outside of the intended control sphere.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1223 CWE-71,Apple .DS_Store (Type: Variant),"Software operating in a MAC OS environment, where .DS_Store is in effect, must carefully manage hard links, otherwise an attacker may be able to leverage a hard link from .DS_Store to overwrite arbitrary files and gain privileges.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1224 CWE-710,Coding Standards Violation (Type: Class),"The software does not follow certain coding rules for development, which can lead to resultant weaknesses or increase the severity of the associated vulnerabilities.",This may allow the resource to be manipulated by actors outside of the intended control sphere.,,Unknown,
1225 CWE-72,Improper Handling of Apple HFS+ Alternate Data Stream Path (Type: Variant),The software does not properly handle special paths that may identify the data or resource fork of a file on the HFS+ file system.,"If the software chooses actions to take based on the file name, then if an attacker provides the data or resource fork, the software may take unexpected actions. Further, if the software intends to restrict access to a file, then an attacker might still be able to bypass intended access restrictions by requesting the data or resource fork for that file.",,Unknown,No description: http://docs.info.apple.com/article.html?artnum=300422
1226 CWE-733,Compiler Optimization Removal or Modification of Security-critical Code (Type: Base),The developer builds a security-critical protection mechanism into the software but the compiler optimizes the program such that the mechanism is removed or modified.,"When a resource is given a permissions setting that provides access to a wider range of actors than required, it could lead to the exposure of sensitive information, or the modification of that resource by unintended parties. This is especially dangerous when the resource is related to program configuration, execution or sensitive user data.",,Unknown,"Writing Secure Code: Chapter 9, ""A Compiler Optimization Caveat"" Page 322"
1227 CWE-75,Failure to Sanitize Special Elements into a Different Plane (Special Element Injection) (Type: Class),The software does not adequately filter user-controlled input for special elements with control implications.,"This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on.
1228 The exposure can occur in a few different ways:
1229 1) The function/method was never intended to be exposed to outside actors.
1230 2) The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.",,Unknown,
1231 CWE-756,Missing Custom Error Page (Type: Class),"The software does not return custom error pages to the user, possibly exposing sensitive information.","The programmer may assume that certain events or conditions will never occur or do not need to be worried about, such as low memory conditions, lack of access to resources due to restrictive permissions, or misbehaving clients or components. However, attackers may intentionally trigger these unusual conditions, thus violating the programmer's assumptions, possibly introducing instability, incorrect behavior, or a vulnerability.
1232 Note that this entry is not exclusively about the use of exceptions and exception handling, which are mechanisms for both checking and handling unusual or unexpected conditions.",,Unknown,
1233 CWE-757,Selection of Less-Secure Algorithm During Negotiation (Algorithm Downgrade) (Type: Class),"A protocol or its implementation supports interaction between multiple actors and allows those actors to negotiate which algorithm should be used as a protection mechanism such as encryption or authentication, but it does not select the strongest algorithm that is available to both parties.","When a security mechanism can be forced to downgrade to use a less secure algorithm, this can make it easier for attackers to compromise the software by exploiting weaker algorithm. The victim might not be aware that the less secure algorithm is being used. For example, if an attacker can force a communications channel to use cleartext instead of strongly-encrypted data, then the attacker could read the channel by sniffing, instead of going through extra effort of trying to decrypt the data using brute force techniques.",,Unknown,
1234 CWE-758,"Reliance on Undefined, Unspecified, or Implementation-Defined Behavior (Type: Class)","The software uses an API function, data structure, or other entity in a way that relies on properties that are not always guaranteed to hold for that entity.","This can lead to resultant weaknesses when the required properties change, such as when the software is ported to a different platform or if an interaction error (CWE-435) occurs.",,Unknown,
1235 CWE-759,Use of a One-Way Hash without a Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software does not also use a salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables.
1236 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1237 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1238 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1239 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1240 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1241 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1242 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1243 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1244 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1245 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1246 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1247 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1248 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1249 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1250 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1251 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1252 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1253 CWE-760,Use of a One-Way Hash with a Predictable Salt (Type: Base),"The software uses a one-way cryptographic hash against an input that should not be reversible, such as a password, but the software uses a predictable salt as part of the input.","This makes it easier for attackers to pre-compute the hash value using dictionary attack techniques such as rainbow tables, effectively disabling the protection that an unpredictable salt would provide.
1254 It should be noted that, despite common perceptions, the use of a good salt with a hash does not sufficiently increase the effort for an attacker who is targeting an individual password, or who has a large amount of computing resources available, such as with cloud-based services or specialized, inexpensive hardware. Offline password cracking can still be effective if the hash function is not expensive to compute; many cryptographic functions are designed to be efficient and can be vulnerable to attacks using massive computing resources, even if the hash is cryptographically strong. The use of a salt only slightly increases the computing requirements for an attacker compared to other strategies such as adaptive hash functions. See CWE-916 for more details.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1255 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1256 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1257 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1258 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1259 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1260 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1261 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1262 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1263 Password Hashing: http://phpsec.org/articles/2005/password-hashing.html
1264 Rainbow Hash Cracking: http://www.codinghorror.com/blog/archives/000949.html
1265 Rainbow table: http://en.wikipedia.org/wiki/Rainbow_table
1266 Writing Secure Code: Chapter 9, ""Creating a Salted Hash"" Page 302
1267 The Art of Software Security Assessment: Chapter 2, ""Salt Values"", Page 46.
1268 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1269 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1270 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1271 CWE-761,Free of Pointer not at Start of Buffer (Type: Variant),"The application calls free() on a pointer to a memory resource that was allocated on the heap, but the pointer is not at the start of the buffer.","This can cause the application to crash, or in some cases, modify critical program variables or execute code.
1272 This weakness often occurs when the memory is allocated explicitly on the heap with one of the malloc() family functions and free() is called, but pointer arithmetic has caused the pointer to be in the interior or end of the buffer.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1273 Valgrind: http://valgrind.org/"
1274 CWE-763,Release of Invalid Pointer or Reference (Type: Base),"The application attempts to return a memory resource to the system, but calls the wrong release function or calls the appropriate release function incorrectly.","This weakness can take several forms, such as:
1275 The memory was allocated, explicitly or implicitly, via one memory management method and deallocated using a different, non-compatible function (CWE-762).
1276 The function calls or memory management routines chosen are appropriate, however they are used incorrectly, such as in CWE-761.",,Unknown,"boost C++ Library Smart Pointers: http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/smart_ptr.htm
1277 Valgrind: http://valgrind.org/"
1278 CWE-764,Multiple Locks of a Critical Resource (Type: Variant),"The software locks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly locks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra locking calls will reduce the size of the total available pool, possibly leading to degraded performance or a denial of service. If this can be triggered by an attacker, it will be similar to an unrestricted lock (CWE-412). In the context of a binary lock, it is likely that any duplicate locking attempts will never succeed since the lock is already held and progress may not be possible.",,Unknown,
1279 CWE-765,Multiple Unlocks of a Critical Resource (Type: Variant),"The software unlocks a critical resource more times than intended, leading to an unexpected state in the system.","When software is operating in a concurrent environment and repeatedly unlocks a critical resource, the consequences will vary based on the type of lock, the lock's implementation, and the resource being protected. In some situations such as with semaphores, the resources are pooled and extra calls to unlock will increase the count for the number of available resources, likely resulting in a crash or unpredictable behavior when the system nears capacity.",,Unknown,
1280 CWE-785,Use of Path Manipulation Function without Maximum-sized Buffer (Type: Variant),"The software invokes a function for normalizing paths or file names, but it provides an output buffer that is smaller than the maximum possible size, such as PATH_MAX.","Passing an inadequately-sized output buffer to a path manipulation function can result in a buffer overflow. Such functions include realpath(), readlink(), PathAppend(), and others.",,Unknown,
1281 CWE-786,Access of Memory Location Before Start of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location prior to the beginning of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used.",,Unknown,
1282 CWE-787,Out-of-bounds Write (Type: Base),"The software writes data past the end, or before the beginning, of the intended buffer.","This typically occurs when the pointer or its index is incremented or decremented to a position beyond the bounds of the buffer or when pointer arithmetic results in a position outside of the valid memory location to name a few. This may result in corruption of sensitive information, a crash, or code execution among other things.",,Unknown,
1283 CWE-788,Access of Memory Location After End of Buffer (Type: Base),The software reads or writes to a buffer using an index or pointer that references a memory location after the end of the buffer.,"This typically occurs when a pointer or its index is decremented to a position before the buffer, when pointer arithmetic results in a position before the beginning of the valid memory location, or when a negative index is used. These problems may be resultant from missing sentinel values (CWE-463) or trusting a user-influenced input length variable.",,Unknown,
1284 CWE-790,Improper Filtering of Special Elements (Type: Class),"The software receives data from an upstream component, but does not filter or incorrectly filters special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1285 1. Untrusted data enters a web application, typically from a web request.
1286 2. The web application dynamically generates a web page that contains this untrusted data.
1287 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
1288 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1289 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
1290 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
1291 There are three main kinds of XSS:
1292 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
1293 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
1294 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
1295 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
1296 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1297 CWE-791,Incomplete Filtering of Special Elements (Type: Base),"The software receives data from an upstream component, but does not completely filter special elements before sending it to a downstream component.","Cross-site scripting (XSS) vulnerabilities occur when:
1298 1. Untrusted data enters a web application, typically from a web request.
1299 2. The web application dynamically generates a web page that contains this untrusted data.
1300 3. During page generation, the application does not prevent the data from containing content that is executable by a web browser, such as JavaScript, HTML tags, HTML attributes, mouse events, Flash, ActiveX, etc.
1301 4. A victim visits the generated web page through a web browser, which contains malicious script that was injected using the untrusted data.
1302 5. Since the script comes from a web page that was sent by the web server, the victim's web browser executes the malicious script in the context of the web server's domain.
1303 6. This effectively violates the intention of the web browser's same-origin policy, which states that scripts in one domain should not be able to access resources or run code in a different domain.
1304 There are three main kinds of XSS:
1305 The server reads data directly from the HTTP request and reflects it back in the HTTP response. Reflected XSS exploits occur when an attacker causes a victim to supply dangerous content to a vulnerable web application, which is then reflected back to the victim and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to the victim. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces a victim to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
1306 The application stores dangerous data in a database, message forum, visitor log, or other trusted data store. At a later time, the dangerous data is subsequently read back into the application and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user. For example, the attacker might inject XSS into a log message, which might not be handled properly when an administrator views the logs.
1307 In DOM-based XSS, the client performs the injection of XSS into the page; in the other types, the server performs the injection. DOM-based XSS generally involves server-controlled, trusted script that is sent to the client, such as Javascript that performs sanity checks on a form before the user submits it. If the server-supplied script processes user-supplied data and then injects it back into the web page (such as with dynamic HTML), then DOM-based XSS is possible.
1308 Once the malicious script is injected, the attacker can perform a variety of malicious activities. The attacker could transfer private information, such as cookies that may include session information, from the victim's machine to the attacker. The attacker could send malicious requests to a web site on behalf of the victim, which could be especially dangerous to the site if the victim has administrator privileges to manage that site. Phishing attacks could be used to emulate trusted web sites and trick the victim into entering a password, allowing the attacker to compromise the victim's account on that web site. Finally, the script could exploit a vulnerability in the web browser itself possibly taking over the victim's machine, sometimes referred to as ""drive-by hacking.""
1309 In many cases, the attack can be launched without the victim even being aware of it. Even with careful users, attackers frequently use a variety of methods to encode the malicious portion of the attack, such as URL encoding or Unicode, so the request looks less suspicious.",,Unknown,
1310 CWE-792,Incomplete Filtering of One or More Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not completely filter one or more instances of special elements before sending it to a downstream component.","Incomplete filtering of this nature involves either
1311 only filtering a single instance of a special element when more exist, or
1312 not filtering all instances or all elements where multiple special elements exist.",,Unknown,
1313 CWE-793,Only Filtering One Instance of a Special Element (Type: Variant),"The software receives data from an upstream component, but only filters a single instance of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be location-dependent, as in only the first or last element is filtered.",,Unknown,
1314 CWE-794,Incomplete Filtering of Multiple Instances of Special Elements (Type: Variant),"The software receives data from an upstream component, but does not filter all instances of a special element before sending it to a downstream component.","Incomplete filtering of this nature may be applied to
1315 sequential elements (special elements that appear next to each other) or
1316 non-sequential elements (special elements that appear multiple times in different locations).",,Unknown,
1317 CWE-795,Only Filtering Special Elements at a Specified Location (Type: Base),"The software receives data from an upstream component, but only accounts for special elements at a specified location, thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1318 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1319 at an absolute position (e.g. ""byte number 10"").
1320 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1321 CWE-796,Only Filtering Special Elements Relative to a Marker (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements positioned relative to a marker (e.g. ""at the beginning/end of a string; the second argument""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1322 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1323 at an absolute position (e.g. ""byte number 10"").
1324 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1325 CWE-797,Only Filtering Special Elements at an Absolute Position (Type: Variant),"The software receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. ""byte number 10""), thereby missing remaining special elements that may exist before sending it to a downstream component.","A filter might only account for instances of special elements when they occur:
1326 relative to a marker (e.g. ""at the beginning/end of string; the second argument""), or
1327 at an absolute position (e.g. ""byte number 10"").
1328 This may leave special elements in the data that did not match the filter position, but still may be dangerous.",,Unknown,
1329 CWE-799,Improper Control of Interaction Frequency (Type: Class),"The software does not properly limit the number or frequency of interactions that it has with an actor, such as the number of incoming requests.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,Insufficient Anti-automation: http://projects.webappsec.org/Insufficient+Anti-automation
1330 CWE-8,J2EE Misconfiguration: Entity Bean Declared Remote (Type: Variant),"When an application exposes a remote interface for an entity bean, it might also expose methods that get or set the bean's data. These methods could be leveraged to read sensitive information, or to change data in ways that violate the application's expectations, potentially leading to other vulnerabilities.","This can allow the actor to perform actions more frequently than expected. The actor could be a human or an automated process such as a virus or bot. This could be used to cause a denial of service, compromise program logic (such as limiting humans to a single vote), or other consequences. For example, an authentication routine might not limit the number of times an attacker can guess a password. Or, a web site might conduct a poll but only expect humans to vote a maximum of once a day.",,Unknown,
1331 CWE-81,Improper Neutralization of Script in an Error Message Web Page (Type: Variant),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters that could be interpreted as web-scripting elements when they are sent to an error page.","Error pages may include customized 403 Forbidden or 404 Not Found pages.
1332 When an attacker can trigger an error that contains unneutralized input, then cross-site scripting attacks may be possible.",,Unknown,"24 Deadly Sins of Software Security: ""Sin 11: Failure to Handle Errors Correctly."" Page 183"
1333 CWE-82,Improper Neutralization of Script in Attributes of IMG Tags in a Web Page (Type: Variant),"The web application does not neutralize or incorrectly neutralizes scripting elements within attributes of HTML IMG tags, such as the src attribute.","Attackers can embed XSS exploits into the values for IMG attributes (e.g. SRC) that is streamed and then executed in a victim's browser. Note that when the page is loaded into a user's browsers, the exploit will automatically execute.",,Unknown,
1334 CWE-820,Missing Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but does not attempt to synchronize access to the resource.,"If access to a shared resource is not synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1335 CWE-821,Incorrect Synchronization (Type: Base),The software utilizes a shared resource in a concurrent manner but it does not correctly synchronize access to the resource.,"If access to a shared resource is not correctly synchronized, then the resource may not be in a state that is expected by the software. This might lead to unexpected or insecure behaviors, especially if an attacker can influence the shared resource.",,Unknown,
1336 CWE-822,Untrusted Pointer Dereference (Type: Base),"The program obtains a value from an untrusted source, converts this value to a pointer, and dereferences the resulting pointer.","An attacker can supply a pointer for memory locations that the program is not expecting. If the pointer is dereferenced for a write operation, the attack might allow modification of critical program state variables, cause a crash, or execute code. If the dereferencing operation is for a read, then the attack might allow reading of sensitive data, cause a crash, or set a program variable to an unexpected value (since the value will be read from an unexpected memory location).
1337 There are several variants of this weakness, including but not necessarily limited to:
1338 The untrusted value is directly invoked as a function call.
1339 In OS kernels or drivers where there is a boundary between ""userland"" and privileged memory spaces, an untrusted pointer might enter through an API or system call (see CWE-781 for one such example).
1340 Inadvertently accepting the value from an untrusted control sphere when it did not have to be accepted as input at all. This might occur when the code was originally developed to be run by a single user in a non-networked environment, and the code is then ported to or otherwise exposed to a networked environment.",,Unknown,
1341 CWE-823,Use of Out-of-range Pointer Offset (Type: Base),"The program performs pointer arithmetic on a valid pointer, but it uses an offset that can point outside of the intended range of valid memory locations for the resulting pointer.","While a pointer can contain a reference to any arbitrary memory location, a program typically only intends to use the pointer to access limited portions of memory, such as contiguous memory used to access an individual array.
1342 Programs may use offsets in order to access fields or sub-elements stored within structured data. The offset might be out-of-range if it comes from an untrusted source, is the result of an incorrect calculation, or occurs because of another error.
1343 If an attacker can control or influence the offset so that it points outside of the intended boundaries of the structure, then the attacker may be able to read or write to memory locations that are used elsewhere in the program. As a result, the attack might change the state of the software as accessed through program variables, cause a crash or instable behavior, and possibly lead to code execution.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Pointer Arithmetic"", Page 277."
1344 CWE-824,Access of Uninitialized Pointer (Type: Base),The program accesses or uses a pointer that has not been initialized.,"If the pointer contains an uninitialized value, then the value might not point to a valid memory location. This could cause the program to read from or write to unexpected memory locations, leading to a denial of service. If the uninitialized pointer is used as a function call, then arbitrary functions could be invoked. If an attacker can influence the portion of uninitialized memory that is contained in the pointer, this weakness could be leveraged to execute code or perform other attacks.
1345 Depending on memory layout, associated memory management behaviors, and program operation, the attacker might be able to influence the contents of the uninitialized pointer, thus gaining more fine-grained control of the memory location to be accessed.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Variable Initialization"", Page 312."
1346 CWE-825,Expired Pointer Dereference (Type: Base),"The program dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.","When a program releases memory, but it maintains a pointer to that memory, then the memory might be re-allocated at a later time. If the original pointer is accessed to read or write data, then this could cause the program to read or modify data that is in use by a different function or process. Depending on how the newly-allocated memory is used, this could lead to a denial of service, information exposure, or code execution.",,Unknown,
1347 CWE-826,Premature Release of Resource During Expected Lifetime (Type: Base),The program releases a resource that is still intended to be used by the program itself or another actor.,"This weakness focuses on errors in which the program should not release a resource, but performs the release anyway. This is different than a weakness in which the program releases a resource at the appropriate time, but it maintains a reference to the resource, which it later accesses. For this weaknesses, the resource should still be valid upon the subsequent access.
1348 When a program releases a resource that is still being used, it is possible that operations will still be taken on this resource, which may have been repurposed in the meantime, leading to issues similar to CWE-825. Consequences may include denial of service, information exposure, or code execution.",,Unknown,
1349 CWE-827,Improper Control of Document Type Definition (Type: Base),"The software does not restrict a reference to a Document Type Definition (DTD) to the intended control sphere. This might allow attackers to reference arbitrary DTDs, possibly causing the software to expose files, consume excessive system resources, or execute arbitrary http requests on behalf of the attacker.","As DTDs are processed, they might try to read or include files on the machine performing the parsing. If an attacker is able to control the DTD, then the attacker might be able to specify sensitive resources or requests or provide malicious content.
1350 For example, the SOAP specification prohibits SOAP messages from containing DTDs.",,Unknown,Apache CXF Security Advisory (CVE-2010-2076): http://svn.apache.org/repos/asf/cxf/trunk/security/CVE-2010-2076.pdf
1351 CWE-828,Signal Handler with Functionality that is not Asynchronous-Safe (Type: Base),"The software defines a signal handler that contains code sequences that are not asynchronous-safe, i.e., the functionality is not reentrant, or it can be interrupted.","This can lead to an unexpected system state with a variety of potential consequences depending on context, including denial of service and code execution.
1352 Signal handlers are typically intended to interrupt normal functionality of a program, or even other signals, in order to notify the process of an event. When a signal handler uses global or static variables, or invokes functions that ultimately depend on such state or its associated metadata, then it could corrupt system state that is being used by normal functionality. This could subject the program to race conditions or other weaknesses that allow an attacker to cause the program state to be corrupted. While denial of service is frequently the consequence, in some cases this weakness could be leveraged for code execution.
1353 There are several different scenarios that introduce this issue:
1354 Invocation of non-reentrant functions from within the handler. One example is malloc(), which modifies internal global variables as it manages memory. Very few functions are actually reentrant.
1355 Code sequences (not necessarily function calls) contain non-atomic use of global variables, or associated metadata or structures, that can be accessed by other functionality of the program, including other signal handlers. Frequently, the same function is registered to handle multiple signals.
1356 The signal handler function is intended to run at most one time, but instead it can be invoked multiple times. This could happen by repeated delivery of the same signal, or by delivery of different signals that have the same handler function (CWE-831).
1357 Note that in some environments or contexts, it might be possible for the signal handler to be interrupted itself.
1358 If both a signal handler and the normal behavior of the software have to operate on the same set of state variables, and a signal is received in the middle of the normal execution's modifications of those variables, the variables may be in an incorrect or corrupt state during signal handler execution, and possibly still incorrect or corrupt upon return.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
1359 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1360 CWE-829,Inclusion of Functionality from Untrusted Control Sphere (Type: Class),"The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1361 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
1362 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html"
1363 CWE-83,Improper Neutralization of Script in Attributes in a Web Page (Type: Variant),"The software does not neutralize or incorrectly neutralizes ""javascript:"" or other URIs from dangerous attributes within tags, such as onmouseover, onload, onerror, or style.","When including third-party functionality, such as a web widget, library, or other source of functionality, the software must effectively trust that functionality. Without sufficient protection mechanisms, the functionality could be malicious in nature (either by coming from an untrusted source, being spoofed, or being modified in transit from a trusted source). The functionality might also contain its own weaknesses, or grant access to additional functionality and state information that should be kept private to the base system, such as system state information, sensitive application data, or the DOM of a web application.
1364 This might lead to many different consequences depending on the included functionality, but some examples include injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, or open redirect to malware (CWE-601).",,Unknown,
1365 CWE-830,Inclusion of Web Functionality from an Untrusted Source (Type: Base),"The software includes web functionality (such as a web widget) from another domain, which causes it to operate within the domain of the software, potentially granting total access and control of the software to the untrusted source.","Including third party functionality in a web-based environment is risky, especially if the source of the functionality is untrusted.
1366 Even if the third party is a trusted source, the software may still be exposed to attacks and malicious behavior if that trusted source is compromised, or if the code is modified in transmission from the third party to the software.
1367 This weakness is common in ""mashup"" development on the web, which may include source functionality from other domains. For example, Javascript-based web widgets may be inserted by using '<SCRIPT SRC=""http://other.domain.here"">' tags, which causes the code to run in the domain of the software, not the remote site from which the widget was loaded. As a result, the included code has access to the local DOM, including cookies and other data that the developer might not want the remote site to be able to access.
1368 Such dependencies may be desirable, or even required, but sometimes programmers are not aware that a dependency exists.",,Unknown,Third-Party Web Widget Security FAQ: http://jeremiahgrossman.blogspot.com/2010/07/third-party-web-widget-security-faq.html
1369 CWE-831,Signal Handler Function Associated with Multiple Signals (Type: Base),The software defines a function that is used as a handler for more than one signal.,"While sometimes intentional and safe, when the same function is used to handle multiple signals, a race condition could occur if the function uses any state outside of its local declaration, such as global variables or non-reentrant functions, or has any side effects.
1370 An attacker could send one signal that invokes the handler function; in many OSes, this will typically prevent the same signal from invoking the handler again, at least until the handler function has completed execution. However, the attacker could then send a different signal that is associated with the same handler function. This could interrupt the original handler function while it is still executing. If there is shared state, then the state could be corrupted. This can lead to a variety of potential consequences depending on context, including denial of service and code execution.
1371 Another rarely-explored possibility arises when the signal handler is only designed to be executed once (if at all). By sending multiple signals, an attacker could invoke the function more than once. This may generate extra, unintended side effects. A race condition might not even be necessary; the attacker could send one signal, wait until it is handled, then send the other signal.",,Unknown,"Delivering Signals for Fun and Profit: http://lcamtuf.coredump.cx/signals.txt
1372 Race Condition: Signal Handling: http://www.fortify.com/vulncat/en/vulncat/cpp/race_condition_signal_handling.html"
1373 CWE-832,Unlock of a Resource that is not Locked (Type: Base),The software attempts to unlock a resource that is not locked.,"Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,
1374 CWE-833,Deadlock (Type: Base),"The software contains multiple threads or executable segments that are waiting for each other to release a necessary lock, resulting in deadlock.","Depending on the locking functionality, an unlock of a non-locked resource might cause memory corruption or other modification to the resource (or its associated metadata that is used for tracking locks).",,Unknown,"The Art of Software Security Assessment: Chapter 13, ""Synchronization Problems"" / ""Starvation and Deadlocks"", Page 760
1375 The Art of Software Security Assessment: Chapter 13, ""Starvation and Deadlocks"", Page 760.
1376 Secure Coding in C and C++: Chapter 7, ""Concurrency"", section ""Mutual Exclusion and Deadlock"", Page 248."
1377 CWE-834,Excessive Iteration (Type: Base),The software performs an iteration or loop without sufficiently limiting the number of times that the loop is executed.,"If the iteration can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory. In many cases, a loop does not need to be infinite in order to cause enough resource consumption to adversely affect the software or its host system; it depends on the amount of resources consumed per iteration.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1378 CWE-835,Loop with Unreachable Exit Condition (Infinite Loop) (Type: Base),"The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.","If the loop can be influenced by an attacker, this weakness could allow attackers to consume excessive resources such as CPU or memory.",,Unknown,"The Art of Software Security Assessment: Chapter 7, ""Looping Constructs"", Page 327."
1379 CWE-836,Use of Password Hash Instead of Password for Authentication (Type: Base),"The software records password hashes in a data store, receives a hash of a password from a client, and compares the supplied hash to the hash obtained from the data store.","Some authentication mechanisms rely on the client to generate the hash for a password, possibly to reduce load on the server or avoid sending the password across the network. However, when the client is used to generate the hash, an attacker can bypass the authentication by obtaining a copy of the hash, e.g. by using SQL injection to compromise a database of authentication credentials, or by exploiting an information exposure. The attacker could then use a modified client to replay the stolen hash without having knowledge of the original password.
1380 As a result, the server-side comparison against a client-side hash does not provide any more security than the use of passwords without hashing.",,Unknown,
1381 CWE-837,"Improper Enforcement of a Single, Unique Action (Type: Base)","The software requires that an actor should only be able to perform an action once, or to have only one unique action, but the software does not enforce or improperly enforces this restriction.","In various applications, a user is only expected to perform a certain action once, such as voting, requesting a refund, or making a purchase. When this restriction is not enforced, sometimes this can have security implications. For example, in a voting application, an attacker could attempt to ""stuff the ballot box"" by voting multiple times. If these votes are counted separately, then the attacker could directly affect who wins the vote. This could have significant business impact depending on the purpose of the software.",,Unknown,
1382 CWE-838,Inappropriate Encoding for Output Context (Type: Base),"The software uses or specifies an encoding when generating output to a downstream component, but the specified encoding is not the same as the encoding that is expected by the downstream component.","This weakness can cause the downstream component to use a decoding method that produces different data than what the software intended to send. When the wrong encoding is used - even if closely related - the downstream component could decode the data incorrectly. This can have security consequences when the provided boundaries between control and data are inadvertently broken, because the resulting data could introduce control characters or special elements that were not sent by the software. The resulting data could then be used to bypass protection mechanisms such as input validation, and enable injection attacks.
1383 While using output encoding is essential for ensuring that communications between components are accurate, the use of the wrong encoding - even if closely related - could cause the downstream component to misinterpret the output.
1384 For example, HTML entity encoding is used for elements in the HTML body of a web page. However, a programmer might use entity encoding when generating output for that is used within an attribute of an HTML tag, which could contain functional Javascript that is not affected by the HTML encoding.
1385 While web applications have received the most attention for this problem, this weakness could potentially apply to any type of software that uses a communications stream that could support multiple encodings.",,Unknown,"Injection-safe templating languages: http://manicode.blogspot.com/2010/06/injection-safe-templating-languages_30.html
1386 Can we please stop saying that XSS is boring and easy to fix!: http://diniscruz.blogspot.com/2010/09/can-we-please-stop-saying-that-xss-is.html
1387 Canoe: XSS prevention via context-aware output encoding: http://blog.ivanristic.com/2010/09/introducing-canoe-context-aware-output-encoding-for-xss-prevention.html
1388 What is the Future of Automated XSS Defense Tools?: http://software-security.sans.org/downloads/appsec-2011-files/manico-appsec-future-tools.pdf
1389 XSS Attacks: Preventing XSS Attacks
1390 DOM based XSS Prevention Cheat Sheet: http://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet
1391 OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI"
1392 CWE-839,Numeric Range Comparison Without Minimum Check (Type: Base),"The program checks a value to ensure that it does not exceed a maximum, but it does not verify that the value exceeds the minimum.","Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1393 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,"The Art of Software Security Assessment: Chapter 6, ""Type Conversion Vulnerabilities"" Page 246.
1394 The Art of Software Security Assessment: Chapter 6, ""Comparisons"", Page 265."
1395 CWE-84,Improper Neutralization of Encoded URI Schemes in a Web Page (Type: Variant),The web application improperly neutralizes user-controlled input for executable script disguised with URI encodings.,"Some programs use signed integers or floats even when their values are only expected to be positive or 0. An input validation check might assume that the value is positive, and only check for the maximum value. If the value is negative, but the code assumes that the value is positive, this can produce an error. The error may have security consequences if the negative value is used for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer overflow or other type of memory corruption.
1396 The use of a negative number in a positive-only context could have security implications for other types of resources. For example, a shopping cart might check that the user is not requesting more than 10 items, but a request for -3 items could cause the application to calculate a negative price and credit the attacker's account.",,Unknown,
1397 CWE-841,Improper Enforcement of Behavioral Workflow (Type: Base),"The software supports a session in which more than one behavior must be performed by an actor, but it does not properly ensure that the actor performs the behaviors in the required sequence.","By performing actions in an unexpected order, or by omitting steps, an attacker could manipulate the business logic of the software or cause it to enter an invalid state. In some cases, this can also expose resultant weaknesses.
1398 For example, a file-sharing protocol might require that an actor perform separate steps to provide a username, then a password, before being able to transfer files. If the file-sharing server accepts a password command followed by a transfer command, without any username being provided, the software might still perform the transfer.
1399 Note that this is different than CWE-696, which focuses on when the software performs actions in the wrong sequence; this entry is closely related, but it is focused on ensuring that the actor performs actions in the correct sequence.
1400 Workflow-related behaviors include:
1401 Steps are performed in the expected order.
1402 Required steps are not omitted.
1403 Steps are not interrupted.
1404 Steps are performed in a timely fashion.",,Unknown,"Business Logic Flaws and Yahoo Games: http://jeremiahgrossman.blogspot.com/2006/12/business-logic-flaws.html
1405 Seven Business Logic Flaws That Put Your Website At Risk: http://www.whitehatsec.com/home/assets/WP_bizlogic092407.pdf
1406 Business Logic Flaws: http://www.whitehatsec.com/home/solutions/BL_auction.html
1407 Insufficient Process Validation: http://projects.webappsec.org/w/page/13246943/Insufficient-Process-Validation
1408 Defying Logic: Theory, Design, and Implementation of Complex Systems for Testing Application Logic: http://www.slideshare.net/RafalLos/defying-logic-business-logic-testing-with-automation
1409 Real-Life Example of a 'Business Logic Defect' (Screen Shots!): http://h30501.www3.hp.com/t5/Following-the-White-Rabbit-A/Real-Life-Example-of-a-Business-Logic-Defect-Screen-Shots/ba-p/22581
1410 Toward Automated Detection of Logic Vulnerabilities in Web Applications: http://www.usenix.org/events/sec10/tech/full_papers/Felmetsger.pdf
1411 Designing a Framework Method for Secure Business Application Logic Integrity in e-Commerce Systems: http://ijns.femto.com.tw/contents/ijns-v12-n1/ijns-2011-v12-n1-p29-41.pdf"
1412 CWE-842,Placement of User into Incorrect Group (Type: Base),The software or the administrator places a user into an incorrect group.,"If the incorrect group has more access or privileges than the intended group, the user might be able to bypass intended security policy to access unexpected resources or perform unexpected actions. The access-control system might not be able to detect malicious usage of this group membership.",,Unknown,
1413 CWE-843,Access of Resource Using Incompatible Type (Type Confusion) (Type: Base),"The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.","When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1414 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
1415 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,"Attacking Interoperability: http://www.azimuthsecurity.com/resources/bh2009_dowd_smith_dewey.pdf
1416 The Art of Software Security Assessment: Chapter 7, ""Type Confusion"", Page 319."
1417 CWE-85,Doubled Character XSS Manipulations (Type: Variant),The web application does not filter user-controlled input for executable script disguised using doubling of the involved characters.,"When the program accesses the resource using an incompatible type, this could trigger logical errors because the resource does not have expected properties. In languages without memory safety, such as C and C++, type confusion can lead to out-of-bounds memory access.
1418 While this weakness is frequently associated with unions when parsing data with many different embedded object types in C, it can be present in any application that can interpret the same variable or memory location in multiple ways.
1419 This weakness is not unique to C and C++. For example, errors in PHP applications can be triggered by providing array parameters when scalars are expected, or vice versa. Languages such as Perl, which perform automatic conversion of a variable of one type when it is accessed as if it were another type, can also contain these issues.",,Unknown,
1420 CWE-86,Improper Neutralization of Invalid Characters in Identifiers in Web Pages (Type: Variant),"The software does not neutralize or incorrectly neutralizes invalid characters or byte sequences in the middle of tag names, URI schemes, and other identifiers.","Some web browsers may remove these sequences, resulting in output that may have unintended control implications. For example, the software may attempt to remove a ""javascript:"" URI scheme, but a ""java%00script:"" URI may bypass this check and still be rendered as active javascript by some browsers, allowing XSS or other attacks.",,Unknown,
1421 CWE-87,Improper Neutralization of Alternate XSS Syntax (Type: Variant),The software does not neutralize or incorrectly neutralizes user-controlled input for alternate script syntax.,"Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1422 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,
1423 CWE-88,Argument Injection or Modification (Type: Base),"The software does not sufficiently delimit the arguments being passed to a component in another control sphere, allowing alternate arguments to be provided, leading to potentially security-relevant changes.","Assuming a user with a given identity, authorization is the process of determining whether that user can access a given resource, based on the user's privileges and any permissions or other access-control specifications that apply to the resource.
1424 When access control checks are incorrectly applied, users are able to access data or perform actions that they should not be allowed to perform. This can lead to a wide range of problems, including information exposures, denial of service, and arbitrary code execution.",,Unknown,"Argument injection issues: http://www.securityfocus.com/archive/1/archive/1/460089/100/100/threaded
1425 The Art of Software Security Assessment: Chapter 10, ""The Argument Array"", Page 567."
1426 CWE-9,J2EE Misconfiguration: Weak Access Permissions for EJB Methods (Type: Variant),"If elevated access rights are assigned to EJB methods, then an attacker can take advantage of the permissions to exploit the software system.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1427 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,
1428 CWE-90,Improper Neutralization of Special Elements used in an LDAP Query (LDAP Injection) (Type: Base),"The software constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1429 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Unknown,Web Applications and LDAP Injection
1430 CWE-91,XML Injection (aka Blind XPath Injection) (Type: Base),"The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.","Within XML, special elements could include reserved words or characters such as ""<"", "">"", """""", and ""&"", which could then be used to add new data or modify XML syntax.",,Unknown,"Blind XPath Injection: http://www.modsecurity.org/archive/amit/blind-xpath-injection.pdf
1431 The Art of Software Security Assessment: Chapter 17, ""XML Injection"", Page 1069."
1432 CWE-912,Hidden Functionality (Type: Class),"The software contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the software's users or administrators.","Hidden functionality can take many forms, such as intentionally malicious code, ""Easter Eggs"" that contain extraneous functionality such as games, developer-friendly shortcuts that reduce maintenance or support costs such as hard-coded accounts, etc. From a security perspective, even when the functionality is not intentionally malicious or damaging, it can increase the software's attack surface and expose additional weaknesses beyond what is already exposed by the intended functionality. Even if it is not easily accessible, the hidden functionality could be useful for attacks that modify the control flow of the application.",,Unknown,
1433 CWE-913,Improper Control of Dynamically-Managed Code Resources (Type: Class),"The software does not properly restrict reading from or writing to dynamically-managed code resources such as variables, objects, classes, attributes, functions, or executable instructions or statements.","Many languages offer powerful features that allow the programmer to dynamically create or modify existing code, or resources used by code such as variables and objects. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can directly influence these code resources in unexpected ways.",,Unknown,
1434 CWE-914,Improper Control of Dynamically-Identified Variables (Type: Base),The software does not properly restrict reading from or writing to dynamically-identified variables.,"Many languages offer powerful features that allow the programmer to access arbitrary variables that are specified by an input string. While these features can offer significant flexibility and reduce development time, they can be extremely dangerous if attackers can modify unintended variables that have security implications.",,Unknown,
1435 CWE-915,Improperly Controlled Modification of Dynamically-Determined Object Attributes (Type: Base),"The software receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified.","If the object contains attributes that were only intended for internal use, then their unexpected modification could lead to a vulnerability.
1436 This weakness is sometimes known by the language-specific mechanisms that make it possible, such as mass assignment, autobinding, or object injection.",,Unknown,"Shocking News in PHP Exploitation: http://www.suspekt.org/downloads/POC2009-ShockingNewsInPHPExploitation.pdf
1437 ""Two Security Vulnerabilities in the Spring Framework's MVC"" pdf (from 2008): http://blog.diniscruz.com/2011/07/two-security-vulnerabilities-in-spring.html
1438 Two Security Vulnerabilities in the Spring Framework's MVC: http://o2platform.files.wordpress.com/2011/07/ounce_springframework_vulnerabilities.pdf
1439 Best Practices for ASP.NET MVC: http://blogs.msdn.com/b/aspnetue/archive/2010/09/17/second_2d00_post.aspx
1440 Mass assignment in Rails applications: http://blog.mhartl.com/2008/09/21/mass-assignment-in-rails-applications/
1441 Secure your Rails apps!: http://pragtob.wordpress.com/2012/03/06/secure-your-rails-apps/
1442 Ruby On Rails Security Guide: http://guides.rubyonrails.org/security.html#mass-assignment
1443 Mass Assignment Vulnerability in ASP.NET MVC: http://freshbrewedcode.com/joshbush/2012/03/05/mass-assignment-aspnet-mvc/
1444 6 Ways To Avoid Mass Assignment in ASP.NET MVC: http://odetocode.com/blogs/scott/archive/2012/03/11/complete-guide-to-mass-assignment-in-asp-net-mvc.aspx
1445 PHP Object Injection: https://www.owasp.org/index.php/PHP_Object_Injection
1446 Unserializing user-supplied data, a bad idea: http://heine.familiedeelstra.com/security/unserialize
1447 Why Python Pickle is Insecure: http://nadiana.com/python-pickle-insecure"
1448 CWE-916,Use of Password Hash With Insufficient Computational Effort (Type: Base),"The software generates a hash for a password, but it uses a scheme that does not provide a sufficient level of computational effort that would make password cracking attacks infeasible or expensive.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1449 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
1450 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
1451 The amount of CPU time required to compute the hash (""stretching"")
1452 The amount of memory required to compute the hash (""memory-hard"" operations)
1453 Including a random value, along with the password, as input to the hash computation (""salting"")
1454 Given a hash, there is no known way of determining a password that produces this hash value, other than by guessing possible passwords (""one-way"" hashing)
1455 Relative to the number of all possible hashes that can be generated by the scheme, there is a low likelihood of producing the same hash for multiple different inputs (""collision resistance"")
1456 Note that the security requirements for the software may vary depending on the environment and the value of the passwords. Different schemes might not provide all of these properties, yet may still provide sufficient security for the environment. Conversely, a solution might be very strong in preserving one property, which still being very weak for an attack against another property, or it might not be able to significantly reduce the efficiency of a massively-parallel attack.",,Unknown,"bcrypt: http://bcrypt.sourceforge.net/
1457 Tarsnap - The scrypt key derivation function and encryption utility: http://www.tarsnap.com/scrypt.html
1458 RFC2898 - PKCS #5: Password-Based Cryptography Specification Version 2.0: http://tools.ietf.org/html/rfc2898
1459 How Companies Can Beef Up Password Security (interview with Thomas H. Ptacek): http://krebsonsecurity.com/2012/06/how-companies-can-beef-up-password-security/
1460 Speed Hashing: http://www.codinghorror.com/blog/2012/04/speed-hashing.html
1461 Password security: past, present, future: http://www.openwall.com/presentations/PHDays2012-Password-Security/
1462 Password Storage Cheat Sheet: https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet
1463 Enough With The Rainbow Tables: What You Need To Know About Secure Password Schemes: http://www.securityfocus.com/blogs/262
1464 How To Safely Store A Password: http://codahale.com/how-to-safely-store-a-password/
1465 Password hashing at scale: http://www.openwall.com/presentations/YaC2012-Password-Hashing-At-Scale/
1466 New developments in password hashing: ROM-port-hard functions: http://www.openwall.com/presentations/ZeroNights2012-New-In-Password-Hashing/
1467 The Importance of Being Canonical: http://erratasec.blogspot.com/2009/02/importance-of-being-canonical.html
1468 Our password hashing has no clothes: http://www.troyhunt.com/2012/06/our-password-hashing-has-no-clothes.html
1469 Should we really use bcrypt/scrypt?: http://www.analyticalengine.net/2012/06/should-we-really-use-bcryptscrypt/"
1470 CWE-917,Improper Neutralization of Special Elements used in an Expression Language Statement (Expression Language Injection) (Type: Base),"The software constructs all or part of an expression language (EL) statement in a Java Server Page (JSP) using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended EL statement before it is executed.","Many password storage mechanisms compute a hash and store the hash, instead of storing the original password in plaintext. In this design, authentication involves accepting an incoming password, computing its hash, and comparing it to the stored hash.
1471 Many hash algorithms are designed to execute quickly with minimal overhead, even cryptographic hashes. However, this efficiency is a problem for password storage, because it can reduce an attacker's workload for brute-force password cracking. If an attacker can obtain the hashes through some other method (such as SQL injection on a database that stores hashes), then the attacker can store the hashes offline and use various techniques to crack the passwords by computing hashes efficiently. Without a built-in workload, modern attacks can compute large numbers of hashes, or even exhaust the entire space of all possible passwords, within a very short amount of time, using massively-parallel computing (such as cloud computing) and GPU, ASIC, or FPGA hardware. In such a scenario, an efficient hash algorithm helps the attacker.
1472 There are several properties of a hash scheme that are relevant to its strength against an offline, massively-parallel attack:
1473 The amount of CPU time required to compute the hash (""stretching"")
1474 The amount of memory required to compute the hash (""memory-hard"" operations)
1475 Including a random value, along with the password, as input to the hash computation (""salting"")
1476 Given a hash, there is no known way of determining a password that produces this hash value, other than by guessing possible passwords (""one-way"" hashing)
1477 Relative to the number of all possible hashes that can be generated by the scheme, there is a low likelihood of producing the same hash for multiple different inputs (""collision resistance"")
1478 Note that the security requirements for the software may vary depending on the environment and the value of the passwords. Different schemes might not provide all of these properties, yet may still provide sufficient security for the environment. Conversely, a solution might be very strong in preserving one property, which still being very weak for an attack against another property, or it might not be able to significantly reduce the efficiency of a massively-parallel attack.",,Unknown,"Expression Language Injection: http://www.mindedsecurity.com/fileshare/ExpressionLanguageInjection.pdf
1479 Remote Code with Expression Language Injection: http://danamodio.com/application-security/discoveries/spring-remote-code-with-expression-language-injection/"
1480 CWE-918,Server-Side Request Forgery (SSRF) (Type: Base),"The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,"SSRF vs. Business-critical applications: XXE tunneling in SAP: https://media.blackhat.com/bh-us-12/Briefings/Polyakov/BH_US_12_Polyakov_SSRF_Business_Slides.pdf
1481 SSRF vs. Business-critical Applications. Part 1: XXE Tunnelling in SAP NetWeaver: http://erpscan.com/wp-content/uploads/2012/08/SSRF-vs-Businness-critical-applications-whitepaper.pdf
1482 Cross Site Port Attacks - XSPA - Part 1: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-1.html
1483 Cross Site Port Attacks - XSPA - Part 2: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-2.html
1484 Cross Site Port Attacks - XSPA - Part 3: http://www.riyazwalikar.com/2012/11/cross-site-port-attacks-xspa-part-3.html
1485 SSRF attacks and sockets: smorgasbord of vulnerabilities: http://www.slideshare.net/d0znpp/ssrf-attacks-and-sockets-smorgasbord-of-vulnerabilities
1486 SSRF bible. Cheatsheet: https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit?pli=1#
1487 Web Portals: Gateway To Information, Or A Hole In Our Perimeter Defenses: http://www.shmoocon.org/2008/presentations/Web%20portals,%20gateway%20to%20information.ppt"
1488 CWE-92,DEPRECATED: Improper Sanitization of Custom Special Characters (Type: Base),"This entry has been deprecated. It originally came from PLOVER, which sometimes defined ""other"" and ""miscellaneous"" categories in order to satisfy exhaustiveness requirements for taxonomies. Within the context of CWE, the use of a more abstract entry is preferred in mapping situations. CWE-75 is a more appropriate mapping.","By providing URLs to unexpected hosts or ports, attackers can make it appear that the server is sending the request, possibly bypassing access controls such as firewalls that prevent the attackers from accessing the URLs directly. The server can be used as a proxy to conduct port scanning of hosts in internal networks, use other URLs such as that can access documents on the system (using file://), or use other protocols such as gopher:// or tftp://, which may provide greater control over the contents of requests.",,Unknown,
1489 CWE-920,Improper Restriction of Power Consumption (Type: Base),"The software operates in an environment in which power is a limited resource that cannot be automatically replenished, but the software does not properly restrict the amount of power that its operation consumes.","In environments such as embedded or mobile devices, power can be a limited resource such as a battery, which cannot be automatically replenished by the software itself, and the device might not always be directly attached to a reliable power source. If the software uses too much power too quickly, then this could cause the device (and subsequently, the software) to stop functioning until power is restored, or increase the financial burden on the device owner because of increased power costs.
1490 Normal operation of an application will consume power. However, in some cases, an attacker could cause the application to consume more power than intended, using components such as:
1491 Display
1492 CPU
1493 Disk I/O
1494 GPS
1495 Sound
1496 Microphone
1497 USB interface",,Unknown,
1498 CWE-921,Storage of Sensitive Data in a Mechanism without Access Control (Type: Base),The software stores sensitive information in a file system or device that does not have built-in access control.,"While many modern file systems or devices utilize some form of access control in order to restrict access to data, not all storage mechanisms have this capability. For example, memory cards, floppy disks, CDs, and USB devices are typically made accessible to any user within the system. This can become a problem when sensitive data is stored in these mechanisms in a multi-user environment, because anybody on the system can read or write this data.
1499 On Android devices, external storage is typically globally readable and writable by other applications on the device. External storage may also be easily accessible through the mobile device's USB connection or physically accessible through the device's memory card port.",,Unknown,Security Tips: http://developer.android.com/training/articles/security-tips.html#StoringData
1500 CWE-922,Insecure Storage of Sensitive Information (Type: Class),The software stores sensitive information without properly limiting read or write access by unauthorized actors.,"If read access is not properly restricted, then attackers can steal the sensitive information. If write access is not properly restricted, then attackers can modify and possibly delete the data, causing incorrect results and possibly a denial of service.",,Unknown,
1501 CWE-923,Improper Authentication of Endpoint in a Communication Channel (Type: Class),"The software establishes a communication channel to (or from) an endpoint for privileged or protected operations, but it does not properly authenticate the endpoint to ensure it is associated with the identity of the intended actor.","Attackers might be able to spoof the intended endpoint from a different system or process, thus gaining the same level of access as the intended endpoint.
1502 While this issue frequently involves authentication between network-based clients and servers, other types of communication channels and endpoints can have this weakness.",,Unknown,
1503 CWE-924,Improper Enforcement of Message Integrity During Transmission in a Communication Channel (Type: Class),"The software establishes a communication channel with an endpoint and receives a message from that endpoint, but it does not sufficiently ensure that the message was not modified during transmission.",A man-in-the-middle (MITM) attacker might be able to modify the message and spoof the endpoint.,,Unknown,
1504 CWE-925,Improper Verification of Intent by Broadcast Receiver (Type: Variant),"The Android application uses a Broadcast Receiver that receives an Intent but does not properly verify that the Intent came from an authorized source, e.g. by checking the action string.","Certain types of Intents, identified by action string, can only be broadcast by the operating system itself, not by third-party applications. However, when an application declares the ability for a component to receive broadcast messages, in most cases a malicious application can send an Intent with a non-reserved action string to that receiving component.",,Unknown,
1505 CWE-926,Improper Restriction of Content Provider Export to Other Applications (Type: Variant),The Android application uses a Content Provider that does not properly restrict which applications can access the data that is offered by the Content Provider.,"Android's Content Provider mechanism can be used to share data with other applications or internally within the same application. If access to the Content Provider is not restricted to only the expected applications, then malicious applications might be able to access the sensitive data.
1506 This weakness could be expressed in several different ways:
1507 The Content Provider is only intended for internal use by the application, and thus does not need to be exported.
1508 In Android before 4.2, the Content Provider is automatically exported unless it has been explicitly declared as NOT exported.
1509 The Content Provider is intended for external use by some applications, but it does not properly limit access, e.g. by exporting with excessive permissions.",,Unknown,No description: http://developer.android.com/training/articles/security-tips.html#ContentProviders
1510 CWE-927,Use of Implicit Intent for Sensitive Communication (Type: Variant),The Android application uses an implicit intent for transmitting sensitive data to other applications.,"Since an implicit intent does not specify a particular application to receive the data, any application can process the intent by using an Intent Filter for that intent. This can allow untrusted applications to obtain sensitive data.",,Unknown,"Analyzing Inter-Application Communication in Android: http://www.cs.berkeley.edu/~afelt/intentsecurity-mobisys.pdf
1511 Security Tips: http://developer.android.com/training/articles/security-tips.html#ContentProviders"
1512 CWE-96,Improper Neutralization of Directives in Statically Saved Code (Static Code Injection) (Type: Base),"The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before inserting the input into an executable resource, such as a library, configuration file, or template.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1513 CWE-97,Improper Neutralization of Server-Side Includes (SSI) Within a Web Page (Type: Variant),"The software generates a web page, but does not neutralize or incorrectly neutralizes user-controllable input that could be interpreted as a server-side include (SSI) directive.","This may allow an attacker to execute arbitrary code, or at least modify what code can be executed.",,Unknown,
1514 CWE-116,Improper Encoding or Escaping of Output (Type: Class),"The software prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.","Improper encoding or escaping can allow attackers to change the commands that are sent to another component, inserting malicious commands instead.
1515 Most software follows a certain protocol that uses structured messages for communication between components, such as queries or commands. These structured messages can contain raw data interspersed with metadata or control information. For example, ""GET /index.html HTTP/1.1"" is a structured message containing a command (""GET"") with a single argument (""/index.html"") and metadata about which protocol version is being used (""HTTP/1.1"").
1516 If an application uses attacker-supplied inputs to construct a structured message without properly encoding or escaping, then the attacker could insert special characters that will cause the data to be interpreted as control information or metadata. Consequently, the component that receives the output will perform the wrong operations, or otherwise interpret the data incorrectly.",,Very High,"OWASP Enterprise Security API (ESAPI) Project: http://www.owasp.org/index.php/ESAPI
1517 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
1518 Output Sanitization: http://www.analyticalengine.net/archives/58
1519 Sanitizing user data: How and where to do it: http://www.diovo.com/2008/09/sanitizing-user-data-how-and-where-to-do-it/
1520 Input validation or output filtering, which is better?: http://jeremiahgrossman.blogspot.com/2007/01/input-validation-or-output-filtering.html
1521 Input Validation - Not That Important: http://manicode.blogspot.com/2008/08/input-validation-not-that-important.html
1522 Preventing XSS with Correct Output Encoding: http://phed.org/2008/05/19/preventing-xss-with-correct-output-encoding/
1523 Writing Secure Code: Chapter 11, ""Canonical Representation Issues"" Page 363"
1524 CWE-121,Stack-based Buffer Overflow (Type: Variant),"A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).","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 outside of the boundaries of a buffer. The simplest type of error, and the most common cause of buffer overflows, is the ""classic"" case in which the program copies the buffer without restricting how much is copied. Other variants exist, but the existence of a classic overflow strongly suggests that the programmer is not considering even the most basic of security protections.",,Very High,"Writing Secure Code: Chapter 5, ""Stack Overruns"" Page 129
1525 24 Deadly Sins of Software Security: ""Sin 5: Buffer Overruns."" Page 89
1526 The Art of Software Security Assessment: Chapter 3, ""Nonexecutable Stack"", Page 76.
1527 The Art of Software Security Assessment: Chapter 5, ""Protection Mechanisms"", Page 189."
1528 CWE-134,Uncontrolled Format String (Type: Base),"The software uses externally-controlled format strings in printf-style functions, which can lead to buffer overflows or data representation problems.","If an attacker can manipulate the length parameter associated with an input such that it is inconsistent with the actual length of the input, this can be leveraged to cause the target application to behave in unexpected, and possibly, malicious ways. One of the possible motives for doing so is to pass in arbitrarily large input to the application. Another possible motivation is the modification of application state by including invalid data for subsequent properties of the application. Such weaknesses commonly lead to attacks such as buffer overflows and execution of arbitrary code.",,Very High,"Format String Vulnerabilities in Perl Programs: http://www.securityfocus.com/archive/1/418460/30/0/threaded
1529 Programming Language Format String Vulnerabilities: http://www.ddj.com/dept/security/197002914
1530 Format String Attacks: http://www.thenewsh.com/~newsham/format-string-attacks.pdf
1531 Writing Secure Code: Chapter 5, ""Format String Bugs"" Page 147
1532 24 Deadly Sins of Software Security: ""Sin 6: Format String Problems."" Page 109
1533 The Art of Software Security Assessment: Chapter 8, ""C Format Strings"", Page 422."
1534 CWE-256,Plaintext Storage of a Password (Type: Variant),Storing a password in plaintext may result in a system compromise.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1535 CWE-257,Storing Passwords in a Recoverable Format (Type: Base),"The storage of passwords in a recoverable format makes them subject to password reuse attacks by malicious users. If a system administrator can recover a password directly, or use a brute force search on the available information, the administrator can use the password on other accounts.","Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,
1536 CWE-258,Empty Password in Configuration File (Type: Variant),Using an empty string as a password is insecure.,"Two common programmer assumptions are ""this function call can never fail"" and ""it doesn't matter if this function call fails"". If an attacker can force the function to fail or otherwise return a value that is not expected, then the subsequent program logic could lead to a vulnerability, because the software is not in a state that the programmer assumes. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.",,Very High,Building Secure Software: How to Avoid Security Problems the Right Way
1537 CWE-259,Use of Hard-coded Password (Type: Base),"The software contains a hard-coded password, which it uses for its own inbound authentication or for outbound communication to external components.","A hard-coded password typically leads to a significant authentication failure that can be difficult for the system administrator to detect. Once detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1538 Inbound: the software contains an authentication mechanism that checks for a hard-coded password.
1539 Outbound: the software connects to another system or component, and it contains hard-coded password for connecting to that component.
1540 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
1541 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1542 CWE-309,Use of Password System for Primary Authentication (Type: Base),"The use of password systems as the primary means of authentication may be subject to several flaws or shortcomings, each reducing the effectiveness of the mechanism.","While the use of multiple authentication schemes is simply piling on more complexity on top of authentication, it is inestimably valuable to have such measures of redundancy. The use of weak, reused, and common passwords is rampant on the internet. Without the added protection of multiple authentication schemes, a single mistake can result in the compromise of an account. For this reason, if multiple schemes are possible and also easy to use, they should be implemented and required.",,Very High,
1543 CWE-74,Improper Neutralization of Special Elements in Output Used by a Downstream Component (Injection) (Type: Class),"The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.","Software has certain assumptions about what constitutes data and control respectively. It is the lack of verification of these assumptions for user-controlled input that leads to injection problems. Injection problems encompass a wide variety of issues -- all mitigated in very different ways and usually attempted in order to alter the control flow of the process. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.",,Very High,
1544 CWE-77,Improper Neutralization of Special Elements used in a Command (Command Injection) (Type: Class),"The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.","Command injection vulnerabilities typically occur when:
1545 1. Data enters the application from an untrusted source.
1546 2. The data is part of a string that is executed as a command by the application.
1547 3. By executing the command, the application gives an attacker a privilege or capability that the attacker would not otherwise have.",,Very High,"Exploiting Software: How to Break Code
1548 24 Deadly Sins of Software Security: ""Sin 10: Command Injection."" Page 171"
1549 CWE-798,Use of Hard-coded Credentials (Type: Base),"The software contains hard-coded credentials, such as a password or cryptographic key, which it uses for its own inbound authentication, outbound communication to external components, or encryption of internal data.","Hard-coded credentials typically create a significant hole that allows an attacker to bypass the authentication that has been configured by the software administrator. This hole might be difficult for the system administrator to detect. Even if detected, it can be difficult to fix, so the administrator may be forced into disabling the product entirely. There are two main variations:
1550 Inbound: the software contains an authentication mechanism that checks the input credentials against a hard-coded set of credentials.
1551 Outbound: the software connects to another system or component, and it contains hard-coded credentials for connecting to that component.
1552 In the Inbound variant, a default administration account is created, and a simple password is hard-coded into the product and associated with that account. This hard-coded password is the same for each installation of the product, and it usually cannot be changed or disabled by system administrators without manually modifying the program, or otherwise patching the software. If the password is ever discovered or published (a common occurrence on the Internet), then anybody with knowledge of this password can access the product. Finally, since all installations of the software will have the same password, even across different organizations, this enables massive attacks such as worms to take place.
1553 The Outbound variant applies to front-end systems that authenticate with a back-end service. The back-end service may require a fixed password which can be easily discovered. The programmer may simply hard-code those back-end credentials into the front-end software. Any user of that program may be able to extract the password. Client-side systems with hard-coded passwords pose even more of a threat, since the extraction of a password from a binary is usually very simple.",,Very High,"Writing Secure Code: Chapter 8, ""Key Management Issues"" Page 272
1554 Top 25 Series - Rank 11 - Hardcoded Credentials: http://blogs.sans.org/appsecstreetfighter/2010/03/10/top-25-series-rank-11-hardcoded-credentials/
1555 Mobile App Top 10 List: http://www.veracode.com/blog/2010/12/mobile-app-top-10-list/"
1556 CWE-89,Improper Neutralization of Special Elements used in an SQL Command (SQL Injection) (Type: Base),"The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.","Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data. This can be used to alter query logic to bypass security checks, or to insert additional statements that modify the back-end database, possibly including execution of system commands.
1557 SQL injection has become a common issue with database-driven web sites. The flaw is easily detected, and easily exploited, and as such, any site or software package with even a minimal user base is likely to be subject to an attempted attack of this kind. This flaw depends on the fact that SQL makes no real distinction between the control and data planes.",,Very High,"24 Deadly Sins of Software Security: ""Sin 1: SQL Injection."" Page 3
1558 Writing Secure Code: Chapter 12, ""Database Input Issues"" Page 397
1559 SQL Injection Prevention Cheat Sheet: http://www.owasp.org/index.php/SQL_Injection_Prevention_Cheat_Sheet
1560 SQL Injection Attacks by Example: http://www.unixwiz.net/techtips/sql-injection.html
1561 SQL Injection Cheat Sheet: http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/
1562 The Database Hacker's Handbook: Defending Database Servers
1563 The Oracle Hacker's Handbook: Hacking and Defending Oracle
1564 SQL Injection: http://msdn.microsoft.com/en-us/library/ms161953.aspx
1565 SQL Injection Attack: http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx
1566 Giving SQL Injection the Respect it Deserves: http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx
1567 Top 25 Series - Rank 2 - SQL Injection: http://blogs.sans.org/appsecstreetfighter/2010/03/01/top-25-series-rank-2-sql-injection/
1568 Least Privilege: https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/351.html
1569 The Art of Software Security Assessment: Chapter 8, ""SQL Queries"", Page 431.
1570 The Art of Software Security Assessment: Chapter 17, ""SQL Injection"", Page 1061."
1571 CWE-262,Not Using Password Aging (Type: Variant),"If no mechanism is in place for managing password aging, users will have no incentive to update passwords in a timely manner.","This can result in compromise of the system for which the password is used. An attacker could gain access to this file and learn the stored password or worse yet, change the password to one of their choosing.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1572 CWE-263,Password Aging with Long Expiration (Type: Base),Allowing password aging to occur unchecked can result in the possibility of diminished password integrity.,"Just as neglecting to include functionality for the management of password aging is dangerous, so is allowing password aging to continue unchecked. Passwords must be given a maximum life span, after which a user is required to update with a new and different password.",,Very Low,"24 Deadly Sins of Software Security: ""Sin 19: Use of Weak Password-Based Systems."" Page 279"
1573 ,Session Cookie without Secure flag set,"This cookie does not have the Secure flag set. When a cookie is set with the Secure flag, it instructs the browser that the cookie can only be accessed over secure SSL channels. This is an important security protection for session cookies.",,"If possible, you should set the Secure flag for this cookie.",low,
1574 ,Session Cookie without HttpOnly flag Set,"This cookie does not have the HTTPOnly flag set. When a cookie is set with the HTTPOnly flag, it instructs the browser that the cookie can only be accessed by the server and not by client-side scripts. This is an important security protection for session cookies.",,"If possible, you should set the HTTPOnly flag for this cookie.",Low,
1575 ,Application error message,"This page contains an error/warning message that may disclose sensitive information.The message can also contain the location of the file that produced the unhandled exception.
1576
1577 The error messages may disclose sensitive information. This information can be used to launch further attacks.",,Review the source code for this script. The application need to show generic errors.,,
1578 ,Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
1579 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,,
1580 ,Input Password with Autocomplete Enable,"Autocomplete allows the browser to predict the value. When a user starts to type in a field, the browser should display options to fill in the field, based on earlier typed values. If an attacker gain access to a computer its possible of get credentials back.",,"You should include the attribute Autocomplete OFF:
1581 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
1582 ,Backup Files,"Backup files can contain script sources, configuration files or other sensitive information that may help an malicious user to prepare more advanced attacks",,"Remove the file(s) if they are not required on your website. As an additional step, it is recommended to implement a security policy within your organization to disallow creation of backup files in directories accessible from the web.",,
1583 ,Sesintive directory,"A possible sensitive directory has been found. This directory is not directly linked from the website.This check looks for common sensitive resources like backup directories, database dumps, administration pages, temporary directories. Each one of these directories could help an attacker to learn more about his target.",,,,
1584 ,Slow HTTP Denial of Service Attack,"Slowloris and Slow HTTP POST DoS attacks rely on the fact that the HTTP protocol, by design, requires requests to be completely received by the server before they are processed. If an HTTP request is not complete, or if the transfer rate is very low, the server keeps its resources busy waiting for the rest of the data. If the server keeps too many resources busy, this creates a denial of service.",,It's important to configure the timout values on the Webserver. Here is a link to a guide on how to prevent this kind of attack: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
1585 ,Clickjacking,"It might be possible for a web page controlled by an attacker to load the content of this response within an iframe on the attacker's page. This may enable a ""clickjacking"" attack, in which the attacker's page overlays the target application's interface with a different interface provided by the attacker. By inducing victim users to perform actions such as mouse clicks and keystrokes, the attacker can cause them to unwittingly carry out actions within the application that is being targeted. This technique allows the attacker to circumvent defenses against cross-site request forgery, and may result in unauthorized actions. Ref:http://javascript.info/tutorial/clickjacking",,"To effectively prevent framing attacks, the application should return a response header with the name X-Frame-Options and the value DENY to prevent framing altogether, or the value SAMEORIGIN to allow framing only by pages on the same origin as the response itself.",Low,
1586 ,OPTIONS method is enabled,"HTTP OPTIONS method is enabled on this web server. The OPTIONS method provides a list of the methods that are supported by the web server, it represents a request for information about the communication options available on the request/response chain identified by the Request-URI.
1587 The OPTIONS method may expose sensitive information that may help an malicious user to prepare more advanced attacks.",,It's recommended to disable OPTIONS Method on the web server.,Low,
1588 ,TLS1/SSLv3 Renegotiation Vulnerability,"A vulnerability in the way SSL and TLS protocols allow renegotiation requests may allow an attacker to inject plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
1589 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
1590 ,Email address found,One or more email addresses have been found on this page. The majority of spam comes from email addresses harvested off the internet. The spam-bots (also known as email harvesters and email extractors) are programs that scour the internet looking for email addresses on any website they come across. Spambot programs look for strings like [email protected] and then record any addresses found.,,,,
1591 ,File Inclusion,It is possible for a remote attacker to include a file from local or remote resources and/or execute arbitrary script code with the privileges of the webserver.,,"Edit the source code to ensure that input is properly validated. Where is possible, it is recommended to make a list of accepted filenames and restrict the input to that list.
1592
1593 For PHP, the option allow_url_fopen would normally allow a programmer to open, include or otherwise use a remote file using a URL rather than a local file path. It is recommended to disable this option from php.ini.",,
1594 ,User Credentials Sent in Clear Text,"Vulnerability description
1595 User credentials are transmitted over an unencrypted channel. This information should always be transferred via an encrypted channel (HTTPS) to avoid being intercepted by malicious users.
1596
1597 The impact of this vulnerability
1598 A third party may be able to read the user credentials by intercepting an unencrypted HTTP connection.",,"Because user credentials are considered sensitive information, should always be transferred to the server over an encrypted connection (HTTPS).",,
1599 ,URL Redirection,"This script is possibly vulnerable to URL redirection attacks.
1600
1601 URL redirection is sometimes used as a part of phishing attacks that confuse visitors about which web site they are visiting.
1602
1603 The impact of this vulnerability
1604 A remote attacker can redirect users from your website to a specified URL. This problem may assist an attacker to conduct phishing attacks, trojan distribution, spammers.",,Your script should properly sanitize user input.,,
1605 ,Microsoft IIS tilde directory enumeration,"It is possible to detect short names of files and directories which have an 8.3 file naming scheme equivalent in Windows by using some vectors in several versions of Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
1606 ,SQL Injection,"SQL injection is a vulnerability that allows an attacker to alter back-end SQL statements by manipulating the user input. An SQL injection occurs when web applications accept user input that is directly placed into a SQL statement and doesn't properly filter out dangerous characters.
1607
1608 This is one of the most common application layer attacks currently being used on the Internet. Despite the fact that it is relatively easy to protect against, there is a large number of web applications vulnerable.
1609
1610 An attacker may execute arbitrary SQL statements on the vulnerable system. This may compromise the integrity of your database and/or expose sensitive information.
1611
1612 Depending on the back-end database in use, SQL injection vulnerabilities lead to varying levels of data/system access for the attacker. It may be possible to not only manipulate existing queries, but to UNION in arbitrary data, use sub selects, or append additional queries. In some cases, it may be possible to read in or write out to files, or to execute shell commands on the underlying operating system.
1613
1614 Certain SQL Servers such as Microsoft SQL Server contain stored and extended procedures (database server functions). If an attacker can obtain access to these procedures it may be possible to compromise the entire machine.",,"Your script should filter metacharacters from user input.
1615 Check detailed information for more information about fixing this vulnerability.
1616 Detailed information",,
1617 ,ASP.NET debugging enabled,"ASP.NET debugging is enabled on this application. It is recommended to disable debug mode before deploying a production application. By default, debugging is disabled, and although debugging is frequently enabled to troubleshoot a problem, it is also frequently not disabled again after the problem is resolved.",,"It may be possible to disclose sensitive information about the web sever the ASP.NET application.
1618 More information on how to fix it:
1619 http://support.microsoft.com/default.aspx?scid=kb;en-us;815157",,
1620 ,Unicode tranformation Issues,"This page is vulnerable to various Unicode transformation issues such as Best-Fit Mappings, Overlong byte sequences, Ill-formed sequences.
1621 Best-Fit Mappings occurs when a character X gets transformed to an entirely different character Y. In general, best-fit mappings occur when characters are transcoded between Unicode and another encoding.
1622
1623 Overlong byte sequences (non-shortest form) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
1624 0xC0 0x8A
1625 0xE0 0x80 0x8A
1626 0xF0 0x80 0x80 0x8A
1627 0xF8 0x80 0x80 0x80 0x8A
1628 0xFC 0x80 0x80 0x80 0x80 0x8A
1629
1630 Ill-Formed Subsequences As REQUIRED by UNICODE 3.0, and noted in the Unicode Technical Report #36, if a leading byte is followed by an invalid successor byte, then it should NOT consume it.
1631
1632
1633 Software vulnerabilities arise when Best-Fit mappings occur. For example, characters can be manipulated to bypass string handling filters, such as cross-site scripting (XSS) or SQL Injection filters, WAF's, and IDS devices. Overlong UTF-8 sequence could be abused to bypass UTF-8 substring tests that look only for the shortest possible encoding.",,"Identiy the source of these Unicode transformation issues and fix them. Consult the web references bellow for more information.
1634 Links with more information:
1635 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
1636 http://www.cl.cam.ac.uk/~mgk25/unicode.html
1637 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
1638 http://www.unicode.org/reports/tr36/",,
1639 ,File Upload XSS,"This script is possibly vulnerable to XSS (Cross-site scripting). The web application allows file upload and Acunetix WVS was able to upload a file containing HTML content. When HTML files are allowed, XSS payload can be injected in the file uploaded. Check Attack details for more information about this attack.
1640
1641 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Restrict file types accepted for upload: check the file extension and only allow certain files to be uploaded. Use a whitelist approach instead of a blacklist. Check for double extensions such as .php.png. Check for files without a filename like .htaccess (on ASP.NET, check for configuration files like web.config). Change the permissions on the upload folder so the files within it are not executable. If possible, rename the files that are uploaded.
1642
1643 https://www.owasp.org/index.php/Unrestricted_File_Upload
1644 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
1645 ,Possible virtual host found,"Virtual hosting is a method for hosting multiple domain names (with separate handling of each name) on a single server (or pool of servers). This allows one server to share its resources, such as memory and processor cycles, without requiring all services provided to use the same host name.
1646
1647 This web server is responding differently when the Host header is manipulated and various common virtual hosts are tested. This could indicate there is a Virtual Host present.",,Consult the virtual host configuration and check if this virtual host should be publicly accessible,,
1648 ,Host header attack,"An attacker can manipulate the Host header as seen by the web application and cause the application to behave in unexpected ways.
1649 Developers often resort to the exceedingly untrustworthy HTTP Host header (_SERVER[""HTTP_HOST""] in PHP).
1650 Even otherwise-secure applications trust this value enough to write it to the page without HTML-encoding it with code equivalent to:
1651
1652 <link href=""http://_SERVER['HOST']"" (Joomla)
1653 ...and append secret keys and tokens to links containing it:
1654
1655 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery, others)
1656 ....and even directly import scripts from it:
1657
1658 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)
1659
1660 Host header *********evilhostDx5oMrAd.com was reflected inside a A tag (href attribute).",,"The web application should use the SERVER_NAME instead of the Host header. It should also create a dummy vhost that catches all requests with unrecognized Host headers. This can also be done under Nginx by specifying a non-wildcard SERVER_NAME, and under Apache by using a non-wildcard serverName and turning the UseCanonicalName directive on. Consult references for detailed information.",,
1661 ,jQuery cross site scripting,"This page is using an older version of jQuery that is vulnerable to a Cross Site Scripting vulnerability. Many sites are using to select elements using location.hash that allows someone to inject script into the page. This problem was fixed in jQuery 1.6.3 and up.
1662 Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.",,"Update to the latest version of jQuery.
1663 More info: http://ma.la/jquery_xss/
1664 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
1665 ,Login Page password-guessing attack,"A common threat web developers face is a password-guessing attack known as a brute force attack. A brute-force attack is an attempt to discover a password by systematically trying every possible combination of letters, numbers, and symbols until you discover the one correct combination that works.
1666
1667 This login page doesn't have any protection against password-guessing attacks (brute force attacks). It's recommended to implement some type of account lockout after a defined number of incorrect password attempts. Consult Web references for more information about fixing this problem.
1668
1669 The scanner tested 10 invalid credentials and no account lockout was detected.",,"It's recommended to implement some type of account lockout after a defined number of incorrect password attempts.
1670 More info:
1671 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
1672 ,Error page web server version disclosure,"By requesting a page that doesn't exist, an error page was returned. This error page contains the web server version number and a list of modules enabled on this server. This information can be used to conduct further attacks. Possible sensitive information disclosure.",,"If you are using Apache, you can setup a custom 404 page by following the instructions provided in the References section.",,
1673 ,SSL weak ciphers,"The remote host supports the use of SSL ciphers that offer either weak encryption or no encryption at all.
1674 This vulnerability affects Server.",,Reconfigure the affected application to avoid use of weak ciphers.,,
1675 ,CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) is a security exploit against secret web cookies over connections using the HTTPS and SPDY protocols that also use data compression. When used to recover the content of secret authentication cookies, it allows an attacker to perform session hijacking on an authenticated web session, allowing the launching of further attacks.
1676
1677 CRIME is a client-side attack, but the server can protect the client by refusing to use the feature combinations which can be attacked. For CRIME, the weakness is Deflate compression. This alert is issued if the server accepts Deflate compression.
1678
1679 An attacker can perform session hijacking on an authenticated web session, allowing the launching of further attacks.",,"CRIME can be defeated by preventing the use of compression, either at the client end, by the browser disabling the compression of HTTPS requests, or by the website preventing the use of data compression on such transactions using the protocol negotiation features of the TLS protocol. As detailed in The Transport Layer Security (TLS) Protocol Version 1.2, the client sends a list of compression algorithms in its ClientHello message, and the server picks one of them and sends it back in its ServerHello message. The server can only choose a compression method the client has offered, so if the client only offers 'none' (no compression), the data will not be compressed. Similarly, since 'no compression' must be allowed by all TLS clients, a server can always refuse to use compression.
1680
1681 Web references
1682 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
1683 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",,
1684 ,Insecure transition from HTTPS to HTTP in form post,"This secure (https) page contains a form that is posting to an insecure (http) page. This could confuse users who may think their data is encrypted when in fact it's not.
1685 Impact: Possible information disclosure.",,The form target should point to a secure (https) page.,,
1686 ,TRACE method is enabled,"HTTP TRACE method is enabled on this web server. In the presence of other cross-domain vulnerabilities in web browsers, sensitive header information could be read from any domains that support the HTTP TRACE method.
1687
1688 Attackers may abuse HTTP TRACE functionality to gain access to information in HTTP headers such as cookies and authentication data.",,"Disable TRACE Method on the web server.
1689
1690 Web references
1691 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
1692 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",,
1693 ,SSL certificate public key less than 2048 bit,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,"If you have any 1024-bit certificates or certificates with less than 2048-bit key length, you will need to migrate to 2048-bit key length.
1694
1695 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
1696 ,Ruby on Rails CookieStore session cookie persistence,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",,"Currently, there are no known upgrades or patches to correct this vulnerability. It is possible to temporarily mitigate the flaw by implementing the following workaround: switch to a more secure authentication management systems (e.g. ActiveRecordStore).",,
1697 ,Remote Code Execution - ms_08_067 netapi,"The product does not sufficiently filter code (control-plane) syntax from user-controlled input (data plane) when that input is used within code that the product generates.When software allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the software. Such an alteration could lead to arbitrary code execution",,,High,
1698 ,Windows Print Spooler Components Vulnerability - MS13-001,"The software performs operations on a memory buffer, but it can read from or write to a memory location that is outside of the intended boundary of the buffer.Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.","Certain languages allow direct addressing of memory locations and do not automatically ensure that these locations are valid for the memory buffer that is being referenced. This can cause read or write operations to be performed on memory locations that may be associated with other variables, data structures, or internal program data.
1699 As a result, an attacker may be able to execute arbitrary code, alter the intended control flow, read sensitive information, or cause the system to crash.",,High,
1700 ,Android Debugging Activated,The Application has enabled Debugging in it's manifiest. This feature allows an attacker to debug native code and sensitive information could be retrived using this vector,,Set to false debuging features in production releases,,
1701 ,Flash Crossdomain policy,The application publishes a Flash cross-domain policy which allows access from any domain.,,The policy must include the domains which are allowed by the Flash cross-domain policy,Medium,
1702 ,Session Token in URL,The Session token is included in the URL. This could leak the session token,,Session tokens should only be included using safe channels,Medium,
1703 ,Insecure crossdomain.xml file,"The browser security model normally prevents web content from one domain from accessing data from another domain. This is commonly known as the ""same origin policy"". URL policy files grant cross-domain permissions for reading data. They permit operations that are not permitted by default. The URL policy file is located, by default, in the root directory of the target server, with the name crossdomain.xml (for example, at www.example.com/crossdomain.xml).
1704
1705 When a domain is specified in crossdomain.xml file, the site declares that it is willing to allow the operators of any servers in that domain to obtain any document on the server where the policy file resides. The crossdomain.xml file deployed on this website opens the server to all domains (use of a single asterisk ""*"" as a pure wildcard is supported) like so:
1706 <cross-domain-policy>
1707 <allow-access-from domain=""*"" />
1708 </cross-domain-policy>
1709 This practice is suitable for public servers, but should not be used for sites located behind a firewall because it could permit access to protected areas. It should not be used for sites that require authentication in the form of passwords or cookies. Sites that use the common practice of authentication based on cookies to access private or user-specific data should be especially careful when using cross-domain policy files.
1710
1711 Using an insecure cross-domain policy file could expose your site to various attacks.",,"Carefully evaluate which sites will be allowed to make cross-domain calls. Consider network topology and any authentication mechanisms that will be affected by the configuration or implementation of the cross-domain policy.
1712 ",Medium,
1713 ,BREACH attack,"This web application is potentially vulnerable to the BREACH attack.
1714 An attacker with the ability to:
1715 Inject partial chosen plaintext into a victim's requests
1716 Measure the size of encrypted traffic
1717 can leverage information leaked by compression to recover targeted parts of the plaintext.
1718
1719 BREACH (Browser Reconnaissance & Exfiltration via Adaptive Compression of Hypertext) is a category of vulnerabilities and not a specific instance affecting a specific piece of software. To be vulnerable, a web application must:
1720
1721 Be served from a server that uses HTTP-level compression
1722 Reflect user-input in HTTP response bodies
1723 Reflect a secret (such as a CSRF token) in HTTP response bodies
1724
1725
1726 This alert was issued because the following conditions were met:
1727 The page content is served via HTTPS
1728 The server is using HTTP-level compression
1729 URL encoded GET input next was reflected into the HTTP response body.
1730 HTTP response body contains a secret named csrfmiddlewaretoken",,"The mitigations are ordered by effectiveness (not by their practicality - as this may differ from one application to another).
1731
1732 Disabling HTTP compression
1733 Separating secrets from user input
1734 Randomizing secrets per request
1735 Masking secrets (effectively randomizing by XORing with a random secret per request)
1736 Protecting vulnerable pages with CSRF
1737 Length hiding (by adding random number of bytes to the responses)
1738 Rate-limiting the requests
1739
1740 More information http://breachattack.com/",,
1741 ,Internal IP Address Disclosure,A string matching an internal IPv4 address was found on this page. This may disclose information about the IP addressing scheme of the internal network. This information can be used to conduct further attacks.,,Prevent this information from being displayed to the user,Low,
1742 ,ASP.NET MAC disabled,"By default, the serialized value is signed by the server to prevent tampering by the user; however, this behavior can be disabled by setting the Page.EnableViewStateMac property to false. If this is done, then an attacker can modify the contents of the ViewState and cause arbitrary data to be deserialized and processed by the server. If the ViewState contains any items that are critical to the server's processing of the request, then this may result in a security exposure.",,Set the Page.EnableViewStateMac property to true on any pages where the ViewState is not currently signed.,Low,
0 cwe,name,desc_summary,description,resolution,exploitation,references
1 ,Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
2 ,Session Cookie without Secure flag set,"La cookie no tiene la marca de ""Secure"". Esto instruye al navegador que dicha cookie puede ser solo accedida por canales SSL.",,Si es posible se deberia habilitar la flag Secure para esta cookie,Low,
3 ,Session Cookie without HttpOnly flag Set,"La cookie de sesion no esta marcada como HTTPOnly, cuando una cookie es marcada de esta manera da instruccion al navegador que esa cookie puede ser accedida solamente por el servdor y no por script del lado del cliente. Es una importante proteccion de seguridad para las cookies de sesion",,Si es posible se deberia habilitar la flag HTTPOnly para esta cookie,Low,
4 ,Apache httpd Remote Denial of Service,"* Alerta generada por el flag del servidor: ver: 2.2.15 *
5 Se ha detectado un problema en las versiones de apache 1.3.0, 2.0.x hasta 2.0.64 y 2.2.X hasta 2.2.19 que mediante una herramienta automatizada un atacante usand una moderada cantidad de request puede causar un uso significativo de memoria y CPU en el servidor. Datos: http://seclists.org/fulldisclosure/2011/Aug/175.",,Actualizar version de apache,Medium,
6 ,Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
7 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
8 Disallow: /*AB/$
9 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",Info,
10 ,Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
11 ,Credenciales en Texto Plano,Las Credenciales de usuario son trasmitidas por un canal sin cifrar y puede ser interceptada.,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
12 ,Parametro __VIEWSTATE sin encriptar,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
13 <machineKey validation=""3DES""/>",,
14 ,Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
15
16 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
17 style=""border-width:0px;"" />
18
19 Siendo la respuesta THHvB
20
21 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
22 ,"Mensaje de error de la aplicacion
23 (Application error message)","El server responde con mensajes de error internos que no deberián mostrarse, facilitando de esta manera informacion que puede ser sensible o util para un atacante. Pudiendo de esta manera obtener datos para mejorar su vector de ataque",,"Se recomienda deshabilitar los mensajes de error, para no proporcionar información de la tecnología o software implementado.
24
25 ",Low,
26 ,Apache httpOnly Cookie Disclosure,"El servidor Apache version 2.2.X hasta la 2.2.21 no restringe correctamente la informacion mostrada en la contrsuccion del error "" Bad Request "" (aka 400) permitiendo a un atacante obtener los parametros de HTTPOnly.
27 Datos: http://fd.the-wildcat.de/apache_e36a9cf46c.php",,Actualizar el apache. La version 2.2.22 es la primer version que soluciona este problema.,Medium,
28 ,Input de Contraseña con Autocompletar,"Un form de login con autocompletar sugiere un problema de seguridad, sobretodo para los usuarios que utilizan el servicio desde computadoras publicas.",,"Se recomienta establecer el input con Autocomplete OFF:
29 <INPUT TYPE=""password"" AUTOCOMPLETE=""off"">",Low,
30 ,Archivos de Backup,"Los archivos de Backup pueden contener codigo fuente de script, archivos de configuracion u otra informacion sensible que puede ayudar a un atacante a conocer el servidor y preparar ataques mas avanzados o especificos.",,Remover el/los archivo(s) si no son requeridos en el servidor en produccion. Como un paso adicional es recomendado implementar una politica de seguridad para no permitir la creacion de archivos de backup en directorios accesibles desde la web.,,
31 ,Possible sensitive directories,"Un posible directorio sensible fue encotnrado. Este directorio no esta directamente linkeado en el servidor Web.Se chekeo usando nombres comunes para directorios de configuracion, backups, bajadas de bases de datos, paginas de administracion, archivos temporales, etc. Usar nombres comunes de directorios para almacenar este tipo de informacion facilita a usuarios maliciosos buscar archivos sensibles.",,"Se recomienda llamar a estos directorios de manera no estandard, por ejemplo:
32 config-->c0nfig05
33 backup-->b4ccup
34 Aunque es aun mas recomendabl, de ser posible, no dejar directorios de backup, configuracion, etc accesibles directamente desde la web",,
35 ,Slow HTTP Denial of Service Attack,"Los ataques conocidos como ""Slowloris"" y ""Slow HTTP POST DoS"" se basan en el hecho de que el protocolo HTTP, por diseño, requiere que las consultas esten completamente recividas por el servidor antes de poder ser procesadas. Si la consulta HTTP no esta completa, o si la tranferencia es muy lenta, el servidor mantiene recursos ocupados esperando el resto de la informacion. Si el servidor mantiene demasiados recursos ocupados, esto crea una denegacion de servicio.",,Es importante establecer los tiempos de espera del servidor. Se adjunta link de recomendacion para evitar este tipo de ataques: https://community.qualys.com/blogs/securitylabs/2011/11/02/how-to-protect-against-slow-http-attacks,Medium,
36 ,Clickjacking,"No se encuentra ningún tipo de impedimento para evitar que la web sea embebida dentro de un iframe. Esta restricción es importante ya que un atacante podría engañar a un usuario autenticado a realizar operaciones mediante un engaño llamado Clickjacking donde la víctima se le presenta una web, posiblemente con algun juego, utilizando algunos engaños de interfaz la victima podria ser engañada a aprobar una venta. Ref:http://javascript.info/tutorial/clickjacking",,"Todos los browsers modernos son capaces de interpretar los valores seteados en X-Frame-Options, si los mismos son incluidos en el Header del servidor.",Low,
37 ,"XSS Cross Site Scripting
38 (Secuencias de comandos en sitios cruzados)","Es posible injectar tags html y código javascript malicioso, por una falta en la comprobación de los datos ingresados en los parameros. De esta forma, un atacante podría ejecutar código que le permita obtener las cookies del usuario atacado, y de esa forma, tomar control de su cuenta.",,"Recomendamos filtrar todos los parámetros en búsqueda de posibles injecciones, y escapar todos los datos de entrada que se vayan a mostrar en la respuesta.",High,
39 ,SSL 2.0 Obsolete Protocol,"El servicio remoto encripta el trafico utilizando una version obsoleta del protocolo SSL con errores y debilidades conocidas. Un atacante puede explotar estas vulneravilidades y conducir a un ataque de ""man in the middle"" o desencriptar la comunicaciones entre el servicio afectado y los clientes.",,Se recomienda desactivar SSL 2.0 y usar SSL 3.0 o TLS 1.0 en su lugar.,High,
40 ,"Metodo OPTIONS activado",El metodo HTTP OPTIONS esta activado en el servidor. El metodo OPTIONS provee una lista de los metodos que son soportados por el servidor web. El metodo OPTIONS puede exponer informasion sensible que puede ayudar a un usuario malicioso a preparar ataques mas avanzados,,Es recomendado desactivar el metodo OPTIONS en un servidor en produccion.,Low,
41 ,TLS1/SSLv3 Renegotiation Vulnerability,"Una vulnerabilidad en la manera que el protocol SSL and TLS acepta pedidos renegociaciones pueden permitir a un atacante inyectar texto plano en ect plaintext into an application protocol stream. This could result in a situation where the attacker may be able to issue commands to the server that appear to be coming from a legitimate source. This issue affects SSL version 3.0 and newer and TLS version 1.0 and newer.
42 A remote, unauthenticated attacker may be able to inject an arbitrary amount of chosen plaintext into the beginning of the application protocol stream. This could allow and attacker to issue HTTP requests, or take action impersonating the user, among other consequences.",,http://www.g-sec.lu/practicaltls.pdf,,
43 ,File Inclusion,Es posible que un atacante remoto incluya un archivo de recursos locales o remotos y / o la ejecución de código de script arbitrario con los privilegios del servidor web.,,"Editar el código fuente para asegurarse de que la entrada esté correctamente validada. Cuando es posible, se recomienda hacer una lista de nombres de archivos aceptados y restringir la entrada a la lista.
44
45 En PHP, la opción allow_url_fopen normalmente permite a un programador para abrir, incluir o utilizan de alguna manera un archivo remoto a través de una URL en lugar de una ruta de archivo local. Se recomienda desactivar esta opción de php.ini.",,
46 CWE-319,"Credenciales enviadas por un canal en texto plano","Las credenciales de usuario se transmiten sobre un canal sin cifrar. Esta información siempre debe ser transferida a través de un canal cifrado (HTTPS) para evitar ser interceptados por usuarios maliciosos.
47
48 Una tercera persona puede ser capaz de leer las credenciales de usuario mediante la interceptación de una conexión no cifrada de HTTP.",,"Debido que las credenciales del usuario son considerados información confidencial, siempre debe ser transferido al servidor a través de una conexión segura (HTTPS).",Medium,
49 ,URL Redirection,"Este script es vulnerable a los ataques de redireccion por URL
50
51 La redireccion por URL es comunmente usado para pishing y suplantacion de identidad, ya que confunde al usuario a que sitio esta ingresando realmente. Un atacante puede redireccionar una visita desde un sitio valido hasta un servidor preparado por el, para poder hacer ataques como por ejemplo de pishin o distribucion de malware.",,"El script debe filtrar los sitios destinos del redirect, manteniendolo siempre dentro de los dominios validos.",,
52 ,Apache Server Status Enabled,"Server Status es una opcion de debug que muestra informacion sensible del servidor, como numero de peticiones, url de las peticiones, uso de memoria, threads, etc",,"Es recomendable desactivar esta opcion en servidores en produccion, o de ser necesaria la utilizacion de la misma, securizar la carpeta con contraseña o renombrarla para que no sea de facil ubicacion",,
53 ,Microsoft IIS tilde directory enumeration,"Es posible detectar nombres cortos de archivosy directorios cuyo nombrado sea en formato 8.3 en Windows usando vectores en varias versiones de Microsoft IIS. For instance, it is possible to detect all short-names of "".aspx"" files as they have 4 letters in their extensions. This can be a major issue especially for the .Net websites which are vulnerable to direct URL access as an attacker can find important files and folders that they are not normally visible.",,There is a way to disable Windows 8.3 short name creation.You can create a registry key named NtfsDisable8dot3NameCreation in HKLMSYSTEMCurrentControlSetControlFileSystem and set it to 1. That should disable short names creation. Refer to this Microsoft TechNet article to read more about the solution.,,
54 ,SQL Injection,"Debido al incorrecto filtrado de parámetros es posible ejecutar comandos SQL en la base de datos situada en el servidor mediante manipulación de parámetros. Un atacante podría utilizar esta técnica para extraer/modificar/eliminar el contenido de la base de datos, el único limitante son los privilegios del usuario utilizado por la web application aunque en muchos casos es posible, gracias a una inyeccion de SQL, es posible catapultar un acceso al sistema operativo.",,"Se debe modificar la aplicación para filtrar caracteres en los campos de input antes de ser enviados como consulta al servidor de base de datos.
55 Es importante que se sigan buenas prácticas de programación, en todos los sitios desarrollados, y sobre todos los parámetros, y no solo sobre aquellos que sean vulnerables actualmente.
56 Guía de cómo evitar estos ataques (en inglés): https://www.owasp.org/index.php/Guide_to_SQL_Injection",Very High,
57 ,ASP.NET debugging enabled,"El modo depuracion de ASP.NET esta activado en el servidor. Es recomendado desactivar este modo en servidores en produccion. Por defecto en la instalacion de IIS este modo esta desactivado, si fue activado para diagnosticar errores es conveniente luego desactivarlo.",,"Es posible que el modo debug muestre datos sensibles del servidor.
58 Mas informacion de como desactivar el modo debug:
59 http://support.microsoft.com/default.aspx?scid=kb;es-us;815157",,
60 ,Unicode tranfsormation Issues,"La pagina es vulnerable a varias tranformaciones de Unicode como ""Best-Fit Mappings"", ""Overlong byte sequences"" y ""Ill-formed sequences"".
61 Best-Fit Mappings ocurre cuando el caracter X es tranformado por un totalmente diferente caracter Y. En general, best-fit mappings occure cuando el caracter es transcodeado entre Unicode y otro encodificado.
62
63 ************************************
64
65 ""Overlong byte sequences"" (no la forma corta) - UTF-8 allows for different representations of characters that also have a shorter form. For security reasons, a UTF-8 decoder must not accept UTF-8 sequences that are longer than necessary to encode a character. For example, the character U+000A (line feed) must be accepted from a UTF-8 stream only in the form 0x0A, but not in any of the following five possible overlong forms:
66 0xC0 0x8A
67 0xE0 0x80 0x8A
68 0xF0 0x80 0x80 0x8A
69 0xF8 0x80 0x80 0x80 0x8A
70 0xFC 0x80 0x80 0x80 0x80 0x8A
71
72 Ill-Formed Subsequences As REQUIRED by UNICODE 3.0, and noted in the Unicode Technical Report #36, if a leading byte is followed by an invalid successor byte, then it should NOT consume it.
73
74
75 Software vulnerabilities arise when Best-Fit mappings occur. For example, characters can be manipulated to bypass string handling filters, such as cross-site scripting (XSS) or SQL Injection filters, WAF's, and IDS devices. Overlong UTF-8 sequence could be abused to bypass UTF-8 substring tests that look only for the shortest possible encoding.",,"Se debe identificar el origen de esta tranformacion Unicode y reparar el problema. Se deja links a paginas con informacion:
76 Links with more information:
77 http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf
78 http://www.cl.cam.ac.uk/~mgk25/unicode.html
79 http://sirdarckcat.blogspot.ro/2009/10/couple-of-unicode-issues-on-php-and.html
80 http://www.unicode.org/reports/tr36/",,
81 ,"File Upload XSS
82 (Subida dearchivo de secuencias de comandos de sitios curzados)","El Script es vulnerable a XSS (Cross-site scripting). La aplicacion permite la carga de archivos y se subio un archivo conteniendo lenguaje HTML. Cuando este tipo de archivos es permitido en la carga, Lugo se pueden ejecutar o linkear, mostrando codigo o acciones malociosas en dicha web.
83
84 Usuarios maliciosos pueden inyectar: JavaScript, VBScript, ActiveX, HTML o Flash en esta aplicacion vulnerable y engañar a un usuario para obtener informacion de el, tambien se puede robar datos de la sesion, asi como las cookies de la misma. Dependiendo del codigo que se pueda ejecutar, tambien se puede ganar acceso al wevidor web, archivos de configuracion o hasta ejecucion de binarios en el sistema operativo host.",,"Se deben restringir los tipos de archivos aceptados en el sistema de Carga: chekear la extension y solo aceptar ciertos tipos de archivos. Se recomienda una Whitelist en lugar de Un blacklist (es mejor especificar listado unico de extensiones permitidas, sobre un listado de denegadas). Tambien se debe chekear doble extensiones como .php.png. Chekear archivos sin nombre como "".htaccess"" (en ASP.NET, se debe chekear archivos de configuracion como web.config). Cambiar los permisos sobre la carpeta upload (de carga) para que los archivos no puedan ser ejecutados ahi. Si es posible, renombre los archivos que son subidos al servidor.
85 Links con mas informacion:
86 https://www.owasp.org/index.php/Unrestricted_File_Upload
87 https://www.owasp.org/index.php/Testing_for_Stored_Cross_site_scripting_(OWASP-DV-002)",,
88 ,jQuery cross site scripting,"Esta pagina esta usando una version obsoleta de jQuery la cual es vulnerable a Cross Site Scripting. Muchos sitios estan utilisando la seleccion de elementos usando location.hash lo que permite la ejecucion de scripts en la pagina. El problema fue solucionado en la vercion jQuery 1.6.3 o superior.
89 Usuarios malociosos pueden inyectar JavaScript, VBScript, ActiveX, HTML o Flash en la aplicacion vulnerable, pudiendo asi engañar a un usuario para sacarle informacion sensible.",,"Update to the latest version of jQuery.
90 More info: http://ma.la/jquery_xss/
91 http://blog.jquery.com/2011/09/01/jquery-1-6-3-released/",,
92 ,Host Header Attack,"Un atacante puede manipular el header Host y causar que la aplicacion se comporte de maneras inesperadas. Programadores aveces creen en el header host y programas el codigo basado en el: (_SERVER[""HTTP_HOST""] in PHP). Esto tambien se refleja en portales como joombla o wordpress donde los plugins y ejecucion de script, ejemplos:
93
94 <link href=""http://_SERVER['HOST']"" (Joomla)
95
96 ...haciendo un apend de keys secretas y tokens:
97 <a href=""http://_SERVER['HOST']?token=topsecret""> (Django, Gallery y otros)
98 ....e importante directamente scripts:
99 <script src=""http://_SERVER['HOST']/misc/jquery.js?v=1.4.4""> (Various)",,"La aplicacion web deberia usar una variable ""SERVER_NAME"" en lugar de basarse en le Host header.",High,
100 ,Login Page password-guessing attack,"Un problema común con el que se encuentran los programadores web son los ataques de fuerza bruta de logins. Un ataque de fuerza bruta es un intento de adivinar la contraseña por sistemáticamente probar todas las posibles combinaciones de números, letras y símbolos hasta descubrir la convencional correcta. Este ataque se mejora utilizando diccionarios con palabras comunes y combinaciones de las mismas
101
102 Esta pagina de Login no tiene ninguna protección contra este ataque ya que se probaron 20 logins inválidos y el servidor no bloqueo el acceso para seguir intentando. Tampoco dispone de ninguna protección para evitar los intentos de login automáticos (como un captcha).",,"Es recomendable implementar algun tipo de bloqueo de intentos de login tras un numero de fallos en los intentos.
103 Mas información:
104 https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks",,
105 ,Error page web server version disclosure (Pagina de error mostrando version de servidor ),Pidiendo una pagina que no existe el servidor responde con un error. En esta pagina de error se encuentran datos que contienen version del servidor web y/o modulos activados en este. Dicha informacion puede ser usada para mejorar las tacticas del atacante sabiendo a que se enfrenta,,Se debe configurar paginas de error customizadas evitando mostrar esta informacion.,Low,
106 ,Weak SSL,"El servidor esta utiizando un cifrado SSL dèbil.
107
108 Weak SSL ciphers (SSL2 on port 443):
109
110 SSL2_CK_RC4_128_EXPORT40_WITH_MD5 - Low strength
111 SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5 - Low strength
112 SSL2_CK_DES_64_CBC_WITH_MD5 - Low strength
113
114 Weak SSL ciphers (SSL3 on port 443):
115
116 SSL3_CK_RSA_RC4_40_MD5 - Low strength
117 SSL3_CK_RSA_RC2_40_MD5 - Low strength
118 SSL3_CK_RSA_DES_40_CBC_SHA - Low strength
119 SSL3_CK_RSA_DES_64_CBC_SHA - Low strength
120 SSL3_CK_EDH_RSA_DES_40_CBC_SHA - Low strength
121 SSL3_CK_EDH_RSA_DES_64_CBC_SHA - Low strength
122
123 Weak SSL ciphers (TLS1 on port 443):
124
125 TLS1_CK_RSA_EXPORT_WITH_RC4_40_MD5 - Low strength
126 TLS1_CK_RSA_EXPORT_WITH_RC2_CBC_40_MD5 - Low strength
127 TLS1_CK_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
128 TLS1_CK_RSA_WITH_DES_CBC_SHA - Low strength
129 TLS1_CK_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA - Low strength
130 TLS1_CK_DHE_RSA_WITH_DES_CBC_SHA - Low strength",,Reconfigurar el servidor para encriptado mas fuerte.,,
131 ,CRIME SSL/TLS attack,"Compression Ratio Info-leak Made Easy (CRIME) es un exploit contra las cookies secretas del servidor sobre conexiones usando protocolos HTTPS y SPDY que tambien esten usando compresion de datos. Cuando se recupera el contenido de la cookie de autentificacion, permite a un atacante robar la sesion, permitiendo iniciar otros ataques.
132
133 CRIME es un ataque del lado cliente, pero el servidor puede proteger al cliente rechazando la combinacion de estas opciones. Para CRIME, la debilidad es la compresion Deflate.",,"CRIME puede ser combatido previniendo el uso de compresion, tanto del lado del cliente, desactivando la compresion de las peticiones HTTPS, o del lado del servidor previniendo el uso de compresion de datos en las transacciones que utilicen el protocolo TLS.
134
135 Referencias WEB.
136 http://blogs.cisco.com/security/breach-crime-and-blackhat/
137 http://en.wikipedia.org/wiki/CRIME_(security_exploit)
138 http://isecpartners.com/blog/2012/september/details-on-the-crime-attack.aspx",High,
139 ,Transaccion Insegura de HTTPS a HTTP en el form POST,La pagina segura (https) contiene un form que realiza el post sobre una pagina insegura (http). Esto puede confundir al usuario y hacerle creer que su datos son enviados encriptados cuando en realidad no.,,El destino del FORM debe apuntar a una pagina segura (https),,
140 ,Trace Method is Enabled (Metodo TRACE activado),"El metodo Trace esta habilitado en el servidor. En precencia de otras vulnerabilidades cross-domain en los navegadores web, informacion sensible del campo header puede ser leida desde cualquier dominio que soporte metodo HTTP TRACE.
141
142 Un atacante poria abusar de la funcionabilidad HTTP TRACE para ganar acceso a la informacion de los headers HTTP como las cookies y datos de autenticacion.",,"Se recomienda desactivar el metodo TRACE en el servidor web.
143
144 Referencias WEB:
145 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
146 http://www.cgisecurity.com/lib/WH-WhitePaper_XST_ebook.pdf",Low,
147 ,Public Key SSL < 2048 bits (Certificado de llave Publica SSL menor de 2048 Bits),"El certificado SSL usado por el servidor contiene una llave publica de menos de 2048 bits de largo
148
149 Los nuevos estandares de de la Industria de Certificados para SSL (SSL Certificates Industry) seteados por Certification Authority/Browser (CA/B) Forum requiere que los certificados expedidos despues de enero 1 del 2014. Deben ser al menos de 2048-bit largo. Con el incremento del poder de procesamiento de las computadoras, cualquier certificado menor de 2048-bit es riesgoso de ser comprometido por personas mal intecionadas con poder de procesamiento.",,"Si se tiene cualquier certificado de 1024-bito certificados con menos de 2048-bit de largo, sera necesario que se migre a 2048-bit.
150
151 New Standard: https://www.cabforum.org/wp-content/uploads/Baseline_Requirements_V1.pdf",,
152 ,Ruby on Rails CookieStore session cookie persistence,"Ruby on Rails contiene un fallo en su diseño que podria permitir a atacantes facilitar el acceso a las aplicaciones. El problema esta en mecanicsmo de la CookieStore en guardar la cookie en el lado del cliente, mientras no guarda la entrada correspondiente en el lado del servidor. Cuando la aplicacion termina la sesion, Ruby on Rails no tiene manera de trackear esto y verdaderamente invalidad la cookie con la configuracion por defecto. Esto significa que persiste ""de por vida"" y puede ser usada para acceder a aplicaciones inclusive cuando se piensa que se termino la sesion.",,"Actualmente, no se conocen actualizaciones o parches para corregir esta vulnerabilidad. Si es posible migrar temporalmente implementando un sistema de autenticacion mas seguro (e.g. ActiveRecordStore).",,
153 ,Metadatos,"250+ Archivos conteniendo metadatos: Usuarios, Carpetas, fechas de edicion y modificacion, software usado, Direccion de impresoras locales",,"Datos privados son revelados a traves de los metadatos de documentos hosteados en el dominio (PDF, WORD). Datos como nombres de usuario, versiones de sistemas operativos, versiones de software utilizados, fechas y horas de cada modificacion del documento, direcciones de red de impresoras, etc. Se recomienda limpiar de metadatos documentos que luego seran publicados en internet",,
154 ,Robots.txt,Robots.txt revela directorios sensibles. Un atacante busca directamente robots.txt para encontrar puntos desde donde comenzar su ataque.,,"Es conveniente manejar nombres de directorios que no describan el contenido, en especial en directorios sensibles. Por ejemplo en lugar de /setup o /app_data llamar al directorio /Dir_Code1. De esta manera no revelar a un atacante que clase de informacion contiene un directorio, que se intenta ocultar de los buscadores (mediante robots.txt)
155 Otra practica que se me ocurre es la utilizacion de parametros. Por ejemplo:
156 Disallow: /*AB/$
157 Esto desactivará cualquier carpeta que termine con ""AB"" por ejemplo /sourceAB/. Evitando pasar cualquier dato a un atacante y centralizando las carpetas sensibles y ocultandolas simplemente colocando ""AB"" al final.",,
158 ,Typical Login Web,"Archivo de Login nombrado de manera ""comun"".",,Esto facilita a los robots de ataque encontrar paginas sensibles. Se recomienda no usar nombres estandard para paginas de login.,,
159 ,Credentials in Plain Text,La pagina de login viaja sobre texto plano,,Es altamente recomendable que las paginas de login se fuerzen a usar SSL (https),Medium,
160 ,Unencrypted __VIEWSTATE parameter,"El parametro ""__VIEWSTATE"" no esta encriptado. Para reducir las posibilidades que alguien intercepte informacion guardada en ViewState es bueno encriptarlo.",,"Se recomienda encriptar el parametro ""__VIEWSTATE"", para hacer esto se debe setear el tipo de validacion a 3DES. Editar Web.Config y agregar la siguiente linea bajo <system.web>
161 <machineKey validation=""3DES""/>",,
162 ,Insecure Captcha,"La resolucion del Captcha esta incluida en el mismo codigo:
163
164 <img id=""ctl01_mainContent_imgCaptcha"" src=""http://test-www.bancofalabella.com.co/Data/Sites/1/ImgTemp/ImageFormat_THHvB.png""
165 style=""border-width:0px;"" />
166
167 Siendo la respuesta THHvB
168
169 Facilitando la manera de automatizar un script para atacar el form",,Se recomienda implementar un sistema de Captcha que la resolucion no se incluya en el codigo.,,
170 ,Credenciales Repetidas,Existen multiples credeciales repetidas para un mismo acceso.,"Tener credenciales repetidas de un mismo servidor o acceso, posibilita a un atacante tener mayor impacto, pues utilizando un mismo password puede ingresar a distintos servicios o áreas",Evitar utilizar mismas credenciales en distintos servicios,High,
171 ,Ftp Anonimo,Es servicio de FTP posee el usuario : anonymous,"Los servidores FTP anónimos ofrecen sus servicios libremente a todos los usuarios, permiten acceder a sus archivos sin necesidad de tener un 'USER ID' o una cuenta de usuario. Es la manera más cómoda fuera del servicio web de permitir que todo el mundo tenga acceso a cierta información sin que para ello el administrador de un sistema tenga que crear una cuenta para cada usuario.
172
173 Si un servidor posee servicio 'FTP anonymous' solamente con teclear la palabra «anonymous», cuando pregunte por tu usuario tendrás acceso a ese sistema. No se necesita ninguna contraseña preestablecida, aunque tendrás que introducir una sólo para ese momento, normalmente se suele utilizar la dirección de correo electrónico propia.",Evitar usuario anonimo,Medium,
174 ,Credenciales débiles Tomcat,"Se detectaron credenciales por defecto en servidores Tomcat, ejecutándose con privilegios elevados.
175 Un atacante que intente loguearse con una lista de usuarios por defecto podría comprometer el servicio.
176 En este caso en particular el usuario “admin” es muy común en servidores Tomcat, y cuenta con privilegios para ejecutar código, por lo que debe ser protegido con una contraseña fuerte.",,Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.,High,
177 ,Wpad Spoofing,"En los ambientes Windows ante una falla a resolver un nombre de host,
178 realizan una segunda búsqueda utilizando NetBios. La naturaleza de este
179 pedido realizado utilizando broadcast es inseguro si no se tienen
180 recaudos.
181
182 Un atacante podría utilizar esta vulnerabilidad para
183 registrar el dominio WPAD en netbios con el fin de redirigir y modificar
184 el tráfico de las workstations con las que comparte el segmento de red.
185 Este ataque podría derivar en la captura de credenciales o hashes que
186 le brinden acceso a sistemas críticos.",,"Deshabilitar la configuración automática de proxy en los equipos
187 windows, y registrar el nombre de domino wpad, para que ningún equipo de
188 la red pueda impersonarlo.",High,
189 ,Servicio de Telnet,"Las credenciales de usuario se transmiten sobre un canal sin cifrar (servicio telnet).
190 Un atacante capaz de interceptar el tráfico entre los hosts y el usuario remoto, será capaz de obtener las credenciales utilizadas.",,"Reemplazar los servicios que permiten el envío de credenciales en texto plano, por aquellos que lo hacen de forma cifrada. En este caso, existen diferentes alternativas para reemplazar los servicios de administración remota, como por ejemplo ssh o rdp.",Medium,
191 ,Tokens cacheados,"Fue posible impersonar diferentes usuarios de dominio, incluido un administrador de dominio, a través de los tokens de acceso cacheados en el servidor.",,"No existe un parche para resolver este tipo de situaciones, ya que los tokens de acceso son propios de la arquitectura de Windows. Sin embargo es posible implementar algunas medidas a nivel operativo para mitigar en gran parte el impacto del cacheo de tokens. Recomendamos:
192 > Asegurarse que usuarios con altos privilegios (especialmente administradores) tengan una cuenta específica para tareas de administración y otra para loguearse en sus sistemas.
193 > Ejecutar aquellas tareas que requieran mayores privilegios utilizando la aplicación “RunAs”.
194 > Asegurarse que los Domain Admins sólo sean utilizados para administrar el dominio. Crear diferentes cuentas de dominio y asignarle autorización administrativa solo para la unidad de negocio correspondiente.
195 > Asegurarse que las cuentas administrativas de ambientes de desarrollo y test sean diferentes a las de los sistemas críticos de producción.
196 > Ejecutar los servicios necesarios para el correcto funcionamiento de la unidad de negocio en un equipo diferente al Controlador de Dominio.
197 > Utilizar la opción de Active Directory “Account is sensitive and cannot be delegated” (sólo aplica a los logueos interactivos, pero ayuda a reforzar la seguridad de la cuenta).
198
199 Referencias:
200 http://carnal0wnage.attackresearch.com/2008/05/token-passing-with-incognito-part-2.html
201 http://pentestmonkey.net/uncategorized/from-local-admin-to-domain-admin
202 http://www.offensive-security.com/metasploit-unleashed/Fun_With_Incognito",High,
203 ,Denegacion de Servicios(DOS),"un ataque de denegación de servicios, también llamado ataque DoS (de las siglas en inglés Denial of Service) o DDoS (de Distributed Denial of Service), es un ataque a un sistema de computadoras o red que causa que un servicio o recurso sea inaccesible a los usuarios legítimos. Normalmente provoca la pérdida de la conectividad de la red por el consumo del ancho de banda de la red de la víctima o sobrecarga de los recursos computacionales del sistema de la víctima",,La forma de prevenirlo: https://www.owasp.org/index.php/Denial_of_Service,High,
204 ,Revelacion de Informacion (Information Disclosure),Se puede obtener una información sensible del usuario. Esto podría ayudar a un atacante a tener control de una base de datos ó permitirle escalar hacia otro vector de ataque.,,"Determinar si esta información debería ser accesible desde la red, sin estar protegida por credenciales.",Medium,
205 ,Sitio sin Informar,,,/reclamaciones/home/index. ,,
206 ,Listado de Directorios,Muestra directorios que no deberian ser publicos,,Evitar que dichos directorios sean publicos,Medium,
207 ,Shell,"Una shell es parte de codigo programado en (PHP,Python,Ruby,etc) que una vez que es subido al host victima, puede ser utilizado para subir, bajar, borrar archivos.",,"Evitar entradas que posibiliten subir imagenes o codigo al servidor, sin ser adecuadamente controlado",,
208 ,Path Disclosure,Permite ver la ruta a archivos u aplicaciones que no deberian ser mostradas,,"Puede solucionarse desactivando los mensajes de error :
209 En PHP modificando el archivo php.ini ( display_errors = 'off' )
210 En Apache modificando el archivo httpd.conf ( php_flag display_errors off)",,
211 ,File Upload,Es posible subir código o imagenes sin ser fitradas adecuadamente.,,Evitar campos para subir archivos que no sean correctamente filtrados,,
212 ,Metodo Put habilitado (Put File Allow),"Sube, carga o realiza un upload de un recurso especificado (archivo), es el camino más eficiente para subir archivos a un servidor.",,"Evitar que el metodo PUT se encuentre con libre acceso a cualquier tipo de usuario, restringir acceso.",,
213 ,Leer Archivos (Read files),,,,,
214 ,Usuarios por defecto(default users),"Se debe evitar utilizar usuarios y contraseñas por defecto, pues el sistema puede quedar suseptible a un ataque de fuerza bruta o de diccionario.",,Cambiar usuarios y contraseñas de acuerdo a las politicas de la empresa,,
215 ,Sslstrip Attack,"Dado que la página no esta utilizando https para proteger sus credenciales, el panel de ingreso esta implementedo mediante http, y no https, es posible modificar los recursos obtenidos, si el atacante logra intereceptar la comunicación entre ambos sitios. ",,"Cargar todos los recursos a través de https, para los recursos externos recomendamos incluir los mismo de la siguiente manera src=""//dominio.com/recurso.js"" de esta manera el navegador automaticamete incluye el protocolo http o https segun la conexion inicial que genera.",High,
216 ,Enumerar Usuarios,,,,Medium,
217 ,Login User HTTP,"Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Utilizar HTTPS para autenticar usuarios,Medium,
218 ,Falta de Control de Acceso,Se puede acceder a parte del sitio sin una sesion valida,,Validar correctamente la sesiones del sitio verifiquen que el usuario poseen una sesion valida,Medium,
219 ,Cookie Reutilization,La cookie puede ser modificada y reutilizada para hacer nuevas consultas o impersonar usuarios,,Evitar ,Medium,
220 ,Credenciales Debiles md5,"Se detecto que dentro del request se envía el nombre de usuario y la contraseña hasheada. Si bien la contraseña utiliza una funcion de md5, lo hace sin salt para protegerla.
221 Con lo cual un atacante que la intercepte, puede decifrar el md5 para luego obtener la contraseña en texto plano junto con el usuario para acceder al sistema.",,"Aplicar una política de seguridad al servidor que obligue el uso de contraseñas de acuerdo con las políticas de seguridad interna.
222 Se recomienda un cifrado mas robusto con la funcion salt",High,
223 ,CSRF,"Un ataque CSRF fuerza al navegador web validado de una víctima a enviar una petición a una aplicación web vulnerable, la cual entonces realiza la acción elegida a través de la víctima. Al contrario que en los ataques XSS, los cuales explotan la confianza que un usuario tiene en un sitio en particular, el cross site request forgery explota la confianza que un sitio tiene en un usuario en particular.",,"Recomendamos la imprementacion de un feature anti-csrf con el fin de autenticar todoslos request,en particual aquellas peticiones sensibles como por ejemplo el cambiode contraseñas y asignacion de roles (dar permisos de administrador a un usuario). El framework de ASP.net cuenta con este feature llamado viewstate (https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Viewstate_.28ASP.NET.29)",Medium,
224 ,SSL weak ciphers (Cifrado debil),El servidor remoto soporta el uso de SSL pero ofrece una encriptacion debil,,Reconfigurar el servidor web con un nivel de encriptacion mayor,Medium,
225 ,Token de Session en URL,"Información sensible dentro de las URLs puede ser guardado en distintas lugares, por ejemplo en la información del navegador del usuario, en el webserver, o en cualquier proxy o reverse proxy. Las URLs se pueden ver en las pantallas, puede ser guardadas como favoritos o pueden ser enviada entre los usuarios. Esta información puede ser obtenida también como referer, en el histórico de la ultima pagina desde donde se ingresa a otra pagina. Guardar la sesiones en las URLs incrementa que esa información sea captura por un atacante para luego impersonarse como un usuario valido.",,La aplicación debería utilizar otros mecanismos para el envió de las sessiones como cookies o campos ocultos enviados a traves de métodos de POST ,Medium,
226 ,Autenticacion sin HTTPS,"La aplicación web no utiliza HTTPS para la autenticación de usuarios al sistema. Las credenciales de usuario y contraseña, viajan en texto plano con lo cual un atacante podría obtener dichas credenciales para un posterior acceso",,Siempre utilizar HTTPS para autenticar usuarios,High,
227 ,Es-Version Obsoleta / Desactualizada,"El servidor se encuentra utilizando una versión de Apache Tomcat MUY desactualizada (Apache Tomcat/4.1.31), la cual es vulnerable a multiples vulnerabilidades publicas. Actualmente la ultima versión estable es la 8.0.9 ",,"Recomendación actualizar y desactivar los mensajes de error del servidor, que puedan brindar información extra a un atacante",Medium,
228 ,Numero de Tarjeta en Texto Plano,"La respuesta del servidor, contiene el numero de tarjeta de crédito y otra información sensible que debería evitarse enviar en texto plano.",,Utilizar HTTPS en todo el sitio en donde la información sensible pueda ser expuesta.,High,
229 ,Server Version Discloure,El servidor web responde con la version del sistema facilitando a un atacante saber contra que se enfrenta,,"Filtrar en las respuestas del servidor, cualquier dato que demuestre la version del servidor y del sistema operativo del mismo",Low,
230 ,Archivo crossdomain.xml inseguro,"El modelo de seguridad del navegador normalmente previene el contenido web de ser accedido desde otro dominio. Esto comunmente es conocido como ""same origin policy"" (""politica del mismo origen""). Lo politica de archivos URL garantiza acceso cross-dominio para leer datos. Permiten operaciones que no son permitidas por defecto. La politica de acceso de archivo URL esta localizado, por defecto, en el directorio raiz del servidor destino, con el nombre crossdomain.xml (por ejemplo en www.ejemplo.com/crossdomain.xml).
231
232 Cuando un dominio es especificado en el archivo crossdomain.xml, el sitio declara que esta dispuesto a dar acceso a operadores de cualqueir server en ese dominio para obtener cualquier documento donde la regla reside. El archivo crossdomain.xml desplegado en este servidor web abre el servidor a todos los dominios (uso de un unico asterisco ""*"" de comodin es soportado) Como por ejemplo:
233 <cross-domain-policy>
234 <allow-access-from domain=""*"" />
235 </cross-domain-policy>
236
237 Esta practica es correcta para servidores publicos, pero no deberia ser usada en servidores que se encuentran tras un firewall porque puede permitir acceso a areas protejidas. No deberia ser usada para sitios que requieren autenticacion en forma de contraseñas o cookies. ",,"Detenidamente evaluar que sitios deben tener permitido el acceso cross-dominio. Considerar la topologia de red y todos los mecanismos de autenticacion afectados por la configuracion o implementacion de la politica cross-domain.
238 ",Medium,
239 ,Archivos de backup en servidor de producción,"La aplicación web tiene multiples archivos de buckup disponibles para ser descargados, los cuales brindan información de la tecnología que se utiliza en el sitio, así como código fuente de las aplicaciones, nombres de usuarios, rutas de acceso y multiple información sensible del mismo.",,"Es recomendable aplicar buenas politicas deprotección de información sensible, evitando exponer buckups y otra información del sitio web",Very High,
240 ,Exposición de información a través del listado de directorios,"Estos directorios no deberian estar publicos, pues exponen información sensible del tipo de tecnología utilizada, código de programación, información sobre rutas de acceso a distintos lugares, particularmente en este caso podemos listar toda la información del servidor sin ningun tipo de restricción",,Siempre evitar que se puedan listar directorios de manera externa y sin permisos,High,
241 ,Archivos con información sensible,"Es posible acceder a archivos con información sensible, podemos ver el ""log error"" y dentro de este rutas de acceso, nombres de usuario, etc . Con lo cual un atacante con tiempo podría intentar obtener credeciales de un servicio ssh, ftp,o similar para luego crackearlo.
242 ",,Evitar exponer toda información sensible del sistema,High,
243 ,Revelación de IP interno,"La aplicación expone ip/s interno, con lo cual si por algun vector de ataque un atacante logra acceder al servidor o servicio podría continuar la explotación por dicho vector",,Evitar exponer toda información sensible y privada del sistemadel sistema,Low,
244 ,Archivos e información de desarollo en ambientes productivos,"Podemos ver código de programacion, con ejemplos concretos del funcionamiento interno y
245 de la lógica utilizada a la hora de programar, dejando en evidencia
246 informacion como nombres de usuarios, email, dni, telefonos, etc ",,Evitar exponer toda información sensible y privada del sistemadel sistema,High,
247 ,Sentencias SQL sin Prepared Statement,Se detecto que se utilizan una mala implementacion de sentencias SQL concatenando las variables manualmente pudiendo un atacante realizar ataques de SQL Injection,,"Utilizar para la sentencia de SQL Prepared Statement
248 Reference:
249 https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet#Prepared_Statement_Examples",High,
250 ,Mysql lectura y escritura de archivos,Es posible utilizar mysql server para la lectura y escritura de archivos en el servidor,,"Seguir los siguientes lineamientos para el hardening de Mysql Server
251 https://www.owasp.org/index.php/Testing_for_MySQL#Read_from_a_File",High,
252 ,Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
253 ,Servidor productivo y desarrollo,"Por lo que pudimos observar este servidor sirve tanto para produccion como desarrollo, contiene muchisima informacion y pruebas que deberian ser eliminadas.",,"Eliminar el contenido de desarrollo, dejar solo lo necesario para el entorno productivo",High,
254 ,Internal IP Address Disclosure,Una cadena coincidente con una direccion interna de IPv4 fue encontrada en esta pagina. Esto lleva a divulgar informacion sensible acerca del esquema de la red interna. Esta informacion puede ser usada para generar ataques especificos.,,Se recomienda prevenir que esta informacion sea mostrada al usuario,Low,
255 ,Cisco ASA Error,"El Cisco ASA es vulnerable a un Information Leak (CVE-2014-3392), un atacante podria obtener credenciales em base a un error.",,Actualizar a la ultima version del firmware del CISCO ASA,High,
256 ,Listado de directorios,"Evitar listar directorios, muchas veces a partir de aqui se pueden realizar distintos vectores de ataques, por claves almacenadas en archivos ocultos o por tener acceso a archivos de configuracion. ",,"Evitar listar directorios, es recomendable que se desabiliten o se resguarden con algun tipo de autenticacion.",Low,
256256 self.createWorkspace,
257257 self.workspace_manager,
258258 self.ws_sidebar,
259 self.exit_faraday)
259 self.exit_faraday_without_confirm)
260260
261261 dialog.connect("destroy", change_flag)
262262 dialog.show_all()
146146 self.name_entry = Gtk.Entry()
147147 if self.title is not None:
148148 self.name_entry.set_text(self.title)
149 name_box.pack_start(name_label, False, False, 10)
150 name_box.pack_end(self.name_entry, True, True, 10)
149 name_box.pack_start(name_label, True, True, 10)
150 name_box.pack_end(self.name_entry, False, False, 10)
151151 return name_box
152152
153153 def create_description_box(self):
156156 description_label = Gtk.Label()
157157 description_label.set_text("Description: ")
158158 self.description_entry = Gtk.Entry()
159 description_box.pack_start(description_label, False, False, 10)
160 description_box.pack_end(self.description_entry, True, True, 10)
159 description_box.pack_start(description_label, True, True, 10)
160 description_box.pack_end(self.description_entry, False, False, 10)
161161 return description_box
162162
163163 def create_button_box(self):
211211 self.connect("delete_event", lambda _, __: True)
212212 self.exit_faraday = exit_faraday_callback
213213 explanation_message = self.create_explanation_message()
214 self.main_box.pack_start(explanation_message, True, True, 6)
214 self.main_box.pack_start(explanation_message, True, True, 10)
215215 self.main_box.reorder_child(explanation_message, 0)
216216
217217 def on_click_cancel(self, button):
218218 """Override parent's class cancel callback so it exits faraday."""
219 self.exit_faraday(parent=self)
219 self.exit_faraday()
220220
221221 def create_explanation_message(self):
222222 """Returns a simple explanatory message inside a Label"""
223223 message = Gtk.Label()
224224 message.set_text("There are no workspaces available. You must "
225225 "create one to continue using Faraday.")
226 message.set_line_wrap(True)
227 message.set_max_width_chars(38)
228
226229 return message
227230
228231
117117
118118 #Create Host
119119 host_id = self.faraday_api.createAndAddHost(
120 node['resolved_from'],
121 op_sy,
122 'Unknown',
123 'Unknown',
124 node['ip']
125 )
120 node['resolved_from'],
121 op_sy)
122
126123 host = Host(node['ip'], host_id)
127124 self.host_list.append(host)
128125 return host
164161 interface_id,
165162 str(int(float(port))),
166163 'tcp?',
167 int(float(port))
164 [int(float(port)])
168165 )
169166
170167 host.addService(ip, port, service_id)
312309 info_host = self.data['clients'][ip]['agents'][agent]
313310
314311 #Create Host
315 host_id = self.faraday_api.createAndAddHost(
316 ip,
317 os,
318 'Unknown',
319 'Unknown',
320 'Unknown'
321 )
312 host_id = self.faraday_api.createAndAddHost(ip, os)
322313
323314 #'IE Flash' is a keyword only for Internet Explorer??'
324315 try:
136136 # plugin created the object
137137
138138
139 def createAndAddHost(name, os = "Unknown", category=None, update = False, old_hostname = None ):
139 def createAndAddHost(name, os="Unknown"):
140140 host = newHost(name, os)
141 if addHost(host, category, update, old_hostname):
141 if addHost(host):
142142 return host.getID()
143143 return None
144144
238238
239239 #TODO: add class check to object passed to be sure we are adding the right thing to the model
240240
241 def addHost(host, category=None, update = False, old_hostname = None):
241 def addHost(host):
242242 if host is not None:
243 __model_controller.addHostASYNC(host, category, update, old_hostname)
243 __model_controller.addHostASYNC(host)
244244 return True
245245 return False
246246
421421 def find(self, obj_id):
422422 return self.mappers_manager.find(obj_id)
423423
424 def addHostASYNC(self, host, category=None, update=False, old_hostname=None):
424 def addHostASYNC(self, host):
425425 """
426426 ASYNC API
427427 Adds an action to the ModelController actions queue indicating a
428428 new host must be added to the model
429429 """
430430 self.__addPendingAction(modelactions.ADDHOST,
431 host, category, update, old_hostname)
432
433 def addHostSYNC(self, host, category=None, update=False, old_hostname=None):
431 host)
432
433 def addHostSYNC(self, host):
434434 """
435435 SYNC API
436436 Adds a host directly to the model
5757 notification_center.deregisterWidget(widget)
5858
5959
60 def createAndAddHost(name, os="Unknown", category=None, update=False, old_hostname=None):
60 def createAndAddHost(name, os="Unknown"):
6161 host = model.api.newHost(name, os)
62 if addHost(host, category, update, old_hostname):
62 if addHost(host):
6363 return host.getID()
6464 return None
6565
204204 return None
205205
206206
207 def addHost(host, category=None, update = False, old_hostname = None):
207 def addHost(host):
208208 if host is not None:
209 __model_controller.addHostSYNC(host, category, update, old_hostname)
209 __model_controller.addHostSYNC(host)
210210 return True
211211 return False
212212
0 # Makefile for Sphinx documentation
1 #
2
3 # You can set these variables from the command line.
4 SPHINXOPTS =
5 SPHINXBUILD = sphinx-build
6 PAPER =
7 BUILDDIR = _build
8
9 # Internal variables.
10 PAPEROPT_a4 = -D latex_paper_size=a4
11 PAPEROPT_letter = -D latex_paper_size=letter
12 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
13 # the i18n builder cannot share the environment and doctrees with the others
14 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
15
16 .PHONY: help
17 help:
18 @echo "Please use \`make <target>' where <target> is one of"
19 @echo " html to make standalone HTML files"
20 @echo " dirhtml to make HTML files named index.html in directories"
21 @echo " singlehtml to make a single large HTML file"
22 @echo " pickle to make pickle files"
23 @echo " json to make JSON files"
24 @echo " htmlhelp to make HTML files and a HTML help project"
25 @echo " qthelp to make HTML files and a qthelp project"
26 @echo " applehelp to make an Apple Help Book"
27 @echo " devhelp to make HTML files and a Devhelp project"
28 @echo " epub to make an epub"
29 @echo " epub3 to make an epub3"
30 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
31 @echo " latexpdf to make LaTeX files and run them through pdflatex"
32 @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
33 @echo " text to make text files"
34 @echo " man to make manual pages"
35 @echo " texinfo to make Texinfo files"
36 @echo " info to make Texinfo files and run them through makeinfo"
37 @echo " gettext to make PO message catalogs"
38 @echo " changes to make an overview of all changed/added/deprecated items"
39 @echo " xml to make Docutils-native XML files"
40 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
41 @echo " linkcheck to check all external links for integrity"
42 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
43 @echo " coverage to run coverage check of the documentation (if enabled)"
44 @echo " dummy to check syntax errors of document sources"
45
46 .PHONY: clean
47 clean:
48 rm -rf $(BUILDDIR)/*
49
50 .PHONY: html
51 html:
52 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
53 @echo
54 @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
55
56 .PHONY: dirhtml
57 dirhtml:
58 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 @echo
60 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61
62 .PHONY: singlehtml
63 singlehtml:
64 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
65 @echo
66 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
67
68 .PHONY: pickle
69 pickle:
70 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
71 @echo
72 @echo "Build finished; now you can process the pickle files."
73
74 .PHONY: json
75 json:
76 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
77 @echo
78 @echo "Build finished; now you can process the JSON files."
79
80 .PHONY: htmlhelp
81 htmlhelp:
82 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
83 @echo
84 @echo "Build finished; now you can run HTML Help Workshop with the" \
85 ".hhp project file in $(BUILDDIR)/htmlhelp."
86
87 .PHONY: qthelp
88 qthelp:
89 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
90 @echo
91 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
92 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
93 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Faraday.qhcp"
94 @echo "To view the help file:"
95 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Faraday.qhc"
96
97 .PHONY: applehelp
98 applehelp:
99 $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
100 @echo
101 @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
102 @echo "N.B. You won't be able to view it unless you put it in" \
103 "~/Library/Documentation/Help or install it in your application" \
104 "bundle."
105
106 .PHONY: devhelp
107 devhelp:
108 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
109 @echo
110 @echo "Build finished."
111 @echo "To view the help file:"
112 @echo "# mkdir -p $$HOME/.local/share/devhelp/Faraday"
113 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Faraday"
114 @echo "# devhelp"
115
116 .PHONY: epub
117 epub:
118 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
119 @echo
120 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
121
122 .PHONY: epub3
123 epub3:
124 $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3
125 @echo
126 @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3."
127
128 .PHONY: latex
129 latex:
130 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
131 @echo
132 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
133 @echo "Run \`make' in that directory to run these through (pdf)latex" \
134 "(use \`make latexpdf' here to do that automatically)."
135
136 .PHONY: latexpdf
137 latexpdf:
138 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
139 @echo "Running LaTeX files through pdflatex..."
140 $(MAKE) -C $(BUILDDIR)/latex all-pdf
141 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
142
143 .PHONY: latexpdfja
144 latexpdfja:
145 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
146 @echo "Running LaTeX files through platex and dvipdfmx..."
147 $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
148 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
149
150 .PHONY: text
151 text:
152 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
153 @echo
154 @echo "Build finished. The text files are in $(BUILDDIR)/text."
155
156 .PHONY: man
157 man:
158 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
159 @echo
160 @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
161
162 .PHONY: texinfo
163 texinfo:
164 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
165 @echo
166 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
167 @echo "Run \`make' in that directory to run these through makeinfo" \
168 "(use \`make info' here to do that automatically)."
169
170 .PHONY: info
171 info:
172 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
173 @echo "Running Texinfo files through makeinfo..."
174 make -C $(BUILDDIR)/texinfo info
175 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
176
177 .PHONY: gettext
178 gettext:
179 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
180 @echo
181 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
182
183 .PHONY: changes
184 changes:
185 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
186 @echo
187 @echo "The overview file is in $(BUILDDIR)/changes."
188
189 .PHONY: linkcheck
190 linkcheck:
191 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
192 @echo
193 @echo "Link check complete; look for any errors in the above output " \
194 "or in $(BUILDDIR)/linkcheck/output.txt."
195
196 .PHONY: doctest
197 doctest:
198 $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
199 @echo "Testing of doctests in the sources finished, look at the " \
200 "results in $(BUILDDIR)/doctest/output.txt."
201
202 .PHONY: coverage
203 coverage:
204 $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
205 @echo "Testing of coverage in the sources finished, look at the " \
206 "results in $(BUILDDIR)/coverage/python.txt."
207
208 .PHONY: xml
209 xml:
210 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
211 @echo
212 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
213
214 .PHONY: pseudoxml
215 pseudoxml:
216 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
217 @echo
218 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
219
220 .PHONY: dummy
221 dummy:
222 $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy
223 @echo
224 @echo "Build finished. Dummy builder generates no files."
0 # Sphinx build info version 1
1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
2 config: c6d263bc12eb4868c7d35c857befe3f4
3 tags: 645f666f9bcd5a90fca523b33c5a78b7
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>Overview: module code &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="../genindex.html"/>
34 <link rel="search" title="Search" href="../search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="../index.html"/>
36
37
38 <script src="../_static/js/modernizr.min.js"></script>
39
40 </head>
41
42 <body class="wy-body-for-nav" role="document">
43
44 <div class="wy-grid-for-nav">
45
46
47 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48 <div class="wy-side-scroll">
49 <div class="wy-side-nav-search">
50
51
52
53 <a href="../index.html" class="icon icon-home"> Faraday
54
55
56
57 </a>
58
59
60
61
62 <div class="version">
63 0.1
64 </div>
65
66
67
68
69 <div role="search">
70 <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
71 <input type="text" name="q" placeholder="Search docs" />
72 <input type="hidden" name="check_keywords" value="yes" />
73 <input type="hidden" name="area" value="default" />
74 </form>
75 </div>
76
77
78 </div>
79
80 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
81
82
83
84 <!-- Local TOC -->
85 <div class="local-toc"></div>
86
87
88 </div>
89 </div>
90 </nav>
91
92 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
93
94
95 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
96 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
97 <a href="../index.html">Faraday</a>
98 </nav>
99
100
101
102 <div class="wy-nav-content">
103 <div class="rst-content">
104
105
106
107
108
109
110 <div role="navigation" aria-label="breadcrumbs navigation">
111 <ul class="wy-breadcrumbs">
112 <li><a href="../index.html">Docs</a> &raquo;</li>
113
114 <li>Overview: module code</li>
115 <li class="wy-breadcrumbs-aside">
116
117
118
119 </li>
120 </ul>
121 <hr/>
122 </div>
123 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
124 <div itemprop="articleBody">
125
126 <h1>All modules for which code is available</h1>
127 <ul><li><a href="persistence/server/server.html">persistence.server.server</a></li>
128 </ul>
129
130 </div>
131 </div>
132 <footer>
133
134
135 <hr/>
136
137 <div role="contentinfo">
138 <p>
139 &copy; Copyright 2016, Infobyte.
140
141 </p>
142 </div>
143 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
144
145 </footer>
146
147 </div>
148 </div>
149
150 </section>
151
152 </div>
153
154
155
156
157
158 <script type="text/javascript">
159 var DOCUMENTATION_OPTIONS = {
160 URL_ROOT:'../',
161 VERSION:'0.1',
162 COLLAPSE_INDEX:false,
163 FILE_SUFFIX:'.html',
164 HAS_SOURCE: true
165 };
166 </script>
167 <script type="text/javascript" src="../_static/jquery.js"></script>
168 <script type="text/javascript" src="../_static/underscore.js"></script>
169 <script type="text/javascript" src="../_static/doctools.js"></script>
170
171
172
173
174
175 <script type="text/javascript" src="../_static/js/theme.js"></script>
176
177
178
179
180 <script type="text/javascript">
181 jQuery(function () {
182 SphinxRtdTheme.StickyNav.enable();
183 });
184 </script>
185
186
187 </body>
188 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>persistence.server.server &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="../../../genindex.html"/>
34 <link rel="search" title="Search" href="../../../search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="../../../index.html"/>
36 <link rel="up" title="Module code" href="../../index.html"/>
37
38
39 <script src="../../../_static/js/modernizr.min.js"></script>
40
41 </head>
42
43 <body class="wy-body-for-nav" role="document">
44
45 <div class="wy-grid-for-nav">
46
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search">
51
52
53
54 <a href="../../../index.html" class="icon icon-home"> Faraday
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 0.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85 <!-- Local TOC -->
86 <div class="local-toc"></div>
87
88
89 </div>
90 </div>
91 </nav>
92
93 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
95
96 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
97 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
98 <a href="../../../index.html">Faraday</a>
99 </nav>
100
101
102
103 <div class="wy-nav-content">
104 <div class="rst-content">
105
106
107
108
109
110
111 <div role="navigation" aria-label="breadcrumbs navigation">
112 <ul class="wy-breadcrumbs">
113 <li><a href="../../../index.html">Docs</a> &raquo;</li>
114
115 <li><a href="../../index.html">Module code</a> &raquo;</li>
116
117 <li>persistence.server.server</li>
118 <li class="wy-breadcrumbs-aside">
119
120
121
122 </li>
123 </ul>
124 <hr/>
125 </div>
126 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
127 <div itemprop="articleBody">
128
129 <h1>Source code for persistence.server.server</h1><div class="highlight"><pre>
130 <span></span><span class="ch">#!/usr/bin/python2.7</span>
131 <span class="c1"># -*- coding: utf-8 -*-</span>
132
133 <span class="c1"># Faraday Penetration Test IDE</span>
134 <span class="c1"># Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)</span>
135 <span class="c1"># See the file &#39;doc/LICENSE&#39; for the license information</span>
136
137
138 <span class="sd">&quot;&quot;&quot;A module to handle request to the Faraday Server.</span>
139
140 <span class="sd">Note:</span>
141 <span class="sd"> Before using this as an API, you should copy this file and edit</span>
142 <span class="sd"> the FARADAY_UP and the SERVER_URL variables found inmediatly</span>
143 <span class="sd"> below the imports.</span>
144
145 <span class="sd"> FARADAY_UP should be set to False in the copy of the file, and SERVER_URL</span>
146 <span class="sd"> must be a valid server url.</span>
147
148 <span class="sd">Warning:</span>
149 <span class="sd"> This module was though of primarly as a way of querying and removing</span>
150 <span class="sd"> information from the Faraday Server. Adding objects is supported, but should</span>
151 <span class="sd"> be used with care, specially regarding the ID of objects, which must</span>
152 <span class="sd"> be always unique.</span>
153 <span class="sd">&quot;&quot;&quot;</span>
154
155 <span class="kn">import</span> <span class="nn">requests</span>
156 <span class="kn">import</span> <span class="nn">json</span>
157 <span class="kn">from</span> <span class="nn">persistence.server.utils</span> <span class="k">import</span> <span class="n">force_unique</span>
158 <span class="kn">from</span> <span class="nn">persistence.server.server_io_exceptions</span> <span class="k">import</span> <span class="p">(</span><span class="n">WrongObjectSignature</span><span class="p">,</span>
159 <span class="n">CantCommunicateWithServerError</span><span class="p">,</span>
160 <span class="n">ConflictInDatabase</span><span class="p">,</span>
161 <span class="n">ResourceDoesNotExist</span><span class="p">,</span>
162 <span class="n">Unauthorized</span><span class="p">,</span>
163 <span class="n">MoreThanOneObjectFoundByID</span><span class="p">)</span>
164
165 <span class="kn">from</span> <span class="nn">persistence.server.changes_stream</span> <span class="k">import</span> <span class="n">CouchChangesStream</span>
166
167 <span class="c1"># NOTE: Change is you want to use this module by itself.</span>
168 <span class="c1"># If FARADAY_UP is False, SERVER_URL must be a valid faraday server url</span>
169 <span class="n">FARADAY_UP</span> <span class="o">=</span> <span class="kc">True</span>
170 <span class="n">SERVER_URL</span> <span class="o">=</span> <span class="s2">&quot;http://127.0.0.1:5984&quot;</span>
171
172 <span class="k">def</span> <span class="nf">_conf</span><span class="p">():</span>
173 <span class="kn">from</span> <span class="nn">config.configuration</span> <span class="k">import</span> <span class="n">getInstanceConfiguration</span>
174 <span class="n">CONF</span> <span class="o">=</span> <span class="n">getInstanceConfiguration</span><span class="p">()</span>
175 <span class="k">return</span> <span class="n">CONF</span>
176
177 <span class="k">def</span> <span class="nf">_get_base_server_url</span><span class="p">():</span>
178 <span class="k">if</span> <span class="n">FARADAY_UP</span><span class="p">:</span>
179 <span class="n">server_url</span> <span class="o">=</span> <span class="n">_conf</span><span class="p">()</span><span class="o">.</span><span class="n">getCouchURI</span><span class="p">()</span>
180 <span class="k">else</span><span class="p">:</span>
181 <span class="n">server_url</span> <span class="o">=</span> <span class="n">SERVER_URL</span>
182 <span class="k">return</span> <span class="n">server_url</span>
183
184
185 <span class="k">def</span> <span class="nf">_create_server_api_url</span><span class="p">():</span>
186 <span class="sd">&quot;&quot;&quot;Return the server&#39;s api url.&quot;&quot;&quot;</span>
187 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/_api&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_get_base_server_url</span><span class="p">())</span>
188
189 <span class="k">def</span> <span class="nf">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_name</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
190 <span class="sd">&quot;&quot;&quot;Creates a url to get from the server. Takes the workspace name</span>
191 <span class="sd"> as a string, an object_name paramter which is the object you want to</span>
192 <span class="sd"> query as a string (&#39;hosts&#39;, &#39;interfaces&#39;, etc) .</span>
193
194 <span class="sd"> object_name may be None if you want to get the workspace itself.</span>
195
196 <span class="sd"> Return the get_url as a string.</span>
197 <span class="sd"> &quot;&quot;&quot;</span>
198 <span class="n">object_name</span> <span class="o">=</span> <span class="s2">&quot;/</span><span class="si">{0}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">object_name</span><span class="p">)</span> <span class="k">if</span> <span class="n">object_name</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
199 <span class="n">get_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}{2}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">(),</span>
200 <span class="n">workspace_name</span><span class="p">,</span>
201 <span class="n">object_name</span><span class="p">)</span>
202 <span class="k">return</span> <span class="n">get_url</span>
203
204
205 <span class="k">def</span> <span class="nf">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
206 <span class="n">server_api_url</span> <span class="o">=</span> <span class="n">_create_server_api_url</span><span class="p">()</span>
207 <span class="n">post_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}</span><span class="s1">/doc/</span><span class="si">{2}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_api_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
208 <span class="k">return</span> <span class="n">post_url</span>
209
210
211 <span class="k">def</span> <span class="nf">_create_server_delete_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
212 <span class="k">return</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
213
214 <span class="c1"># XXX: COUCH IT!</span>
215 <span class="k">def</span> <span class="nf">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
216 <span class="n">server_url</span> <span class="o">=</span> <span class="n">_get_base_server_url</span><span class="p">()</span>
217 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/</span><span class="si">{1}</span><span class="s2">/</span><span class="si">{2}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
218
219
220 <span class="c1"># XXX: COUCH IT!</span>
221 <span class="k">def</span> <span class="nf">_create_couch_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
222 <span class="k">return</span> <span class="n">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
223
224
225 <span class="c1"># XXX: COUCH IT!</span>
226 <span class="k">def</span> <span class="nf">_create_couch_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
227 <span class="n">server_base_url</span> <span class="o">=</span> <span class="n">_get_base_server_url</span><span class="p">()</span>
228 <span class="n">db_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/</span><span class="si">{1}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_base_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">)</span>
229 <span class="k">return</span> <span class="n">db_url</span>
230
231 <span class="k">def</span> <span class="nf">_create_server_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
232 <span class="n">server_api_url</span> <span class="o">=</span> <span class="n">_create_server_api_url</span><span class="p">()</span>
233 <span class="n">db_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_api_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">)</span>
234 <span class="k">return</span> <span class="n">db_url</span>
235
236 <span class="k">def</span> <span class="nf">_unsafe_io_with_server</span><span class="p">(</span><span class="n">server_io_function</span><span class="p">,</span> <span class="n">server_expected_response</span><span class="p">,</span>
237 <span class="n">server_url</span><span class="p">,</span> <span class="o">**</span><span class="n">payload</span><span class="p">):</span>
238 <span class="sd">&quot;&quot;&quot;A wrapper for functions which deals with I/O to or from the server.</span>
239 <span class="sd"> It calls the server_io_function with url server_url and the payload,</span>
240 <span class="sd"> raising an CantCommunicateWithServerError if the response wasn&#39;t</span>
241 <span class="sd"> server_expected_response or if there was a Connection Error.</span>
242
243 <span class="sd"> Return the response from the server.</span>
244 <span class="sd"> &quot;&quot;&quot;</span>
245 <span class="k">try</span><span class="p">:</span>
246 <span class="n">answer</span> <span class="o">=</span> <span class="n">server_io_function</span><span class="p">(</span><span class="n">server_url</span><span class="p">,</span> <span class="o">**</span><span class="n">payload</span><span class="p">)</span>
247 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">409</span> <span class="ow">and</span> <span class="n">answer</span><span class="o">.</span><span class="n">json</span><span class="p">()[</span><span class="s1">&#39;error&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;conflict&#39;</span><span class="p">:</span>
248 <span class="k">raise</span> <span class="n">ConflictInDatabase</span><span class="p">(</span><span class="n">answer</span><span class="p">)</span>
249 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">404</span><span class="p">:</span>
250 <span class="k">raise</span> <span class="n">ResourceDoesNotExist</span><span class="p">(</span><span class="n">server_url</span><span class="p">)</span>
251 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">403</span> <span class="ow">or</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">401</span><span class="p">:</span>
252 <span class="k">raise</span> <span class="n">Unauthorized</span><span class="p">(</span><span class="n">answer</span><span class="p">)</span>
253 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="n">server_expected_response</span><span class="p">:</span>
254 <span class="k">raise</span> <span class="n">requests</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RequestException</span><span class="p">(</span><span class="n">response</span><span class="o">=</span><span class="n">answer</span><span class="p">)</span>
255 <span class="k">except</span> <span class="n">requests</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RequestException</span><span class="p">:</span>
256 <span class="k">raise</span> <span class="n">CantCommunicateWithServerError</span><span class="p">(</span><span class="n">server_io_function</span><span class="p">,</span> <span class="n">server_url</span><span class="p">,</span> <span class="n">payload</span><span class="p">)</span>
257 <span class="k">return</span> <span class="n">answer</span>
258
259
260 <span class="k">def</span> <span class="nf">_parse_json</span><span class="p">(</span><span class="n">response_object</span><span class="p">):</span>
261 <span class="sd">&quot;&quot;&quot;Takes a response object and return its response as a dictionary.&quot;&quot;&quot;</span>
262 <span class="k">try</span><span class="p">:</span>
263 <span class="k">return</span> <span class="n">response_object</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
264 <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
265 <span class="k">return</span> <span class="p">{}</span>
266
267
268 <span class="k">def</span> <span class="nf">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
269 <span class="sd">&quot;&quot;&quot;Get from the request_url. Takes an arbitrary number of parameters</span>
270 <span class="sd"> to customize the request_url if necessary.</span>
271
272 <span class="sd"> Will raise a CantCommunicateWithServerError if requests cant stablish</span>
273 <span class="sd"> connection to server or if response is not equal to 200.</span>
274
275 <span class="sd"> Return a dictionary with the information in the json.</span>
276 <span class="sd"> &quot;&quot;&quot;</span>
277 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">,</span>
278 <span class="mi">200</span><span class="p">,</span>
279 <span class="n">request_url</span><span class="p">,</span>
280 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
281
282 <span class="k">def</span> <span class="nf">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">201</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
283 <span class="sd">&quot;&quot;&quot;Put to the post_url. If update is True, try to get the object</span>
284 <span class="sd"> revision first so as to update the object in Couch. You can</span>
285 <span class="sd"> customize the expected response (it should be 201, but Couchdbkit returns</span>
286 <span class="sd"> 200, so...). Also take an arbitrary number of parameters to put into the</span>
287 <span class="sd"> post_url.</span>
288
289 <span class="sd"> Will raise a CantCommunicateWithServerError if requests cant stablish</span>
290 <span class="sd"> connection to server or if response is not equal to 201.</span>
291
292 <span class="sd"> Return a dictionary with the response from couchdb, which looks like this:</span>
293 <span class="sd"> {u&#39;id&#39;: u&#39;61&#39;, u&#39;ok&#39;: True, u&#39;rev&#39;: u&#39;1-967a00dff5e02add41819138abb3284d&#39;}</span>
294 <span class="sd"> &quot;&quot;&quot;</span>
295 <span class="k">if</span> <span class="n">update</span><span class="p">:</span>
296 <span class="n">last_rev</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">post_url</span><span class="p">)[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span>
297 <span class="n">params</span><span class="p">[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">last_rev</span>
298 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">put</span><span class="p">,</span>
299 <span class="n">expected_response</span><span class="p">,</span>
300 <span class="n">post_url</span><span class="p">,</span>
301 <span class="n">json</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
302
303
304 <span class="k">def</span> <span class="nf">_delete</span><span class="p">(</span><span class="n">delete_url</span><span class="p">,</span> <span class="n">database</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
305 <span class="sd">&quot;&quot;&quot;Deletes the object on delete_url. If you&#39;re deleting a database,</span>
306 <span class="sd"> specify the database parameter to True&quot;&quot;&quot;</span>
307 <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
308 <span class="k">if</span> <span class="ow">not</span> <span class="n">database</span><span class="p">:</span>
309 <span class="n">last_rev</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">delete_url</span><span class="p">)[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span>
310 <span class="n">params</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;rev&#39;</span><span class="p">:</span> <span class="n">last_rev</span><span class="p">}</span>
311 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">delete</span><span class="p">,</span>
312 <span class="mi">200</span><span class="p">,</span>
313 <span class="n">delete_url</span><span class="p">,</span>
314 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
315
316
317 <span class="k">def</span> <span class="nf">_get_raw_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
318 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
319 <span class="sd"> a dictionary with the hosts table.&quot;&quot;&quot;</span>
320 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;hosts&#39;</span><span class="p">)</span>
321 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
322
323
324 <span class="k">def</span> <span class="nf">_get_raw_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
325 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
326 <span class="sd"> a dictionary with the vulns table.&quot;&quot;&quot;</span>
327 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;vulns&#39;</span><span class="p">)</span>
328 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
329
330
331 <span class="k">def</span> <span class="nf">_get_raw_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
332 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
333 <span class="sd"> a dictionary with the interfaces table.&quot;&quot;&quot;</span>
334 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;interfaces&#39;</span><span class="p">)</span>
335 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
336
337
338 <span class="k">def</span> <span class="nf">_get_raw_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
339 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
340 <span class="sd"> a dictionary with the services table.&quot;&quot;&quot;</span>
341 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;services&#39;</span><span class="p">)</span>
342 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
343
344
345 <span class="k">def</span> <span class="nf">_get_raw_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
346 <span class="sd">&quot;&quot;&quot;Take a workspace name and an arbitrary number of params and</span>
347 <span class="sd"> return a dictionary with the notes table.&quot;&quot;&quot;</span>
348 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;notes&#39;</span><span class="p">)</span>
349 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
350
351
352 <span class="k">def</span> <span class="nf">_get_raw_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
353 <span class="sd">&quot;&quot;&quot;Take a workspace name and an arbitrary number of params and</span>
354 <span class="sd"> return a dictionary with the credentials table.&quot;&quot;&quot;</span>
355 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;credentials&#39;</span><span class="p">)</span>
356 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
357
358
359 <span class="k">def</span> <span class="nf">_get_raw_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
360 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;commands&#39;</span><span class="p">)</span>
361 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
362
363
364 <span class="k">def</span> <span class="nf">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
365 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;summary&#39;</span><span class="p">)</span>
366 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">)</span>
367
368 <span class="c1"># XXX: COUCH IT!</span>
369 <span class="k">def</span> <span class="nf">_save_to_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
370 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_couch_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
371 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
372
373 <span class="c1"># XXX: COUCH IT!</span>
374 <span class="k">def</span> <span class="nf">_update_in_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
375 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
376 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
377
378 <span class="k">def</span> <span class="nf">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
379 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
380 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
381
382 <span class="k">def</span> <span class="nf">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
383 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
384 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
385
386 <span class="k">def</span> <span class="nf">_save_db_to_server</span><span class="p">(</span><span class="n">db_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
387 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_db_url</span><span class="p">(</span><span class="n">db_name</span><span class="p">)</span>
388 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
389
390 <span class="c1"># XXX: SEMI COUCH IT!</span>
391 <span class="k">def</span> <span class="nf">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">):</span>
392 <span class="n">delete_url</span> <span class="o">=</span> <span class="n">_create_server_delete_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
393 <span class="k">return</span> <span class="n">_delete</span><span class="p">(</span><span class="n">delete_url</span><span class="p">)</span>
394
395 <span class="c1"># XXX: COUCH IT!</span>
396 <span class="k">def</span> <span class="nf">_couch_changes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
397 <span class="k">return</span> <span class="n">CouchChangesStream</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
398 <span class="n">_create_couch_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">),</span>
399 <span class="o">**</span><span class="n">params</span><span class="p">)</span>
400
401
402 <span class="k">def</span> <span class="nf">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_name</span><span class="p">,</span>
403 <span class="n">faraday_object_row_name</span><span class="p">,</span> <span class="n">full_table</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
404 <span class="o">**</span><span class="n">params</span><span class="p">):</span>
405 <span class="sd">&quot;&quot;&quot;Takes a workspace_name (str), a faraday_object_name (str),</span>
406 <span class="sd"> a faraday_object_row_name (str) and an arbitrary number of params.</span>
407 <span class="sd"> Return a list of dictionaries that hold the information for the objects</span>
408 <span class="sd"> in table faraday_object_name.</span>
409
410 <span class="sd"> The full_table paramether may be used to get the full dictionary instead</span>
411 <span class="sd"> of just the one inside the &#39;value&#39; key which holds information about the</span>
412 <span class="sd"> object.</span>
413
414 <span class="sd"> Preconditions:</span>
415 <span class="sd"> faraday_object_name == &#39;host&#39;, &#39;vuln&#39;, &#39;interface&#39;, &#39;service&#39;, &#39;note&#39;</span>
416 <span class="sd"> or &#39;credential&#39;</span>
417
418 <span class="sd"> faraday_object_row_name must be the key to the dictionary which holds</span>
419 <span class="sd"> the information of the object per se in the table. most times this is &#39;rows&#39;</span>
420 <span class="sd"> &quot;&quot;&quot;</span>
421 <span class="n">object_to_func</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;hosts&#39;</span><span class="p">:</span> <span class="n">_get_raw_hosts</span><span class="p">,</span>
422 <span class="s1">&#39;vulns&#39;</span><span class="p">:</span> <span class="n">_get_raw_vulns</span><span class="p">,</span>
423 <span class="s1">&#39;interfaces&#39;</span><span class="p">:</span> <span class="n">_get_raw_interfaces</span><span class="p">,</span>
424 <span class="s1">&#39;services&#39;</span><span class="p">:</span> <span class="n">_get_raw_services</span><span class="p">,</span>
425 <span class="s1">&#39;notes&#39;</span><span class="p">:</span> <span class="n">_get_raw_notes</span><span class="p">,</span>
426 <span class="s1">&#39;credentials&#39;</span><span class="p">:</span> <span class="n">_get_raw_credentials</span><span class="p">,</span>
427 <span class="s1">&#39;commands&#39;</span><span class="p">:</span> <span class="n">_get_raw_commands</span><span class="p">}</span>
428
429 <span class="n">appropiate_function</span> <span class="o">=</span> <span class="n">object_to_func</span><span class="p">[</span><span class="n">faraday_object_name</span><span class="p">]</span>
430 <span class="n">appropiate_dictionary</span> <span class="o">=</span> <span class="n">appropiate_function</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
431 <span class="n">faraday_ready_dictionaries</span> <span class="o">=</span> <span class="p">[]</span>
432 <span class="k">if</span> <span class="n">appropiate_dictionary</span><span class="p">:</span>
433 <span class="k">for</span> <span class="n">raw_dictionary</span> <span class="ow">in</span> <span class="n">appropiate_dictionary</span><span class="p">[</span><span class="n">faraday_object_row_name</span><span class="p">]:</span>
434 <span class="k">if</span> <span class="ow">not</span> <span class="n">full_table</span><span class="p">:</span>
435 <span class="n">faraday_ready_dictionaries</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">raw_dictionary</span><span class="p">[</span><span class="s1">&#39;value&#39;</span><span class="p">])</span>
436 <span class="k">else</span><span class="p">:</span>
437 <span class="n">faraday_ready_dictionaries</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">raw_dictionary</span><span class="p">)</span>
438 <span class="k">return</span> <span class="n">faraday_ready_dictionaries</span>
439
440
441 <div class="viewcode-block" id="get_hosts"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_hosts">[docs]</a><span class="k">def</span> <span class="nf">get_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
442 <span class="sd">&quot;&quot;&quot;Get hosts from the server.</span>
443
444 <span class="sd"> Args:</span>
445 <span class="sd"> workspace_name (str): the workspace from which to get the hosts.</span>
446 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
447
448 <span class="sd"> Returns:</span>
449 <span class="sd"> A dictionary containing the hosts matching the query.</span>
450 <span class="sd"> &quot;&quot;&quot;</span>
451 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;hosts&#39;</span><span class="p">,</span>
452 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
453
454
455 <div class="viewcode-block" id="get_all_vulns"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_all_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
456 <span class="sd">&quot;&quot;&quot;Get vulns, both normal and web, from the server.</span>
457
458 <span class="sd"> Args:</span>
459 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
460 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
461
462 <span class="sd"> Returns:</span>
463 <span class="sd"> A dictionary containing the vulns matching the query.</span>
464 <span class="sd"> &quot;&quot;&quot;</span>
465 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;vulns&#39;</span><span class="p">,</span>
466 <span class="s1">&#39;vulnerabilities&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
467
468
469 <div class="viewcode-block" id="get_vulns"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
470 <span class="sd">&quot;&quot;&quot;Get only normal vulns from the server.</span>
471
472 <span class="sd"> Args:</span>
473 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
474 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
475
476 <span class="sd"> Returns:</span>
477 <span class="sd"> A dictionary containing the vulns matching the query.</span>
478 <span class="sd"> &quot;&quot;&quot;</span>
479 <span class="k">return</span> <span class="n">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;Vulnerability&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
480
481
482 <div class="viewcode-block" id="get_web_vulns"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_web_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_web_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
483 <span class="sd">&quot;&quot;&quot;Get only web vulns from the server.</span>
484
485 <span class="sd"> Args:</span>
486 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
487 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
488
489 <span class="sd"> Returns:</span>
490 <span class="sd"> A dictionary containing the vulns matching the query.</span>
491 <span class="sd"> &quot;&quot;&quot;</span>
492 <span class="k">return</span> <span class="n">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;VulnerabilityWeb&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
493
494 <div class="viewcode-block" id="get_interfaces"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_interfaces">[docs]</a><span class="k">def</span> <span class="nf">get_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
495 <span class="sd">&quot;&quot;&quot;Get interfaces from the server.</span>
496
497 <span class="sd"> Args:</span>
498 <span class="sd"> workspace_name (str): the workspace from which to get the interfaces.</span>
499 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
500
501 <span class="sd"> Returns:</span>
502 <span class="sd"> A dictionary containing the interfaces matching the query.</span>
503 <span class="sd"> &quot;&quot;&quot;</span>
504 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;interfaces&#39;</span><span class="p">,</span>
505 <span class="s1">&#39;interfaces&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
506
507 <div class="viewcode-block" id="get_services"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_services">[docs]</a><span class="k">def</span> <span class="nf">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
508 <span class="sd">&quot;&quot;&quot;Get services from the server.</span>
509
510 <span class="sd"> Args:</span>
511 <span class="sd"> workspace_name (str): the workspace from which to get the services.</span>
512 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
513
514 <span class="sd"> Returns:</span>
515 <span class="sd"> A dictionary containing the services matching the query.</span>
516 <span class="sd"> &quot;&quot;&quot;</span>
517 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;services&#39;</span><span class="p">,</span>
518 <span class="s1">&#39;services&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
519
520 <div class="viewcode-block" id="get_credentials"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_credentials">[docs]</a><span class="k">def</span> <span class="nf">get_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
521 <span class="sd">&quot;&quot;&quot;Get credentials from the server.</span>
522
523 <span class="sd"> Args:</span>
524 <span class="sd"> workspace_name (str): the workspace from which to get the credentials.</span>
525 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
526
527 <span class="sd"> Returns:</span>
528 <span class="sd"> A dictionary containing the credentials matching the query.</span>
529 <span class="sd"> &quot;&quot;&quot;</span>
530 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;credentials&#39;</span><span class="p">,</span>
531 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
532
533 <div class="viewcode-block" id="get_notes"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_notes">[docs]</a><span class="k">def</span> <span class="nf">get_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
534 <span class="sd">&quot;&quot;&quot;Get notes from the server.</span>
535
536 <span class="sd"> Args:</span>
537 <span class="sd"> workspace_name (str): the workspace from which to get the notes.</span>
538 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
539
540 <span class="sd"> Returns:</span>
541 <span class="sd"> A dictionary containing the notes matching the query.</span>
542 <span class="sd"> &quot;&quot;&quot;</span>
543 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;notes&#39;</span><span class="p">,</span>
544 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
545
546 <div class="viewcode-block" id="get_commands"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_commands">[docs]</a><span class="k">def</span> <span class="nf">get_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
547 <span class="sd">&quot;&quot;&quot;Get commands from the server.</span>
548
549 <span class="sd"> Args:</span>
550 <span class="sd"> workspace_name (str): the workspace from which to get the commands.</span>
551 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
552
553 <span class="sd"> Returns:</span>
554 <span class="sd"> A dictionary containing the commands matching the query.</span>
555 <span class="sd"> &quot;&quot;&quot;</span>
556 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;commands&#39;</span><span class="p">,</span>
557 <span class="s1">&#39;commands&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
558
559 <div class="viewcode-block" id="get_objects"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_objects">[docs]</a><span class="k">def</span> <span class="nf">get_objects</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
560 <span class="sd">&quot;&quot;&quot;Get any type of object from the server, be it hosts, vulns, interfaces,</span>
561 <span class="sd"> services, credentials, commands or notes.</span>
562
563 <span class="sd"> Args:</span>
564 <span class="sd"> workspace_name (str): the workspace from which to get the commands.</span>
565 <span class="sd"> object_signature (str): the type of object to get. Must equal &#39;hosts&#39;,</span>
566 <span class="sd"> &#39;vulns&#39;, &#39;interfaces&#39;, &#39;services&#39;, &#39;credentials&#39;, &#39;notes&#39; or &#39;commands&#39;</span>
567 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
568
569 <span class="sd"> Returns:</span>
570 <span class="sd"> A dictionary containing the commands matching the query.</span>
571
572 <span class="sd"> Raises:</span>
573 <span class="sd"> WrongObjectSignature: if the object_signature string didn&#39;t match</span>
574 <span class="sd"> a faraday object.</span>
575 <span class="sd"> &quot;&quot;&quot;</span>
576 <span class="n">object_to_func</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;hosts&#39;</span><span class="p">:</span> <span class="n">get_hosts</span><span class="p">,</span>
577 <span class="s1">&#39;vulns&#39;</span><span class="p">:</span> <span class="n">get_vulns</span><span class="p">,</span>
578 <span class="s1">&#39;interfaces&#39;</span><span class="p">:</span> <span class="n">get_interfaces</span><span class="p">,</span>
579 <span class="s1">&#39;services&#39;</span><span class="p">:</span> <span class="n">get_services</span><span class="p">,</span>
580 <span class="s1">&#39;credentials&#39;</span><span class="p">:</span> <span class="n">get_credentials</span><span class="p">,</span>
581 <span class="s1">&#39;notes&#39;</span><span class="p">:</span> <span class="n">get_notes</span><span class="p">,</span>
582 <span class="s1">&#39;commands&#39;</span><span class="p">:</span> <span class="n">get_commands</span><span class="p">}</span>
583 <span class="k">try</span><span class="p">:</span>
584 <span class="n">appropiate_function</span> <span class="o">=</span> <span class="n">object_to_func</span><span class="p">[</span><span class="n">object_signature</span><span class="p">]</span>
585 <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
586 <span class="k">raise</span> <span class="n">WrongObjectSignature</span><span class="p">(</span><span class="n">object_signature</span><span class="p">)</span>
587
588 <span class="k">return</span> <span class="n">appropiate_function</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
589
590 <span class="c1"># cha cha cha chaaaanges!</span>
591 <div class="viewcode-block" id="get_changes_stream"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_changes_stream">[docs]</a><span class="k">def</span> <span class="nf">get_changes_stream</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">since</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">heartbeat</span><span class="o">=</span><span class="s1">&#39;1000&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_params</span><span class="p">):</span>
592 <span class="k">return</span> <span class="n">_couch_changes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">since</span><span class="o">=</span><span class="n">since</span><span class="p">,</span> <span class="n">feed</span><span class="o">=</span><span class="s1">&#39;continuous&#39;</span><span class="p">,</span>
593 <span class="n">heartbeat</span><span class="o">=</span><span class="n">heartbeat</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_params</span><span class="p">)</span></div>
594
595 <div class="viewcode-block" id="get_workspaces_names"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_workspaces_names">[docs]</a><span class="k">def</span> <span class="nf">get_workspaces_names</span><span class="p">():</span>
596 <span class="sd">&quot;&quot;&quot;Returns:</span>
597 <span class="sd"> A dictionary with a list with the workspaces names.&quot;&quot;&quot;</span>
598 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/ws&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">()))</span></div>
599
600 <span class="c1"># XXX: COUCH IT!</span>
601 <span class="k">def</span> <span class="nf">_clean_up_stupid_couch_response</span><span class="p">(</span><span class="n">response_string</span><span class="p">):</span>
602 <span class="sd">&quot;&quot;&quot;Couch likes to give invalid jsons as a response :). So nice.&quot;&quot;&quot;</span>
603 <span class="n">interesting_part</span> <span class="o">=</span> <span class="s2">&quot;{&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">response_string</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;{&quot;</span><span class="p">)[</span><span class="mi">1</span><span class="p">:])</span>
604 <span class="n">almost_there</span> <span class="o">=</span> <span class="n">interesting_part</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;}&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
605 <span class="n">ok_yeah</span> <span class="o">=</span> <span class="s2">&quot;}&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">almost_there</span><span class="p">)</span>
606 <span class="n">hopefully_valid_json</span> <span class="o">=</span> <span class="s2">&quot;{{</span><span class="si">{0}</span><span class="s2">}}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ok_yeah</span><span class="p">)</span>
607 <span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">hopefully_valid_json</span><span class="p">)</span>
608
609 <span class="c1"># XXX: COUCH IT!</span>
610 <span class="c1"># COUCH IT LEVEL: REVOLUTIONS</span>
611 <div class="viewcode-block" id="get_object_before_last_revision"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_object_before_last_revision">[docs]</a><span class="k">def</span> <span class="nf">get_object_before_last_revision</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
612 <span class="sd">&quot;&quot;&quot;Get an object before its last revision. Useful to get information about</span>
613 <span class="sd"> recently deleted objects.</span>
614
615 <span class="sd"> Warning:</span>
616 <span class="sd"> Error-pronce process. You should check for &#39;None&#39; after usage,</span>
617 <span class="sd"> as that&#39;s the return value if any problem arose during execution.</span>
618
619 <span class="sd"> Args:</span>
620 <span class="sd"> workspace_name (str): the workspace where the object was</span>
621 <span class="sd"> object_id (str): the id of the object</span>
622
623 <span class="sd"> Returns:</span>
624 <span class="sd"> A dictionary with the object&#39;s information.</span>
625 <span class="sd"> &quot;&quot;&quot;</span>
626 <span class="n">get_url</span> <span class="o">=</span> <span class="n">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
627 <span class="n">response</span> <span class="o">=</span> <span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="n">get_url</span><span class="p">,</span>
628 <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;revs&#39;</span><span class="p">:</span> <span class="s1">&#39;true&#39;</span><span class="p">,</span> <span class="s1">&#39;open_revs&#39;</span><span class="p">:</span> <span class="s1">&#39;all&#39;</span><span class="p">})</span>
629 <span class="k">try</span><span class="p">:</span>
630 <span class="n">valid_json_response</span> <span class="o">=</span> <span class="n">_clean_up_stupid_couch_response</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
631 <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
632 <span class="k">return</span> <span class="kc">None</span>
633 <span class="k">try</span><span class="p">:</span>
634 <span class="n">id_before_del</span> <span class="o">=</span> <span class="n">valid_json_response</span><span class="p">[</span><span class="s1">&#39;_revisions&#39;</span><span class="p">][</span><span class="s1">&#39;ids&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
635 <span class="n">new_number_for_rev</span> <span class="o">=</span> <span class="n">valid_json_response</span><span class="p">[</span><span class="s1">&#39;_revisions&#39;</span><span class="p">][</span><span class="s1">&#39;start&#39;</span><span class="p">]</span> <span class="o">-</span> <span class="mi">1</span>
636 <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> <span class="c1"># one if never too safe when you call a function called &quot;_clean_up_stupid_couch_response&quot;</span>
637 <span class="k">return</span> <span class="kc">None</span>
638
639 <span class="n">rev_id_before_del</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">-</span><span class="si">{1}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">new_number_for_rev</span><span class="p">,</span> <span class="n">id_before_del</span><span class="p">)</span>
640 <span class="n">object_dict</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">get_url</span><span class="p">,</span> <span class="n">rev</span><span class="o">=</span><span class="n">rev_id_before_del</span><span class="p">)</span>
641 <span class="k">return</span> <span class="n">object_dict</span></div>
642
643
644 <div class="viewcode-block" id="get_object"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_object">[docs]</a><span class="k">def</span> <span class="nf">get_object</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
645 <span class="sd">&quot;&quot;&quot;Get an unique object of arbitrary type.</span>
646
647 <span class="sd"> Args:</span>
648 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
649 <span class="sd"> object_signature (str): must be either &#39;hosts&#39;, &#39;vulns&#39;, &#39;interfaces&#39;</span>
650 <span class="sd"> &#39;services&#39;, &#39;credentials&#39;, &#39;notes&#39; or &#39;commands&#39;.</span>
651 <span class="sd"> object_id (str): the id of the object</span>
652
653 <span class="sd"> Returns:</span>
654 <span class="sd"> A dictionary containing information about the object.</span>
655
656 <span class="sd"> Raises:</span>
657 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the object_id is shared</span>
658 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
659 <span class="sd"> contact Infobyte LCC.</span>
660 <span class="sd"> &quot;&quot;&quot;</span>
661 <span class="n">objects</span> <span class="o">=</span> <span class="n">get_objects</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">object_id</span><span class="p">)</span>
662 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">objects</span><span class="p">)</span></div>
663
664 <div class="viewcode-block" id="get_host"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_host">[docs]</a><span class="k">def</span> <span class="nf">get_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">):</span>
665 <span class="sd">&quot;&quot;&quot;Get an unique host.</span>
666
667 <span class="sd"> Args:</span>
668 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
669 <span class="sd"> host_id (str): the id of the host</span>
670
671 <span class="sd"> Returns:</span>
672 <span class="sd"> A dictionary containing information about the host.</span>
673
674 <span class="sd"> Raises:</span>
675 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the host id is shared</span>
676 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
677 <span class="sd"> contact Infobyte LCC.</span>
678 <span class="sd"> &quot;&quot;&quot;</span>
679 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">host_id</span><span class="p">))</span></div>
680
681 <div class="viewcode-block" id="get_vuln"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_vuln">[docs]</a><span class="k">def</span> <span class="nf">get_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
682 <span class="sd">&quot;&quot;&quot;Get an unique vuln.</span>
683
684 <span class="sd"> Args:</span>
685 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
686 <span class="sd"> vuln_id (str): the id of the vuln</span>
687
688 <span class="sd"> Returns:</span>
689 <span class="sd"> A dictionary containing information about the vuln.</span>
690
691 <span class="sd"> Raises:</span>
692 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the vuln id is shared</span>
693 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
694 <span class="sd"> contact Infobyte LCC.</span>
695 <span class="sd"> &quot;&quot;&quot;</span>
696 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">vuln_id</span><span class="p">))</span></div>
697
698 <div class="viewcode-block" id="get_web_vuln"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_web_vuln">[docs]</a><span class="k">def</span> <span class="nf">get_web_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
699 <span class="sd">&quot;&quot;&quot;Get an unique web vuln.</span>
700
701 <span class="sd"> Args:</span>
702 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
703 <span class="sd"> web vuln_id (str): the id of the web vuln</span>
704
705 <span class="sd"> Returns:</span>
706 <span class="sd"> A dictionary containing information about the web vuln.</span>
707
708 <span class="sd"> Raises:</span>
709 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the web vuln id is shared</span>
710 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
711 <span class="sd"> contact Infobyte LCC.</span>
712 <span class="sd"> &quot;&quot;&quot;</span>
713 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_web_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">vuln_id</span><span class="p">))</span></div>
714
715 <div class="viewcode-block" id="get_interface"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_interface">[docs]</a><span class="k">def</span> <span class="nf">get_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">):</span>
716 <span class="sd">&quot;&quot;&quot;Get an unique interface.</span>
717
718 <span class="sd"> Args:</span>
719 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
720 <span class="sd"> interface_id (str): the id of the interface</span>
721
722 <span class="sd"> Returns:</span>
723 <span class="sd"> A dictionary containing information about the interface.</span>
724
725 <span class="sd"> Raises:</span>
726 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the interface id is shared</span>
727 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
728 <span class="sd"> contact Infobyte LCC.</span>
729 <span class="sd"> &quot;&quot;&quot;</span>
730 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">interface_id</span><span class="p">))</span></div>
731
732 <div class="viewcode-block" id="get_service"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_service">[docs]</a><span class="k">def</span> <span class="nf">get_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">):</span>
733 <span class="sd">&quot;&quot;&quot;Get an unique service.</span>
734
735 <span class="sd"> Args:</span>
736 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
737 <span class="sd"> service_id (str): the id of the service</span>
738
739 <span class="sd"> Returns:</span>
740 <span class="sd"> A dictionary containing information about the service.</span>
741
742 <span class="sd"> Raises:</span>
743 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the service id is shared</span>
744 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
745 <span class="sd"> contact Infobyte LCC.</span>
746 <span class="sd"> &quot;&quot;&quot;</span>
747 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">service_id</span><span class="p">))</span></div>
748
749 <div class="viewcode-block" id="get_note"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_note">[docs]</a><span class="k">def</span> <span class="nf">get_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">):</span>
750 <span class="sd">&quot;&quot;&quot;Get an unique note.</span>
751
752 <span class="sd"> Args:</span>
753 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
754 <span class="sd"> note_id (str): the id of the note</span>
755
756 <span class="sd"> Returns:</span>
757 <span class="sd"> A dictionary containing information about the note.</span>
758
759 <span class="sd"> Raises:</span>
760 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the note id is shared</span>
761 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
762 <span class="sd"> contact Infobyte LCC.</span>
763 <span class="sd"> &quot;&quot;&quot;</span>
764 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">note_id</span><span class="p">))</span></div>
765
766 <div class="viewcode-block" id="get_credential"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_credential">[docs]</a><span class="k">def</span> <span class="nf">get_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">):</span>
767 <span class="sd">&quot;&quot;&quot;Get an unique credential.</span>
768
769 <span class="sd"> Args:</span>
770 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
771 <span class="sd"> credential_id (str): the id of the credential</span>
772
773 <span class="sd"> Returns:</span>
774 <span class="sd"> A dictionary containing information about the credential.</span>
775
776 <span class="sd"> Raises:</span>
777 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the credential id is shared</span>
778 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
779 <span class="sd"> contact Infobyte LCC.</span>
780 <span class="sd"> &quot;&quot;&quot;</span>
781 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">credential_id</span><span class="p">))</span></div>
782
783 <div class="viewcode-block" id="get_command"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_command">[docs]</a><span class="k">def</span> <span class="nf">get_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">):</span>
784 <span class="sd">&quot;&quot;&quot;Get an unique command.</span>
785
786 <span class="sd"> Args:</span>
787 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
788 <span class="sd"> command_id (str): the id of the command</span>
789
790 <span class="sd"> Returns:</span>
791 <span class="sd"> A dictionary containing information about the command.</span>
792
793 <span class="sd"> Raises:</span>
794 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the command id is shared</span>
795 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
796 <span class="sd"> contact Infobyte LCC.</span>
797 <span class="sd"> &quot;&quot;&quot;</span>
798 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">command_id</span><span class="p">))</span></div>
799
800 <div class="viewcode-block" id="get_workspace"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_workspace">[docs]</a><span class="k">def</span> <span class="nf">get_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
801 <span class="sd">&quot;&quot;&quot;Get an unique command.</span>
802
803 <span class="sd"> Args:</span>
804 <span class="sd"> command_name (str): the command where the object should be found.</span>
805 <span class="sd"> command_id (str): the id of the command</span>
806
807 <span class="sd"> Returns:</span>
808 <span class="sd"> A dictionary containing information about the command.</span>
809
810 <span class="sd"> Raises:</span>
811 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the command id is shared</span>
812 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
813 <span class="sd"> contact Infobyte LCC.</span>
814 <span class="sd"> &quot;&quot;&quot;</span>
815 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)</span>
816 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
817
818 <div class="viewcode-block" id="get_workspace_summary"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_workspace_summary">[docs]</a><span class="k">def</span> <span class="nf">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
819 <span class="sd">&quot;&quot;&quot;Get a collection of data about the workspace.</span>
820
821 <span class="sd"> Args:</span>
822 <span class="sd"> workspace_name (str): the workspace to get the stats from.</span>
823
824 <span class="sd"> Returns:</span>
825 <span class="sd"> A dictionary with the workspace&#39;s information</span>
826 <span class="sd"> &quot;&quot;&quot;</span>
827 <span class="k">return</span> <span class="n">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;stats&#39;</span><span class="p">]</span></div>
828
829 <div class="viewcode-block" id="get_workspace_numbers"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_workspace_numbers">[docs]</a><span class="k">def</span> <span class="nf">get_workspace_numbers</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
830 <span class="sd">&quot;&quot;&quot;Get the number of hosts, interfaces, services and vulns in the workspace.</span>
831
832 <span class="sd"> Args:</span>
833 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
834
835 <span class="sd"> Return:</span>
836 <span class="sd"> A tuple of 4 elements with the amounts of hosts, interfaces, services and vulns.</span>
837 <span class="sd"> &quot;&quot;&quot;</span>
838 <span class="n">stats</span> <span class="o">=</span> <span class="n">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;stats&#39;</span><span class="p">]</span>
839 <span class="k">return</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;hosts&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;services&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;total_vulns&#39;</span><span class="p">]</span></div>
840
841 <div class="viewcode-block" id="get_hosts_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_hosts_number">[docs]</a><span class="k">def</span> <span class="nf">get_hosts_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
842 <span class="sd">&quot;&quot;&quot;</span>
843 <span class="sd"> Args:</span>
844 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
845 <span class="sd"> **params: any of the Couchdb request parameters</span>
846
847 <span class="sd"> Returns:</span>
848 <span class="sd"> The amount of hosts in the workspace as an integer.</span>
849 <span class="sd"> &quot;&quot;&quot;</span>
850 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;hosts&#39;</span><span class="p">])</span></div>
851
852 <div class="viewcode-block" id="get_services_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_services_number">[docs]</a><span class="k">def</span> <span class="nf">get_services_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
853 <span class="sd">&quot;&quot;&quot;</span>
854 <span class="sd"> Args:</span>
855 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
856 <span class="sd"> **params: any of the Couchdb request parameters</span>
857
858 <span class="sd"> Returns:</span>
859 <span class="sd"> The amount of services in the workspace as an integer.</span>
860 <span class="sd"> &quot;&quot;&quot;</span>
861 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">])</span></div>
862
863 <div class="viewcode-block" id="get_interfaces_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_interfaces_number">[docs]</a><span class="k">def</span> <span class="nf">get_interfaces_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
864 <span class="sd">&quot;&quot;&quot;</span>
865 <span class="sd"> Args:</span>
866 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
867 <span class="sd"> **params: any of the Couchdb request parameters</span>
868
869 <span class="sd"> Returns:</span>
870 <span class="sd"> The amount of interfaces in the workspace as an integer.</span>
871 <span class="sd"> &quot;&quot;&quot;</span>
872 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">])</span></div>
873
874 <div class="viewcode-block" id="get_vulns_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_vulns_number">[docs]</a><span class="k">def</span> <span class="nf">get_vulns_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
875 <span class="sd">&quot;&quot;&quot;</span>
876 <span class="sd"> Args:</span>
877 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
878 <span class="sd"> **params: any of the Couchdb request parameters</span>
879
880 <span class="sd"> Returns:</span>
881 <span class="sd"> The amount of vulns in the workspace as an integer.</span>
882 <span class="sd"> &quot;&quot;&quot;</span>
883 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;total_vulns&#39;</span><span class="p">])</span></div>
884
885 <div class="viewcode-block" id="get_notes_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_notes_number">[docs]</a><span class="k">def</span> <span class="nf">get_notes_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
886 <span class="sd">&quot;&quot;&quot;</span>
887 <span class="sd"> Args:</span>
888 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
889 <span class="sd"> **params: any of the Couchdb request parameters</span>
890
891 <span class="sd"> Returns:</span>
892 <span class="sd"> The amount of notes in the workspace as an integer.</span>
893 <span class="sd"> &quot;&quot;&quot;</span>
894 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;notes&#39;</span><span class="p">])</span></div>
895
896 <div class="viewcode-block" id="get_credentials_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_credentials_number">[docs]</a><span class="k">def</span> <span class="nf">get_credentials_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
897 <span class="sd">&quot;&quot;&quot;</span>
898 <span class="sd"> Args:</span>
899 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
900 <span class="sd"> **params: any of the Couchdb request parameters</span>
901
902 <span class="sd"> Returns:</span>
903 <span class="sd"> The amount of credentials in the workspace as an integer.</span>
904 <span class="sd"> &quot;&quot;&quot;</span>
905 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">_get_raw_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">))</span></div>
906
907 <div class="viewcode-block" id="get_commands_number"><a class="viewcode-back" href="../../../server.html#persistence.server.server.get_commands_number">[docs]</a><span class="k">def</span> <span class="nf">get_commands_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
908 <span class="sd">&quot;&quot;&quot;</span>
909 <span class="sd"> Args:</span>
910 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
911 <span class="sd"> **params: any of the Couchdb request parameters</span>
912
913 <span class="sd"> Returns:</span>
914 <span class="sd"> The amount of commands in the workspace as an integer.</span>
915 <span class="sd"> &quot;&quot;&quot;</span>
916 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">_get_raw_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">))</span></div>
917
918 <div class="viewcode-block" id="create_host"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_host">[docs]</a><span class="k">def</span> <span class="nf">create_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="p">,</span> <span class="n">default_gateway</span><span class="p">,</span>
919 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
920 <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
921 <span class="sd">&quot;&quot;&quot;Create a host.</span>
922
923 <span class="sd"> Args:</span>
924 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
925 <span class="sd"> id (str): the id of the host. Must be unique.</span>
926 <span class="sd"> name (str): the host&#39;s name</span>
927 <span class="sd"> os (str): the operative system of the host</span>
928 <span class="sd"> default_gateway (str): the host&#39;s default_gateway</span>
929 <span class="sd"> description (str): a description.</span>
930 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
931 <span class="sd"> on None.</span>
932 <span class="sd"> owned (bool): is the host owned or not?</span>
933 <span class="sd"> owner (str): an owner for the host</span>
934 <span class="sd"> parent (Faraday Object): the host&#39;s parent. If you don&#39;t know this, leave</span>
935 <span class="sd"> on None.</span>
936
937 <span class="sd"> Returns:</span>
938 <span class="sd"> A dictionary with the server&#39;s response.</span>
939 <span class="sd"> &quot;&quot;&quot;</span>
940 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
941 <span class="nb">id</span><span class="p">,</span>
942 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="o">=</span><span class="n">os</span><span class="p">,</span>
943 <span class="n">default_gateway</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">,</span>
944 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
945 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
946 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
947 <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span>
948 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
949 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Host&quot;</span><span class="p">)</span></div>
950
951 <div class="viewcode-block" id="update_host"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_host">[docs]</a><span class="k">def</span> <span class="nf">update_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="p">,</span> <span class="n">default_gateway</span><span class="p">,</span>
952 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
953 <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
954 <span class="sd">&quot;&quot;&quot;Updates a host.</span>
955
956 <span class="sd"> Args:</span>
957 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
958 <span class="sd"> id (str): the id of the host. Must be unique.</span>
959 <span class="sd"> name (str): the host&#39;s name</span>
960 <span class="sd"> os (str): the operative system of the host</span>
961 <span class="sd"> default_gateway (str): the host&#39;s default_gateway</span>
962 <span class="sd"> description (str): a description.</span>
963 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
964 <span class="sd"> on None, it will be created automatically.</span>
965 <span class="sd"> owned (bool): is the host owned or not?</span>
966 <span class="sd"> owner (str): an owner for the host</span>
967 <span class="sd"> parent (Faraday Object): the host&#39;s parent. If you don&#39;t know this, leave</span>
968 <span class="sd"> on None.</span>
969
970 <span class="sd"> Returns:</span>
971 <span class="sd"> A dictionary with the server&#39;s response.</span>
972 <span class="sd"> &quot;&quot;&quot;</span>
973 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
974 <span class="nb">id</span><span class="p">,</span>
975 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="o">=</span><span class="n">os</span><span class="p">,</span>
976 <span class="n">default_gateway</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">,</span>
977 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
978 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
979 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
980 <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span>
981 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
982 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Host&quot;</span><span class="p">)</span></div>
983
984
985 <span class="c1"># TODO: FIX. If you actually pass ipv4 or ipv6 as None, which are the defaults</span>
986 <span class="c1"># values here, the server will complain. Review if this should be fixed on</span>
987 <span class="c1"># the client or on the server.</span>
988 <div class="viewcode-block" id="create_interface"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_interface">[docs]</a><span class="k">def</span> <span class="nf">create_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">mac</span><span class="p">,</span>
989 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">hostnames</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">network_segment</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
990 <span class="n">ipv4</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ipv6</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
991 <span class="sd">&quot;&quot;&quot;Creates an interface.</span>
992
993 <span class="sd"> Warning:</span>
994 <span class="sd"> DO NOT leave ipv4 and ipv6 values on None, as the default indicated.</span>
995 <span class="sd"> This is a known bug and we&#39;re working to fix it. ipv4 and ipv6 need to</span>
996 <span class="sd"> be valid IP addresses, or, in case one of them is irrelevant, empty strings.</span>
997
998 <span class="sd"> Args:</span>
999 <span class="sd"> workspace_name (str): the name of the workspace where the interface will be saved.</span>
1000 <span class="sd"> id (str): the id of the interface. Must be unique.</span>
1001 <span class="sd"> name (str): the interface&#39;s name</span>
1002 <span class="sd"> description (str): a description.</span>
1003 <span class="sd"> mac (str) the mac address of the interface</span>
1004 <span class="sd"> owned (bool): is the host owned or not?</span>
1005 <span class="sd"> owner (str): an owner for the host</span>
1006 <span class="sd"> hostnames ([str]): a list of hostnames</span>
1007 <span class="sd"> network_segment (str): the network segment</span>
1008 <span class="sd"> ipv4 (str): the ipv4 direction of the interface.</span>
1009 <span class="sd"> ipv6 (str): the ipv6 direction of the interface.</span>
1010 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1011 <span class="sd"> on None, it will be created automatically.</span>
1012
1013 <span class="sd"> Returns:</span>
1014 <span class="sd"> A dictionary with the server&#39;s response.</span>
1015 <span class="sd"> &quot;&quot;&quot;</span>
1016 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1017 <span class="nb">id</span><span class="p">,</span>
1018 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1019 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1020 <span class="n">mac</span><span class="o">=</span><span class="n">mac</span><span class="p">,</span>
1021 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1022 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1023 <span class="n">hostnames</span><span class="o">=</span><span class="n">hostnames</span><span class="p">,</span>
1024 <span class="n">network_segment</span><span class="o">=</span><span class="n">network_segment</span><span class="p">,</span>
1025 <span class="n">ipv4</span><span class="o">=</span><span class="n">ipv4</span><span class="p">,</span>
1026 <span class="n">ipv6</span><span class="o">=</span><span class="n">ipv6</span><span class="p">,</span>
1027 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Interface&quot;</span><span class="p">,</span>
1028 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1029
1030 <div class="viewcode-block" id="update_interface"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_interface">[docs]</a><span class="k">def</span> <span class="nf">update_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">mac</span><span class="p">,</span>
1031 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">hostnames</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">network_segment</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1032 <span class="n">ipv4</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ipv6</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1033 <span class="sd">&quot;&quot;&quot;Creates an interface.</span>
1034
1035 <span class="sd"> Warning:</span>
1036 <span class="sd"> DO NOT leave ipv4 and ipv6 values on None, as the default indicated.</span>
1037 <span class="sd"> This is a known bug and we&#39;re working to fix it. ipv4 and ipv6 need to</span>
1038 <span class="sd"> be valid IP addresses, or, in case one of them is irrelevant, empty strings.</span>
1039
1040 <span class="sd"> Args:</span>
1041 <span class="sd"> workspace_name (str): the name of the workspace where the interface will be saved.</span>
1042 <span class="sd"> id (str): the id of the interface. Must be unique.</span>
1043 <span class="sd"> name (str): the interface&#39;s name</span>
1044 <span class="sd"> description (str): a description.</span>
1045 <span class="sd"> mac (str) the mac address of the interface</span>
1046 <span class="sd"> owned (bool): is the host owned or not?</span>
1047 <span class="sd"> owner (str): an owner for the host</span>
1048 <span class="sd"> hostnames ([str]): a list of hostnames</span>
1049 <span class="sd"> network_segment (str): the network segment</span>
1050 <span class="sd"> ipv4 (str): the ipv4 direction of the interface.</span>
1051 <span class="sd"> ipv6 (str): the ipv6 direction of the interface.</span>
1052 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1053 <span class="sd"> on None, it will be created automatically.</span>
1054
1055 <span class="sd"> Returns:</span>
1056 <span class="sd"> A dictionary with the server&#39;s response.</span>
1057 <span class="sd"> &quot;&quot;&quot;</span>
1058 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1059 <span class="nb">id</span><span class="p">,</span>
1060 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1061 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1062 <span class="n">mac</span><span class="o">=</span><span class="n">mac</span><span class="p">,</span>
1063 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1064 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1065 <span class="n">hostnames</span><span class="o">=</span><span class="n">hostnames</span><span class="p">,</span>
1066 <span class="n">network_segment</span><span class="o">=</span><span class="n">network_segment</span><span class="p">,</span>
1067 <span class="n">ipv4</span><span class="o">=</span><span class="n">ipv4</span><span class="p">,</span>
1068 <span class="n">ipv6</span><span class="o">=</span><span class="n">ipv6</span><span class="p">,</span>
1069 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Interface&quot;</span><span class="p">,</span>
1070 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1071
1072 <div class="viewcode-block" id="create_service"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_service">[docs]</a><span class="k">def</span> <span class="nf">create_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">ports</span><span class="p">,</span>
1073 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">protocol</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1074 <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1075 <span class="sd">&quot;&quot;&quot;Creates a service.</span>
1076
1077 <span class="sd"> Args:</span>
1078 <span class="sd"> workspace_name (str): the name of the workspace where the service will be saved.</span>
1079 <span class="sd"> id (str): the id of the service. Must be unique.</span>
1080 <span class="sd"> name (str): the host&#39;s name</span>
1081 <span class="sd"> description (str): a description.</span>
1082 <span class="sd"> ports ([str]): a list of ports for the service.</span>
1083 <span class="sd"> owned (bool): is the service owned or not?</span>
1084 <span class="sd"> owner (str): an owner for the service</span>
1085 <span class="sd"> protocol (str): the service&#39;s protocol</span>
1086 <span class="sd"> status (str): the service&#39;s status</span>
1087 <span class="sd"> version (str): the service&#39;s version</span>
1088 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1089 <span class="sd"> on None, it will be created automatically.</span>
1090
1091 <span class="sd"> Returns:</span>
1092 <span class="sd"> A dictionary with the server&#39;s response.</span>
1093 <span class="sd"> &quot;&quot;&quot;</span>
1094 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1095 <span class="nb">id</span><span class="p">,</span>
1096 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1097 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1098 <span class="n">ports</span><span class="o">=</span><span class="n">ports</span><span class="p">,</span>
1099 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1100 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1101 <span class="n">protocol</span><span class="o">=</span><span class="n">protocol</span><span class="p">,</span>
1102 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1103 <span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span>
1104 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Service&quot;</span><span class="p">,</span>
1105 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1106
1107 <div class="viewcode-block" id="update_service"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_service">[docs]</a><span class="k">def</span> <span class="nf">update_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">ports</span><span class="p">,</span>
1108 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">protocol</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1109 <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1110 <span class="sd">&quot;&quot;&quot;Creates a service.</span>
1111
1112 <span class="sd"> Args:</span>
1113 <span class="sd"> workspace_name (str): the name of the workspace where the service will be saved.</span>
1114 <span class="sd"> id (str): the id of the service. Must be unique.</span>
1115 <span class="sd"> name (str): the service&#39;s name</span>
1116 <span class="sd"> description (str): a description.</span>
1117 <span class="sd"> ports ([str]): a list of ports for the service.</span>
1118 <span class="sd"> owned (bool): is the host owned or not?</span>
1119 <span class="sd"> owner (str): an owner for the service</span>
1120 <span class="sd"> protocol (str): the service&#39;s protocol</span>
1121 <span class="sd"> status (str): the service&#39;s status</span>
1122 <span class="sd"> version (str): the service&#39;s version</span>
1123 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1124 <span class="sd"> on None, it will be created automatically.</span>
1125
1126 <span class="sd"> Returns:</span>
1127 <span class="sd"> A dictionary with the server&#39;s response.</span>
1128 <span class="sd"> &quot;&quot;&quot;</span>
1129 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1130 <span class="nb">id</span><span class="p">,</span>
1131 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1132 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1133 <span class="n">ports</span><span class="o">=</span><span class="n">ports</span><span class="p">,</span>
1134 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1135 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1136 <span class="n">protocol</span><span class="o">=</span><span class="n">protocol</span><span class="p">,</span>
1137 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1138 <span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span>
1139 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Service&quot;</span><span class="p">,</span>
1140 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1141
1142
1143 <div class="viewcode-block" id="create_vuln"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_vuln">[docs]</a><span class="k">def</span> <span class="nf">create_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1144 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1145 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1146 <span class="sd">&quot;&quot;&quot;Creates a vuln.</span>
1147
1148 <span class="sd"> Args:</span>
1149 <span class="sd"> workspace_name (str): the name of the workspace where the vuln will be saved.</span>
1150 <span class="sd"> id (str): the id of the vuln. Must be unique.</span>
1151 <span class="sd"> name (str): the vuln&#39;s name</span>
1152 <span class="sd"> description (str): a description.</span>
1153 <span class="sd"> owned (bool): is the vuln owned or not?</span>
1154 <span class="sd"> owner (str): an owner for the vuln</span>
1155 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1156 <span class="sd"> data (str): any aditional data about the vuln</span>
1157 <span class="sd"> refs ([str]): references for the vulnerability</span>
1158 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1159 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1160 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1161 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1162 <span class="sd"> status (str): the service&#39;s status</span>
1163 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1164 <span class="sd"> on None, it will be created automatically.</span>
1165
1166 <span class="sd"> Returns:</span>
1167 <span class="sd"> A dictionary with the server&#39;s response.</span>
1168 <span class="sd"> &quot;&quot;&quot;</span>
1169 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1170 <span class="nb">id</span><span class="p">,</span>
1171 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1172 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1173 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1174 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1175 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1176 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1177 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1178 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1179 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1180 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1181 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Vulnerability&quot;</span><span class="p">,</span>
1182 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1183 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1184
1185 <div class="viewcode-block" id="update_vuln"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_vuln">[docs]</a><span class="k">def</span> <span class="nf">update_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1186 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1187 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1188 <span class="sd">&quot;&quot;&quot;Updates a vuln.</span>
1189
1190 <span class="sd"> Args:</span>
1191 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
1192 <span class="sd"> id (str): the id of the host. Must be unique.</span>
1193 <span class="sd"> name (str): the host&#39;s name</span>
1194 <span class="sd"> description (str): a description.</span>
1195 <span class="sd"> owned (bool): is the vuln owned or not?</span>
1196 <span class="sd"> owner (str): an owner for the vuln</span>
1197 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1198 <span class="sd"> data (str): any aditional data about the vuln</span>
1199 <span class="sd"> refs ([str]): references for the vulnerability</span>
1200 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1201 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1202 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1203 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1204 <span class="sd"> status (str): the service&#39;s status</span>
1205 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1206 <span class="sd"> on None, it will be created automatically.</span>
1207
1208 <span class="sd"> Returns:</span>
1209 <span class="sd"> A dictionary with the server&#39;s response.</span>
1210 <span class="sd"> &quot;&quot;&quot;</span>
1211 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1212 <span class="nb">id</span><span class="p">,</span>
1213 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1214 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1215 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1216 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1217 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1218 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1219 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1220 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1221 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1222 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1223 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Vulnerability&quot;</span><span class="p">,</span>
1224 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1225 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1226
1227 <div class="viewcode-block" id="create_vuln_web"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_vuln_web">[docs]</a><span class="k">def</span> <span class="nf">create_vuln_web</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1228 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1229 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1230 <span class="n">query</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">request</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">response</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">website</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1231 <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1232 <span class="sd">&quot;&quot;&quot;Creates a vuln web.</span>
1233
1234 <span class="sd"> Args:</span>
1235 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1236 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1237 <span class="sd"> name (str): the vuln web&#39;s name</span>
1238 <span class="sd"> description (str): a description.</span>
1239 <span class="sd"> owner (str): an owner for the host</span>
1240 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1241 <span class="sd"> data (str): any aditional data about the vuln</span>
1242 <span class="sd"> refs ([str]): references for the vulnerability</span>
1243 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1244 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1245 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1246 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1247 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1248 <span class="sd"> on None, it will be created automatically.</span>
1249 <span class="sd"> method (str): the web vuln method</span>
1250 <span class="sd"> params (str): the parameters for the web vuln</span>
1251 <span class="sd"> path (str): the web vuln&#39;s path</span>
1252 <span class="sd"> query (str): the web vuln&#39;s query</span>
1253 <span class="sd"> request (str): the web vuln&#39;s request</span>
1254 <span class="sd"> response (str): the web vuln&#39;s response</span>
1255 <span class="sd"> category (str): a category for the web vuln&#39;s</span>
1256 <span class="sd"> website (str): the website where the vuln was found</span>
1257 <span class="sd"> status (str): the web vulns&#39;s status</span>
1258
1259 <span class="sd"> Returns:</span>
1260 <span class="sd"> A dictionary with the server&#39;s response.</span>
1261 <span class="sd"> &quot;&quot;&quot;</span>
1262 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1263 <span class="nb">id</span><span class="p">,</span>
1264 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1265 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1266 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1267 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1268 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1269 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1270 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1271 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1272 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1273 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1274 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1275 <span class="n">method</span><span class="o">=</span><span class="n">method</span><span class="p">,</span>
1276 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1277 <span class="n">path</span><span class="o">=</span><span class="n">path</span><span class="p">,</span>
1278 <span class="n">pname</span><span class="o">=</span><span class="n">pname</span><span class="p">,</span>
1279 <span class="n">query</span><span class="o">=</span><span class="n">query</span><span class="p">,</span>
1280 <span class="n">request</span><span class="o">=</span><span class="n">request</span><span class="p">,</span>
1281 <span class="n">response</span><span class="o">=</span><span class="n">response</span><span class="p">,</span>
1282 <span class="n">website</span><span class="o">=</span><span class="n">website</span><span class="p">,</span>
1283 <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span>
1284 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1285 <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;VulnerabilityWeb&#39;</span><span class="p">)</span></div>
1286
1287 <div class="viewcode-block" id="update_vuln_web"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_vuln_web">[docs]</a><span class="k">def</span> <span class="nf">update_vuln_web</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1288 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1289 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1290 <span class="n">query</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">request</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">response</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">website</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1291 <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1292 <span class="sd">&quot;&quot;&quot;Creates a vuln web.</span>
1293
1294 <span class="sd"> Args:</span>
1295 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1296 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1297 <span class="sd"> name (str): the vuln web&#39;s name</span>
1298 <span class="sd"> description (str): a description.</span>
1299 <span class="sd"> owner (str): an owner for the host</span>
1300 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1301 <span class="sd"> data (str): any aditional data about the vuln</span>
1302 <span class="sd"> refs ([str]): references for the vulnerability</span>
1303 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1304 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1305 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1306 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1307 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1308 <span class="sd"> on None, it will be created automatically.</span>
1309 <span class="sd"> method (str): the web vuln method</span>
1310 <span class="sd"> params (str): the parameters for the web vuln</span>
1311 <span class="sd"> path (str): the web vuln&#39;s path</span>
1312 <span class="sd"> query (str): the web vuln&#39;s query</span>
1313 <span class="sd"> request (str): the web vuln&#39;s request</span>
1314 <span class="sd"> response (str): the web vuln&#39;s response</span>
1315 <span class="sd"> category (str): a category for the web vuln&#39;s</span>
1316 <span class="sd"> website (str): the website where the vuln was found</span>
1317 <span class="sd"> status (str): the web vulns&#39;s status</span>
1318
1319 <span class="sd"> Returns:</span>
1320 <span class="sd"> A dictionary with the server&#39;s response.</span>
1321 <span class="sd"> &quot;&quot;&quot;</span>
1322 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1323 <span class="nb">id</span><span class="p">,</span>
1324 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1325 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1326 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1327 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1328 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1329 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1330 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1331 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1332 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1333 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1334 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1335 <span class="n">method</span><span class="o">=</span><span class="n">method</span><span class="p">,</span>
1336 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1337 <span class="n">path</span><span class="o">=</span><span class="n">path</span><span class="p">,</span>
1338 <span class="n">pname</span><span class="o">=</span><span class="n">pname</span><span class="p">,</span>
1339 <span class="n">query</span><span class="o">=</span><span class="n">query</span><span class="p">,</span>
1340 <span class="n">request</span><span class="o">=</span><span class="n">request</span><span class="p">,</span>
1341 <span class="n">response</span><span class="o">=</span><span class="n">response</span><span class="p">,</span>
1342 <span class="n">website</span><span class="o">=</span><span class="n">website</span><span class="p">,</span>
1343 <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span>
1344 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1345 <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;VulnerabilityWeb&#39;</span><span class="p">)</span></div>
1346
1347 <div class="viewcode-block" id="create_note"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_note">[docs]</a><span class="k">def</span> <span class="nf">create_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">text</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1348 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1349 <span class="sd">&quot;&quot;&quot;Creates a note.</span>
1350
1351 <span class="sd"> Args:</span>
1352 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1353 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1354 <span class="sd"> name (str): the vuln web&#39;s name</span>
1355 <span class="sd"> text (str): the note&#39;s text</span>
1356 <span class="sd"> owned (bool): is the note owned?</span>
1357 <span class="sd"> owner (str): the note&#39;s owner</span>
1358 <span class="sd"> description (str): a description</span>
1359 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1360 <span class="sd"> on None, it will be created automatically.</span>
1361
1362 <span class="sd"> Returns:</span>
1363 <span class="sd"> A dictionary with the server&#39;s response.</span>
1364 <span class="sd"> &quot;&quot;&quot;</span>
1365 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1366 <span class="nb">id</span><span class="p">,</span>
1367 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1368 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1369 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1370 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1371 <span class="n">text</span><span class="o">=</span><span class="n">text</span><span class="p">,</span>
1372 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Note&quot;</span><span class="p">,</span>
1373 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1374
1375 <div class="viewcode-block" id="update_note"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_note">[docs]</a><span class="k">def</span> <span class="nf">update_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">text</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1376 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1377 <span class="sd">&quot;&quot;&quot;Updates a note.</span>
1378
1379 <span class="sd"> Args:</span>
1380 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1381 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1382 <span class="sd"> name (str): the vuln web&#39;s name</span>
1383 <span class="sd"> text (str): the note&#39;s text</span>
1384 <span class="sd"> owned (bool): is the note owned?</span>
1385 <span class="sd"> owner (str): the note&#39;s owner</span>
1386 <span class="sd"> description (str): a description</span>
1387 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1388 <span class="sd"> on None, it will be created automatically.</span>
1389
1390 <span class="sd"> Returns:</span>
1391 <span class="sd"> A dictionary with the server&#39;s response.</span>
1392 <span class="sd"> &quot;&quot;&quot;</span>
1393 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1394 <span class="nb">id</span><span class="p">,</span>
1395 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1396 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1397 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1398 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1399 <span class="n">text</span><span class="o">=</span><span class="n">text</span><span class="p">,</span>
1400 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Note&quot;</span><span class="p">,</span>
1401 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1402
1403
1404 <div class="viewcode-block" id="create_credential"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_credential">[docs]</a><span class="k">def</span> <span class="nf">create_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span>
1405 <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1406 <span class="sd">&quot;&quot;&quot;Creates a credential.</span>
1407
1408 <span class="sd"> Args:</span>
1409 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1410 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1411 <span class="sd"> name (str): the vuln web&#39;s name</span>
1412 <span class="sd"> username (str)</span>
1413 <span class="sd"> password (str)</span>
1414 <span class="sd"> owned (bool): is the note owned?</span>
1415 <span class="sd"> owner (str): the note&#39;s owner</span>
1416 <span class="sd"> description (str): a description</span>
1417 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1418 <span class="sd"> on None, it will be created automatically.</span>
1419
1420 <span class="sd"> Returns:</span>
1421 <span class="sd"> A dictionary with the server&#39;s response.</span>
1422 <span class="sd"> &quot;&quot;&quot;</span>
1423 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1424 <span class="nb">id</span><span class="p">,</span>
1425 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1426 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1427 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1428 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1429 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1430 <span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
1431 <span class="n">password</span><span class="o">=</span><span class="n">password</span><span class="p">,</span>
1432 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Credential&quot;</span><span class="p">)</span></div>
1433
1434 <div class="viewcode-block" id="update_credential"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_credential">[docs]</a><span class="k">def</span> <span class="nf">update_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span>
1435 <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1436 <span class="sd">&quot;&quot;&quot;Updates a credential.</span>
1437
1438 <span class="sd"> Args:</span>
1439 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1440 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1441 <span class="sd"> name (str): the vuln web&#39;s name</span>
1442 <span class="sd"> username (str)</span>
1443 <span class="sd"> password (str)</span>
1444 <span class="sd"> owned (bool): is the note owned?</span>
1445 <span class="sd"> owner (str): the note&#39;s owner</span>
1446 <span class="sd"> description (str): a description</span>
1447 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1448 <span class="sd"> on None, it will be created automatically.</span>
1449
1450 <span class="sd"> Returns:</span>
1451 <span class="sd"> A dictionary with the server&#39;s response.</span>
1452 <span class="sd"> &quot;&quot;&quot;</span>
1453 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1454 <span class="nb">id</span><span class="p">,</span>
1455 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1456 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1457 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1458 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1459 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1460 <span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
1461 <span class="n">password</span><span class="o">=</span><span class="n">password</span><span class="p">,</span>
1462 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Credential&quot;</span><span class="p">)</span></div>
1463
1464 <div class="viewcode-block" id="create_command"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_command">[docs]</a><span class="k">def</span> <span class="nf">create_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1465 <span class="n">ip</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">itime</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1466 <span class="sd">&quot;&quot;&quot;Creates a command.</span>
1467
1468 <span class="sd"> Args:</span>
1469 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1470 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1471 <span class="sd"> command (str): the command to be created</span>
1472 <span class="sd"> duration (str). the command&#39;s duration</span>
1473 <span class="sd"> hostname (str): the hostname where the command was executed</span>
1474 <span class="sd"> ip (str): the ip of the host where the command was executed</span>
1475 <span class="sd"> itime (str): the time it took to run</span>
1476 <span class="sd"> params (str): the parameters given</span>
1477 <span class="sd"> user (str): the user that ran the command</span>
1478
1479 <span class="sd"> Returns:</span>
1480 <span class="sd"> A dictionary with the server&#39;s response.</span>
1481 <span class="sd"> &quot;&quot;&quot;</span>
1482 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1483 <span class="nb">id</span><span class="p">,</span>
1484 <span class="n">command</span><span class="o">=</span><span class="n">command</span><span class="p">,</span>
1485 <span class="n">duration</span><span class="o">=</span><span class="n">duration</span><span class="p">,</span>
1486 <span class="n">hostname</span><span class="o">=</span><span class="n">hostname</span><span class="p">,</span>
1487 <span class="n">ip</span><span class="o">=</span><span class="n">ip</span><span class="p">,</span>
1488 <span class="n">itime</span><span class="o">=</span><span class="n">itime</span><span class="p">,</span>
1489 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1490 <span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span>
1491 <span class="n">workspace</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1492 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;CommandRunInformation&quot;</span><span class="p">)</span></div>
1493
1494 <div class="viewcode-block" id="update_command"><a class="viewcode-back" href="../../../server.html#persistence.server.server.update_command">[docs]</a><span class="k">def</span> <span class="nf">update_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1495 <span class="n">ip</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">itime</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1496 <span class="sd">&quot;&quot;&quot;Updates a command.</span>
1497
1498 <span class="sd"> Args:</span>
1499 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1500 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1501 <span class="sd"> command (str): the command to be created</span>
1502 <span class="sd"> duration (str). the command&#39;s duration</span>
1503 <span class="sd"> hostname (str): the hostname where the command was executed</span>
1504 <span class="sd"> ip (str): the ip of the host where the command was executed</span>
1505 <span class="sd"> itime (str): the time it took to run</span>
1506 <span class="sd"> params (str): the parameters given</span>
1507 <span class="sd"> user (str): the user that ran the command</span>
1508
1509 <span class="sd"> Returns:</span>
1510 <span class="sd"> A dictionary with the server&#39;s response.</span>
1511 <span class="sd"> &quot;&quot;&quot;</span>
1512 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1513 <span class="nb">id</span><span class="p">,</span>
1514 <span class="n">command</span><span class="o">=</span><span class="n">command</span><span class="p">,</span>
1515 <span class="n">duration</span><span class="o">=</span><span class="n">duration</span><span class="p">,</span>
1516 <span class="n">hostname</span><span class="o">=</span><span class="n">hostname</span><span class="p">,</span>
1517 <span class="n">ip</span><span class="o">=</span><span class="n">ip</span><span class="p">,</span>
1518 <span class="n">itime</span><span class="o">=</span><span class="n">itime</span><span class="p">,</span>
1519 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1520 <span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span>
1521 <span class="n">workspace</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1522 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;CommandRunInformation&quot;</span><span class="p">)</span></div>
1523
1524
1525 <div class="viewcode-block" id="create_workspace"><a class="viewcode-back" href="../../../server.html#persistence.server.server.create_workspace">[docs]</a><span class="k">def</span> <span class="nf">create_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">start_date</span><span class="p">,</span> <span class="n">finish_date</span><span class="p">,</span>
1526 <span class="n">customer</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1527 <span class="sd">&quot;&quot;&quot;Create a workspace.</span>
1528
1529 <span class="sd"> Args:</span>
1530 <span class="sd"> workspace_name (str): the workspace&#39;s name</span>
1531 <span class="sd"> description (str): a description for the worksapce</span>
1532 <span class="sd"> start_date (str): a date to represent when work began in the workspace</span>
1533 <span class="sd"> finish_date (str): a date to represent when work will be finished on the workspace</span>
1534 <span class="sd"> customer (str): the customer for which we are creating the workspace</span>
1535
1536 <span class="sd"> Returns:</span>
1537 <span class="sd"> A dictionary with the server&#39;s response.</span>
1538 <span class="sd"> &quot;&quot;&quot;</span>
1539 <span class="k">return</span> <span class="n">_save_db_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1540 <span class="n">name</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1541 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1542 <span class="n">customer</span><span class="o">=</span><span class="n">customer</span><span class="p">,</span>
1543 <span class="n">sdate</span><span class="o">=</span><span class="n">start_date</span><span class="p">,</span>
1544 <span class="n">fdate</span><span class="o">=</span><span class="n">finish_date</span><span class="p">,</span>
1545 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Workspace&quot;</span><span class="p">)</span></div>
1546
1547 <div class="viewcode-block" id="delete_host"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_host">[docs]</a><span class="k">def</span> <span class="nf">delete_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">):</span>
1548 <span class="sd">&quot;&quot;&quot;Delete host of id host_id from the database.&quot;&quot;&quot;</span>
1549 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">)</span></div>
1550
1551 <div class="viewcode-block" id="delete_interface"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_interface">[docs]</a><span class="k">def</span> <span class="nf">delete_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">):</span>
1552 <span class="sd">&quot;&quot;&quot;Delete interface of id interface_id from the database.&quot;&quot;&quot;</span>
1553 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">)</span></div>
1554
1555 <div class="viewcode-block" id="delete_service"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_service">[docs]</a><span class="k">def</span> <span class="nf">delete_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">):</span>
1556 <span class="sd">&quot;&quot;&quot;Delete service of id service_id from the database.&quot;&quot;&quot;</span>
1557 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">)</span></div>
1558
1559 <div class="viewcode-block" id="delete_vuln"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_vuln">[docs]</a><span class="k">def</span> <span class="nf">delete_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
1560 <span class="sd">&quot;&quot;&quot;Delete vuln of id vuln_id from the database.&quot;&quot;&quot;</span>
1561 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">)</span></div>
1562
1563 <div class="viewcode-block" id="delete_note"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_note">[docs]</a><span class="k">def</span> <span class="nf">delete_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">):</span>
1564 <span class="sd">&quot;&quot;&quot;Delete note of id note_id from the database.&quot;&quot;&quot;</span>
1565 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">)</span></div>
1566
1567 <div class="viewcode-block" id="delete_credential"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_credential">[docs]</a><span class="k">def</span> <span class="nf">delete_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">):</span>
1568 <span class="sd">&quot;&quot;&quot;Delete credential of id credential_id from the database.&quot;&quot;&quot;</span>
1569 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">)</span></div>
1570
1571 <div class="viewcode-block" id="delete_command"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_command">[docs]</a><span class="k">def</span> <span class="nf">delete_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">):</span>
1572 <span class="sd">&quot;&quot;&quot;Delete command of id command_id from the database.&quot;&quot;&quot;</span>
1573 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">)</span></div>
1574
1575 <div class="viewcode-block" id="delete_workspace"><a class="viewcode-back" href="../../../server.html#persistence.server.server.delete_workspace">[docs]</a><span class="k">def</span> <span class="nf">delete_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
1576 <span class="sd">&quot;&quot;&quot;Delete the couch database of id workspace_name&quot;&quot;&quot;</span>
1577 <span class="n">db_url</span> <span class="o">=</span> <span class="n">_create_server_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)</span>
1578 <span class="k">return</span> <span class="n">_delete</span><span class="p">(</span><span class="n">db_url</span><span class="p">,</span> <span class="n">database</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
1579
1580 <div class="viewcode-block" id="is_server_up"><a class="viewcode-back" href="../../../server.html#persistence.server.server.is_server_up">[docs]</a><span class="k">def</span> <span class="nf">is_server_up</span><span class="p">():</span>
1581 <span class="sd">&quot;&quot;&quot;Return True if we can stablish a connection with the server,</span>
1582 <span class="sd"> False otherwise.</span>
1583 <span class="sd"> &quot;&quot;&quot;</span>
1584 <span class="k">try</span><span class="p">:</span>
1585 <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/info&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">()))</span>
1586 <span class="n">is_server_up</span> <span class="o">=</span> <span class="kc">True</span>
1587 <span class="k">except</span><span class="p">:</span>
1588 <span class="n">is_server_up</span> <span class="o">=</span> <span class="kc">False</span>
1589 <span class="k">return</span> <span class="n">is_server_up</span></div>
1590
1591 <div class="viewcode-block" id="test_server_url"><a class="viewcode-back" href="../../../server.html#persistence.server.server.test_server_url">[docs]</a><span class="k">def</span> <span class="nf">test_server_url</span><span class="p">(</span><span class="n">url_to_test</span><span class="p">):</span>
1592 <span class="sd">&quot;&quot;&quot;Return True if the url_to_test is indeed a valid Faraday Server URL.</span>
1593 <span class="sd"> False otherwise.</span>
1594 <span class="sd"> &quot;&quot;&quot;</span>
1595 <span class="k">try</span><span class="p">:</span>
1596 <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/_api/info&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">url_to_test</span><span class="p">))</span>
1597 <span class="n">test_okey</span> <span class="o">=</span> <span class="kc">True</span>
1598 <span class="k">except</span><span class="p">:</span>
1599 <span class="n">test_okey</span> <span class="o">=</span> <span class="kc">False</span>
1600 <span class="k">return</span> <span class="n">test_okey</span></div>
1601 </pre></div>
1602
1603 </div>
1604 </div>
1605 <footer>
1606
1607
1608 <hr/>
1609
1610 <div role="contentinfo">
1611 <p>
1612 &copy; Copyright 2016, Infobyte.
1613
1614 </p>
1615 </div>
1616 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
1617
1618 </footer>
1619
1620 </div>
1621 </div>
1622
1623 </section>
1624
1625 </div>
1626
1627
1628
1629
1630
1631 <script type="text/javascript">
1632 var DOCUMENTATION_OPTIONS = {
1633 URL_ROOT:'../../../',
1634 VERSION:'0.1',
1635 COLLAPSE_INDEX:false,
1636 FILE_SUFFIX:'.html',
1637 HAS_SOURCE: true
1638 };
1639 </script>
1640 <script type="text/javascript" src="../../../_static/jquery.js"></script>
1641 <script type="text/javascript" src="../../../_static/underscore.js"></script>
1642 <script type="text/javascript" src="../../../_static/doctools.js"></script>
1643
1644
1645
1646
1647
1648 <script type="text/javascript" src="../../../_static/js/theme.js"></script>
1649
1650
1651
1652
1653 <script type="text/javascript">
1654 jQuery(function () {
1655 SphinxRtdTheme.StickyNav.enable();
1656 });
1657 </script>
1658
1659
1660 </body>
1661 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>server.models &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="../../genindex.html"/>
34 <link rel="search" title="Search" href="../../search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="../../index.html"/>
36 <link rel="up" title="server" href="../server.html"/>
37
38
39 <script src="../../_static/js/modernizr.min.js"></script>
40
41 </head>
42
43 <body class="wy-body-for-nav" role="document">
44
45 <div class="wy-grid-for-nav">
46
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search">
51
52
53
54 <a href="../../index.html" class="icon icon-home"> Faraday
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 0.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85 <!-- Local TOC -->
86 <div class="local-toc"></div>
87
88
89 </div>
90 </div>
91 </nav>
92
93 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
95
96 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
97 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
98 <a href="../../index.html">Faraday</a>
99 </nav>
100
101
102
103 <div class="wy-nav-content">
104 <div class="rst-content">
105
106
107
108
109
110
111 <div role="navigation" aria-label="breadcrumbs navigation">
112 <ul class="wy-breadcrumbs">
113 <li><a href="../../index.html">Docs</a> &raquo;</li>
114
115 <li><a href="../index.html">Module code</a> &raquo;</li>
116
117 <li><a href="../server.html">server</a> &raquo;</li>
118
119 <li>server.models</li>
120 <li class="wy-breadcrumbs-aside">
121
122
123
124 </li>
125 </ul>
126 <hr/>
127 </div>
128 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
129 <div itemprop="articleBody">
130
131 <h1>Source code for server.models</h1><div class="highlight"><pre>
132 <span></span><span class="c1"># Faraday Penetration Test IDE</span>
133 <span class="c1"># Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)</span>
134 <span class="c1"># See the file &#39;doc/LICENSE&#39; for the license information</span>
135
136 <span class="kn">import</span> <span class="nn">json</span>
137
138 <span class="kn">from</span> <span class="nn">sqlalchemy</span> <span class="k">import</span> <span class="n">Column</span><span class="p">,</span> <span class="n">Integer</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">Boolean</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">,</span> <span class="n">Float</span><span class="p">,</span> <span class="n">Text</span><span class="p">,</span> <span class="n">UniqueConstraint</span>
139 <span class="kn">from</span> <span class="nn">sqlalchemy.orm</span> <span class="k">import</span> <span class="n">relationship</span>
140 <span class="kn">from</span> <span class="nn">sqlalchemy.ext.declarative</span> <span class="k">import</span> <span class="n">declarative_base</span>
141
142
143 <span class="n">SCHEMA_VERSION</span> <span class="o">=</span> <span class="s1">&#39;W.2.2.0&#39;</span>
144
145 <span class="n">Base</span> <span class="o">=</span> <span class="n">declarative_base</span><span class="p">()</span>
146
147 <div class="viewcode-block" id="EntityNotFound"><a class="viewcode-back" href="../../server.html#server.models.EntityNotFound">[docs]</a><span class="k">class</span> <span class="nc">EntityNotFound</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
148 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entity_id</span><span class="p">):</span>
149 <span class="nb">super</span><span class="p">(</span><span class="n">EntityNotFound</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="s2">&quot;Entity (</span><span class="si">%s</span><span class="s2">) wasn&#39;t found&quot;</span> <span class="o">%</span> <span class="n">entity_id</span><span class="p">)</span></div>
150
151 <div class="viewcode-block" id="FaradayEntity"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity">[docs]</a><span class="k">class</span> <span class="nc">FaradayEntity</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
152 <span class="c1"># Document Types: [u&#39;Service&#39;, u&#39;Communication&#39;, u&#39;Vulnerability&#39;, u&#39;CommandRunInformation&#39;, u&#39;Reports&#39;, u&#39;Host&#39;, u&#39;Workspace&#39;, u&#39;Interface&#39;]</span>
153 <span class="nd">@classmethod</span>
154 <div class="viewcode-block" id="FaradayEntity.parse"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
155 <span class="sd">&quot;&quot;&quot;Get an instance of a DAO object given a document&quot;&quot;&quot;</span>
156 <span class="n">entity_cls</span> <span class="o">=</span> <span class="n">cls</span><span class="o">.</span><span class="n">get_entity_class_from_doc</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
157 <span class="k">if</span> <span class="n">entity_cls</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
158 <span class="n">entity</span> <span class="o">=</span> <span class="n">entity_cls</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
159 <span class="n">metadata</span> <span class="o">=</span> <span class="n">EntityMetadata</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
160 <span class="n">entity</span><span class="o">.</span><span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">metadata</span>
161 <span class="k">return</span> <span class="n">entity</span>
162 <span class="k">return</span> <span class="kc">None</span></div>
163
164 <span class="nd">@classmethod</span>
165 <div class="viewcode-block" id="FaradayEntity.get_entity_class_from_doc"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.get_entity_class_from_doc">[docs]</a> <span class="k">def</span> <span class="nf">get_entity_class_from_doc</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
166 <span class="k">return</span> <span class="n">cls</span><span class="o">.</span><span class="n">get_entity_class_from_type</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">))</span></div>
167
168 <span class="nd">@classmethod</span>
169 <div class="viewcode-block" id="FaradayEntity.get_entity_class_from_type"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.get_entity_class_from_type">[docs]</a> <span class="k">def</span> <span class="nf">get_entity_class_from_type</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">doc_type</span><span class="p">):</span>
170 <span class="k">for</span> <span class="n">entity_cls</span> <span class="ow">in</span> <span class="n">cls</span><span class="o">.</span><span class="n">__subclasses__</span><span class="p">():</span>
171 <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">entity_cls</span><span class="o">.</span><span class="n">DOC_TYPE</span><span class="p">,</span> <span class="n">basestring</span><span class="p">):</span>
172 <span class="k">if</span> <span class="n">entity_cls</span><span class="o">.</span><span class="n">DOC_TYPE</span> <span class="o">==</span> <span class="n">doc_type</span><span class="p">:</span>
173 <span class="k">return</span> <span class="n">entity_cls</span>
174 <span class="k">else</span><span class="p">:</span>
175 <span class="k">if</span> <span class="n">doc_type</span> <span class="ow">in</span> <span class="n">entity_cls</span><span class="o">.</span><span class="n">DOC_TYPE</span><span class="p">:</span>
176 <span class="k">return</span> <span class="n">entity_cls</span>
177 <span class="k">return</span> <span class="kc">None</span></div>
178
179 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
180 <span class="bp">self</span><span class="o">.</span><span class="n">update_from_document</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
181
182 <div class="viewcode-block" id="FaradayEntity.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
183 <span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">&#39;MUST IMPLEMENT&#39;</span><span class="p">)</span></div>
184
185 <div class="viewcode-block" id="FaradayEntity.add_relationships_from_dict"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.add_relationships_from_dict">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entities</span><span class="p">):</span>
186 <span class="k">pass</span></div>
187
188 <div class="viewcode-block" id="FaradayEntity.add_relationships_from_db"><a class="viewcode-back" href="../../server.html#server.models.FaradayEntity.add_relationships_from_db">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_db</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
189 <span class="k">pass</span></div></div>
190
191
192 <div class="viewcode-block" id="DatabaseMetadata"><a class="viewcode-back" href="../../server.html#server.models.DatabaseMetadata">[docs]</a><span class="k">class</span> <span class="nc">DatabaseMetadata</span><span class="p">(</span><span class="n">Base</span><span class="p">):</span>
193 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;db_metadata&#39;</span>
194 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
195 <span class="n">option</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
196 <span class="n">value</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span></div>
197
198
199 <div class="viewcode-block" id="EntityMetadata"><a class="viewcode-back" href="../../server.html#server.models.EntityMetadata">[docs]</a><span class="k">class</span> <span class="nc">EntityMetadata</span><span class="p">(</span><span class="n">Base</span><span class="p">):</span>
200 <span class="c1"># Table schema</span>
201 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;metadata&#39;</span>
202 <span class="n">__table_args__</span> <span class="o">=</span> <span class="p">(</span>
203 <span class="n">UniqueConstraint</span><span class="p">(</span><span class="s1">&#39;couchdb_id&#39;</span><span class="p">),</span>
204 <span class="p">)</span>
205
206 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
207 <span class="n">update_time</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Float</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
208 <span class="n">update_user</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
209 <span class="n">update_action</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
210 <span class="n">create_time</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Float</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
211 <span class="n">update_controller_action</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
212 <span class="n">creator</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
213 <span class="n">owner</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
214 <span class="n">command_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
215
216 <span class="n">couchdb_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
217 <span class="n">revision</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
218 <span class="n">document_type</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
219
220 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
221 <span class="bp">self</span><span class="o">.</span><span class="n">update_from_document</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
222
223 <div class="viewcode-block" id="EntityMetadata.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.EntityMetadata.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
224 <span class="n">metadata</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;metadata&#39;</span><span class="p">,</span> <span class="nb">dict</span><span class="p">())</span>
225 <span class="bp">self</span><span class="o">.</span><span class="n">update_time</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;update_time&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
226 <span class="bp">self</span><span class="o">.</span><span class="n">update_user</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;update_user&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
227 <span class="bp">self</span><span class="o">.</span><span class="n">update_action</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;update_action&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
228 <span class="bp">self</span><span class="o">.</span><span class="n">creator</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;creator&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
229 <span class="bp">self</span><span class="o">.</span><span class="n">owner</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owner&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
230 <span class="bp">self</span><span class="o">.</span><span class="n">create_time</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;create_time&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
231 <span class="bp">self</span><span class="o">.</span><span class="n">update_controller_action</span><span class="o">=</span><span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;update_controller_action&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
232 <span class="bp">self</span><span class="o">.</span><span class="n">couchdb_id</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;_id&#39;</span><span class="p">)</span>
233 <span class="bp">self</span><span class="o">.</span><span class="n">revision</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;_rev&#39;</span><span class="p">)</span>
234 <span class="bp">self</span><span class="o">.</span><span class="n">document_type</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">)</span>
235 <span class="bp">self</span><span class="o">.</span><span class="n">command_id</span> <span class="o">=</span> <span class="n">metadata</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;command_id&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
236
237 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">create_time</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
238 <span class="bp">self</span><span class="o">.</span><span class="n">create_time</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__truncate_to_epoch_in_seconds</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">create_time</span><span class="p">)</span></div>
239
240 <span class="k">def</span> <span class="nf">__truncate_to_epoch_in_seconds</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">timestamp</span><span class="p">):</span>
241 <span class="sd">&quot;&quot;&quot; In a not so elegant fashion, identifies and truncate</span>
242 <span class="sd"> epoch timestamps expressed in milliseconds to seconds&quot;&quot;&quot;</span>
243 <span class="n">limit</span> <span class="o">=</span> <span class="mi">32503680000</span> <span class="c1"># 01 Jan 3000 00:00:00 GMT</span>
244 <span class="k">if</span> <span class="n">timestamp</span> <span class="o">&gt;</span> <span class="n">limit</span><span class="p">:</span>
245 <span class="k">return</span> <span class="n">timestamp</span> <span class="o">/</span> <span class="mi">1000</span>
246 <span class="k">else</span><span class="p">:</span>
247 <span class="k">return</span> <span class="n">timestamp</span></div>
248
249
250 <div class="viewcode-block" id="Host"><a class="viewcode-back" href="../../server.html#server.models.Host">[docs]</a><span class="k">class</span> <span class="nc">Host</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
251 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;Host&#39;</span>
252
253 <span class="c1"># Table schema</span>
254 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;host&#39;</span>
255 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
256 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
257 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
258 <span class="n">os</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
259
260 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
261
262 <span class="n">default_gateway_ip</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
263 <span class="n">default_gateway_mac</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
264
265 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
266 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
267
268 <span class="n">interfaces</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Interface&#39;</span><span class="p">)</span>
269 <span class="n">services</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Service&#39;</span><span class="p">)</span>
270 <span class="n">vulnerabilities</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Vulnerability&#39;</span><span class="p">)</span>
271 <span class="n">credentials</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Credential&#39;</span><span class="p">)</span>
272
273 <div class="viewcode-block" id="Host.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Host.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
274 <span class="c1"># Ticket #3387: if the &#39;os&#39; field is None, we default to &#39;unknown&#39;</span>
275 <span class="k">if</span> <span class="ow">not</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;os&#39;</span><span class="p">):</span> <span class="n">document</span><span class="p">[</span><span class="s1">&#39;os&#39;</span><span class="p">]</span><span class="o">=</span><span class="s1">&#39;unknown&#39;</span>
276
277 <span class="n">default_gateway</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__get_default_gateway</span><span class="p">(</span><span class="n">document</span><span class="p">)</span>
278
279 <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">)</span>
280 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">)</span>
281 <span class="bp">self</span><span class="o">.</span><span class="n">os</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;os&#39;</span><span class="p">)</span>
282 <span class="bp">self</span><span class="o">.</span><span class="n">default_gateway_ip</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
283 <span class="bp">self</span><span class="o">.</span><span class="n">default_gateway_mac</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
284 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span></div>
285
286 <span class="k">def</span> <span class="nf">__get_default_gateway</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
287 <span class="n">default_gateway</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;default_gateway&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
288 <span class="k">if</span> <span class="n">default_gateway</span><span class="p">:</span>
289 <span class="k">return</span> <span class="n">default_gateway</span>
290 <span class="k">else</span><span class="p">:</span>
291 <span class="k">return</span> <span class="s1">u&#39;&#39;</span><span class="p">,</span> <span class="s1">u&#39;&#39;</span></div>
292
293
294 <div class="viewcode-block" id="Interface"><a class="viewcode-back" href="../../server.html#server.models.Interface">[docs]</a><span class="k">class</span> <span class="nc">Interface</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
295 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;Interface&#39;</span>
296
297 <span class="c1"># Table schema</span>
298 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;interface&#39;</span>
299 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
300 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
301 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
302 <span class="n">mac</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
303 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
304
305 <span class="n">hostnames</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
306 <span class="n">network_segment</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
307
308 <span class="n">ipv4_address</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
309 <span class="n">ipv4_gateway</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
310 <span class="n">ipv4_dns</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
311 <span class="n">ipv4_mask</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
312
313 <span class="n">ipv6_address</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
314 <span class="n">ipv6_gateway</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
315 <span class="n">ipv6_dns</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
316 <span class="n">ipv6_prefix</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
317
318 <span class="n">ports_filtered</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">)</span>
319 <span class="n">ports_opened</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">)</span>
320 <span class="n">ports_closed</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">)</span>
321
322 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
323 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
324
325 <span class="n">host_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Host</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
326 <span class="n">host</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Host&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;interfaces&#39;</span><span class="p">)</span>
327
328 <span class="n">services</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Service&#39;</span><span class="p">)</span>
329
330 <div class="viewcode-block" id="Interface.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Interface.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
331 <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">)</span>
332 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">)</span>
333 <span class="bp">self</span><span class="o">.</span><span class="n">mac</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;mac&#39;</span><span class="p">)</span>
334 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
335 <span class="bp">self</span><span class="o">.</span><span class="n">hostnames</span><span class="o">=</span><span class="s1">u&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;hostnames&#39;</span><span class="p">))</span>
336 <span class="bp">self</span><span class="o">.</span><span class="n">network_segment</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;network_segment&#39;</span><span class="p">)</span>
337 <span class="bp">self</span><span class="o">.</span><span class="n">ipv4_address</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv4&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;address&#39;</span><span class="p">)</span>
338 <span class="bp">self</span><span class="o">.</span><span class="n">ipv4_gateway</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv4&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;gateway&#39;</span><span class="p">)</span>
339 <span class="bp">self</span><span class="o">.</span><span class="n">ipv4_dns</span><span class="o">=</span><span class="s1">u&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv4&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;DNS&#39;</span><span class="p">))</span>
340 <span class="bp">self</span><span class="o">.</span><span class="n">ipv4_mask</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv4&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;mask&#39;</span><span class="p">)</span>
341 <span class="bp">self</span><span class="o">.</span><span class="n">ipv6_address</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv6&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;address&#39;</span><span class="p">)</span>
342 <span class="bp">self</span><span class="o">.</span><span class="n">ipv6_gateway</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv6&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;gateway&#39;</span><span class="p">)</span>
343 <span class="bp">self</span><span class="o">.</span><span class="n">ipv6_dns</span><span class="o">=</span><span class="s1">u&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv6&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;DNS&#39;</span><span class="p">))</span>
344 <span class="bp">self</span><span class="o">.</span><span class="n">ipv6_prefix</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ipv6&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;prefix&#39;</span><span class="p">))</span>
345 <span class="bp">self</span><span class="o">.</span><span class="n">ports_filtered</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">,{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;filtered&#39;</span><span class="p">)</span>
346 <span class="bp">self</span><span class="o">.</span><span class="n">ports_opened</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">,{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;opened&#39;</span><span class="p">)</span>
347 <span class="bp">self</span><span class="o">.</span><span class="n">ports_closed</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">,{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;closed&#39;</span><span class="p">)</span></div>
348
349 <div class="viewcode-block" id="Interface.add_relationships_from_dict"><a class="viewcode-back" href="../../server.html#server.models.Interface.add_relationships_from_dict">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entities</span><span class="p">):</span>
350 <span class="n">host_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
351 <span class="k">if</span> <span class="n">host_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
352 <span class="k">raise</span> <span class="n">EntityNotFound</span><span class="p">(</span><span class="n">host_id</span><span class="p">)</span>
353 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">entities</span><span class="p">[</span><span class="n">host_id</span><span class="p">]</span></div>
354
355 <div class="viewcode-block" id="Interface.add_relationships_from_db"><a class="viewcode-back" href="../../server.html#server.models.Interface.add_relationships_from_db">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_db</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
356 <span class="n">host_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
357 <span class="n">query</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">Host</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">couchdb_id</span> <span class="o">==</span> <span class="n">host_id</span><span class="p">)</span>
358 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">query</span><span class="o">.</span><span class="n">one</span><span class="p">()</span></div></div>
359
360 <div class="viewcode-block" id="Service"><a class="viewcode-back" href="../../server.html#server.models.Service">[docs]</a><span class="k">class</span> <span class="nc">Service</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
361 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;Service&#39;</span>
362
363 <span class="c1"># Table schema</span>
364 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;service&#39;</span>
365 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
366 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
367 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
368 <span class="n">ports</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
369 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
370
371 <span class="n">protocol</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
372 <span class="n">status</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
373 <span class="n">version</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
374
375 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
376 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
377
378 <span class="n">host_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Host</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
379 <span class="n">host</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Host&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;services&#39;</span><span class="p">)</span>
380
381 <span class="n">interface_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Interface</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
382 <span class="n">interface</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Interface&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;services&#39;</span><span class="p">)</span>
383
384 <span class="n">vulnerabilities</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Vulnerability&#39;</span><span class="p">)</span>
385 <span class="n">credentials</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Credential&#39;</span><span class="p">)</span>
386
387 <div class="viewcode-block" id="Service.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Service.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
388 <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">)</span>
389 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">)</span>
390 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
391 <span class="bp">self</span><span class="o">.</span><span class="n">protocol</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;protocol&#39;</span><span class="p">)</span>
392 <span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;status&#39;</span><span class="p">)</span>
393 <span class="bp">self</span><span class="o">.</span><span class="n">version</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;version&#39;</span><span class="p">)</span>
394
395 <span class="c1"># We found workspaces where ports are defined as an integer</span>
396 <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">),</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">long</span><span class="p">)):</span>
397 <span class="bp">self</span><span class="o">.</span><span class="n">ports</span> <span class="o">=</span> <span class="nb">str</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">))</span>
398 <span class="k">else</span><span class="p">:</span>
399 <span class="bp">self</span><span class="o">.</span><span class="n">ports</span> <span class="o">=</span> <span class="s1">u&#39;,&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="nb">str</span><span class="p">,</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ports&#39;</span><span class="p">)))</span></div>
400
401 <div class="viewcode-block" id="Service.add_relationships_from_dict"><a class="viewcode-back" href="../../server.html#server.models.Service.add_relationships_from_dict">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entities</span><span class="p">):</span>
402 <span class="n">couchdb_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span>
403
404 <span class="n">host_id</span> <span class="o">=</span> <span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
405 <span class="k">if</span> <span class="n">host_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
406 <span class="k">raise</span> <span class="n">EntityNotFound</span><span class="p">(</span><span class="n">host_id</span><span class="p">)</span>
407 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">entities</span><span class="p">[</span><span class="n">host_id</span><span class="p">]</span>
408
409 <span class="n">interface_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
410 <span class="k">if</span> <span class="n">interface_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
411 <span class="k">raise</span> <span class="n">EntityNotFound</span><span class="p">(</span><span class="n">interface_id</span><span class="p">)</span>
412 <span class="bp">self</span><span class="o">.</span><span class="n">interface</span> <span class="o">=</span> <span class="n">entities</span><span class="p">[</span><span class="n">interface_id</span><span class="p">]</span></div>
413
414 <div class="viewcode-block" id="Service.add_relationships_from_db"><a class="viewcode-back" href="../../server.html#server.models.Service.add_relationships_from_db">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_db</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
415 <span class="n">couchdb_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span>
416 <span class="n">host_id</span> <span class="o">=</span> <span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
417 <span class="n">query</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">Host</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">couchdb_id</span> <span class="o">==</span> <span class="n">host_id</span><span class="p">)</span>
418 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">query</span><span class="o">.</span><span class="n">one</span><span class="p">()</span>
419
420 <span class="n">interface_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
421 <span class="n">query</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">Interface</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">couchdb_id</span> <span class="o">==</span> <span class="n">interface_id</span><span class="p">)</span>
422 <span class="bp">self</span><span class="o">.</span><span class="n">interface</span> <span class="o">=</span> <span class="n">query</span><span class="o">.</span><span class="n">one</span><span class="p">()</span></div></div>
423
424
425 <div class="viewcode-block" id="Vulnerability"><a class="viewcode-back" href="../../server.html#server.models.Vulnerability">[docs]</a><span class="k">class</span> <span class="nc">Vulnerability</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
426 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vulnerability&#39;</span><span class="p">,</span> <span class="s1">&#39;VulnerabilityWeb&#39;</span><span class="p">]</span>
427
428 <span class="c1"># Table schema</span>
429 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;vulnerability&#39;</span>
430 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
431 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
432 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
433
434 <span class="n">confirmed</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
435 <span class="n">vuln_type</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
436 <span class="n">data</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
437 <span class="n">easeofresolution</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">50</span><span class="p">))</span>
438 <span class="n">refs</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
439 <span class="n">resolution</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
440 <span class="n">severity</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">50</span><span class="p">))</span>
441 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
442 <span class="n">attachments</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
443
444 <span class="n">impact_accountability</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
445 <span class="n">impact_availability</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
446 <span class="n">impact_confidentiality</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
447 <span class="n">impact_integrity</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
448
449 <span class="n">method</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">50</span><span class="p">))</span>
450 <span class="n">params</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">500</span><span class="p">))</span>
451 <span class="n">path</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">500</span><span class="p">))</span>
452 <span class="n">pname</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
453 <span class="n">query</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
454 <span class="n">request</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
455 <span class="n">response</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">())</span>
456 <span class="n">website</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
457
458 <span class="n">status</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">))</span>
459
460 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
461 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
462
463 <span class="n">host_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Host</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
464 <span class="n">host</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Host&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;vulnerabilities&#39;</span><span class="p">)</span>
465
466 <span class="n">service_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Service</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
467 <span class="n">service</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Service&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;vulnerabilities&#39;</span><span class="p">)</span>
468
469 <div class="viewcode-block" id="Vulnerability.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Vulnerability.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
470 <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">)</span>
471 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;desc&#39;</span><span class="p">)</span>
472 <span class="bp">self</span><span class="o">.</span><span class="n">confirmed</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;confirmed&#39;</span><span class="p">)</span>
473 <span class="bp">self</span><span class="o">.</span><span class="n">vuln_type</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">)</span>
474 <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;data&#39;</span><span class="p">)</span>
475 <span class="bp">self</span><span class="o">.</span><span class="n">easeofresolution</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;easeofresolution&#39;</span><span class="p">)</span>
476 <span class="bp">self</span><span class="o">.</span><span class="n">refs</span><span class="o">=</span><span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;refs&#39;</span><span class="p">,</span> <span class="p">[]))</span>
477 <span class="bp">self</span><span class="o">.</span><span class="n">resolution</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;resolution&#39;</span><span class="p">)</span>
478 <span class="bp">self</span><span class="o">.</span><span class="n">severity</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;severity&#39;</span><span class="p">)</span>
479 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
480 <span class="bp">self</span><span class="o">.</span><span class="n">attachments</span> <span class="o">=</span> <span class="n">json</span><span class="o">.</span><span class="n">dumps</span><span class="p">(</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;_attachments&#39;</span><span class="p">,</span> <span class="p">{}))</span>
481 <span class="bp">self</span><span class="o">.</span><span class="n">impact_accountability</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;impact&#39;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;accountability&#39;</span><span class="p">)</span>
482 <span class="bp">self</span><span class="o">.</span><span class="n">impact_availability</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;impact&#39;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;availability&#39;</span><span class="p">)</span>
483 <span class="bp">self</span><span class="o">.</span><span class="n">impact_confidentiality</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;impact&#39;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;confidentiality&#39;</span><span class="p">)</span>
484 <span class="bp">self</span><span class="o">.</span><span class="n">impact_integrity</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;impact&#39;</span><span class="p">,</span> <span class="p">{})</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;integrity&#39;</span><span class="p">)</span>
485 <span class="bp">self</span><span class="o">.</span><span class="n">method</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;method&#39;</span><span class="p">)</span>
486 <span class="bp">self</span><span class="o">.</span><span class="n">path</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;path&#39;</span><span class="p">)</span>
487 <span class="bp">self</span><span class="o">.</span><span class="n">pname</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;pname&#39;</span><span class="p">)</span>
488 <span class="bp">self</span><span class="o">.</span><span class="n">query</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;query&#39;</span><span class="p">)</span>
489 <span class="bp">self</span><span class="o">.</span><span class="n">request</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;request&#39;</span><span class="p">)</span>
490 <span class="bp">self</span><span class="o">.</span><span class="n">response</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;response&#39;</span><span class="p">)</span>
491 <span class="bp">self</span><span class="o">.</span><span class="n">website</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;website&#39;</span><span class="p">)</span>
492 <span class="bp">self</span><span class="o">.</span><span class="n">status</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;status&#39;</span><span class="p">,</span> <span class="s1">&#39;opened&#39;</span><span class="p">)</span>
493
494 <span class="n">params</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;params&#39;</span><span class="p">,</span> <span class="s1">u&#39;&#39;</span><span class="p">)</span>
495 <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">params</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">)):</span>
496 <span class="bp">self</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="p">(</span><span class="s1">u&#39; &#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">params</span><span class="p">))</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
497 <span class="k">else</span><span class="p">:</span>
498 <span class="bp">self</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="n">params</span> <span class="k">if</span> <span class="n">params</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="s1">u&#39;&#39;</span></div>
499
500 <div class="viewcode-block" id="Vulnerability.add_relationships_from_dict"><a class="viewcode-back" href="../../server.html#server.models.Vulnerability.add_relationships_from_dict">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_dict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">entities</span><span class="p">):</span>
501 <span class="n">couchdb_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span>
502 <span class="n">host_id</span> <span class="o">=</span> <span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
503 <span class="k">if</span> <span class="n">host_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
504 <span class="k">raise</span> <span class="n">EntityNotFound</span><span class="p">(</span><span class="n">host_id</span><span class="p">)</span>
505 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">entities</span><span class="p">[</span><span class="n">host_id</span><span class="p">]</span>
506
507 <span class="n">parent_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
508 <span class="k">if</span> <span class="n">parent_id</span> <span class="o">!=</span> <span class="n">host_id</span><span class="p">:</span>
509 <span class="k">if</span> <span class="n">parent_id</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">entities</span><span class="p">:</span>
510 <span class="k">raise</span> <span class="n">EntityNotFound</span><span class="p">(</span><span class="n">parent_id</span><span class="p">)</span>
511 <span class="bp">self</span><span class="o">.</span><span class="n">service</span> <span class="o">=</span> <span class="n">entities</span><span class="p">[</span><span class="n">parent_id</span><span class="p">]</span></div>
512
513 <div class="viewcode-block" id="Vulnerability.add_relationships_from_db"><a class="viewcode-back" href="../../server.html#server.models.Vulnerability.add_relationships_from_db">[docs]</a> <span class="k">def</span> <span class="nf">add_relationships_from_db</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
514 <span class="n">couchdb_id</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">entity_metadata</span><span class="o">.</span><span class="n">couchdb_id</span>
515 <span class="n">host_id</span> <span class="o">=</span> <span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
516 <span class="n">query</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">Host</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">couchdb_id</span> <span class="o">==</span> <span class="n">host_id</span><span class="p">)</span>
517 <span class="bp">self</span><span class="o">.</span><span class="n">host</span> <span class="o">=</span> <span class="n">query</span><span class="o">.</span><span class="n">one</span><span class="p">()</span>
518
519 <span class="n">parent_id</span> <span class="o">=</span> <span class="s1">&#39;.&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">couchdb_id</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">)[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
520 <span class="k">if</span> <span class="n">parent_id</span> <span class="o">!=</span> <span class="n">host_id</span><span class="p">:</span>
521 <span class="n">query</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">query</span><span class="p">(</span><span class="n">Service</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">)</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">couchdb_id</span> <span class="o">==</span> <span class="n">parent_id</span><span class="p">)</span>
522 <span class="bp">self</span><span class="o">.</span><span class="n">service</span> <span class="o">=</span> <span class="n">query</span><span class="o">.</span><span class="n">one</span><span class="p">()</span></div></div>
523
524 <div class="viewcode-block" id="Note"><a class="viewcode-back" href="../../server.html#server.models.Note">[docs]</a><span class="k">class</span> <span class="nc">Note</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
525 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;Note&#39;</span>
526
527 <span class="c1"># Table schema</span>
528 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;note&#39;</span>
529 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
530 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
531 <span class="n">text</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
532 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
533 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
534
535 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
536 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
537
538 <div class="viewcode-block" id="Note.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Note.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
539 <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">)</span>
540 <span class="bp">self</span><span class="o">.</span><span class="n">text</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;text&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
541 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
542 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span></div></div>
543
544 <div class="viewcode-block" id="Credential"><a class="viewcode-back" href="../../server.html#server.models.Credential">[docs]</a><span class="k">class</span> <span class="nc">Credential</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
545 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;Cred&#39;</span>
546
547 <span class="c1"># Table schema</span>
548 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;credential&#39;</span>
549 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
550 <span class="n">username</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
551 <span class="n">password</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
552 <span class="n">owned</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Boolean</span><span class="p">)</span>
553 <span class="n">description</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Text</span><span class="p">(),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
554 <span class="n">name</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
555
556 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
557 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
558
559 <span class="n">host_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Host</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
560 <span class="n">host</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Host&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;credentials&#39;</span><span class="p">)</span>
561
562 <span class="n">service_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">Service</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
563 <span class="n">service</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="s1">&#39;Service&#39;</span><span class="p">,</span> <span class="n">back_populates</span><span class="o">=</span><span class="s1">&#39;credentials&#39;</span><span class="p">)</span>
564
565 <div class="viewcode-block" id="Credential.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Credential.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
566 <span class="bp">self</span><span class="o">.</span><span class="n">username</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;username&#39;</span><span class="p">)</span>
567 <span class="bp">self</span><span class="o">.</span><span class="n">password</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;password&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
568 <span class="bp">self</span><span class="o">.</span><span class="n">owned</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;owned&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
569 <span class="bp">self</span><span class="o">.</span><span class="n">description</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;description&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">)</span>
570 <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;name&#39;</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span></div></div>
571
572 <div class="viewcode-block" id="Command"><a class="viewcode-back" href="../../server.html#server.models.Command">[docs]</a><span class="k">class</span> <span class="nc">Command</span><span class="p">(</span><span class="n">FaradayEntity</span><span class="p">,</span> <span class="n">Base</span><span class="p">):</span>
573 <span class="n">DOC_TYPE</span> <span class="o">=</span> <span class="s1">&#39;CommandRunInformation&#39;</span>
574
575 <span class="c1"># Table schema</span>
576 <span class="n">__tablename__</span> <span class="o">=</span> <span class="s1">&#39;command&#39;</span>
577 <span class="nb">id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">primary_key</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
578 <span class="n">command</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
579 <span class="n">duration</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Float</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
580 <span class="n">itime</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Float</span><span class="p">,</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
581 <span class="n">ip</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
582 <span class="n">hostname</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
583 <span class="n">params</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
584 <span class="n">user</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
585 <span class="n">workspace</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">String</span><span class="p">(</span><span class="mi">250</span><span class="p">),</span> <span class="n">nullable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
586
587
588 <span class="n">entity_metadata</span> <span class="o">=</span> <span class="n">relationship</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="p">,</span> <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">cascade</span><span class="o">=</span><span class="s2">&quot;all, delete-orphan&quot;</span><span class="p">,</span> <span class="n">single_parent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
589 <span class="n">entity_metadata_id</span> <span class="o">=</span> <span class="n">Column</span><span class="p">(</span><span class="n">Integer</span><span class="p">,</span> <span class="n">ForeignKey</span><span class="p">(</span><span class="n">EntityMetadata</span><span class="o">.</span><span class="n">id</span><span class="p">),</span> <span class="n">index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
590
591 <div class="viewcode-block" id="Command.update_from_document"><a class="viewcode-back" href="../../server.html#server.models.Command.update_from_document">[docs]</a> <span class="k">def</span> <span class="nf">update_from_document</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">document</span><span class="p">):</span>
592 <span class="bp">self</span><span class="o">.</span><span class="n">command</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;command&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
593 <span class="bp">self</span><span class="o">.</span><span class="n">duration</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;duration&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
594 <span class="bp">self</span><span class="o">.</span><span class="n">itime</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;itime&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
595 <span class="bp">self</span><span class="o">.</span><span class="n">ip</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;ip&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
596 <span class="bp">self</span><span class="o">.</span><span class="n">hostname</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;hostname&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
597 <span class="bp">self</span><span class="o">.</span><span class="n">params</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;params&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
598 <span class="bp">self</span><span class="o">.</span><span class="n">user</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;user&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
599 <span class="bp">self</span><span class="o">.</span><span class="n">workspace</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;workspace&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span></div></div>
600
601 </pre></div>
602
603 </div>
604 </div>
605 <footer>
606
607
608 <hr/>
609
610 <div role="contentinfo">
611 <p>
612 &copy; Copyright 2016, Infobyte.
613
614 </p>
615 </div>
616 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
617
618 </footer>
619
620 </div>
621 </div>
622
623 </section>
624
625 </div>
626
627
628
629
630
631 <script type="text/javascript">
632 var DOCUMENTATION_OPTIONS = {
633 URL_ROOT:'../../',
634 VERSION:'0.1',
635 COLLAPSE_INDEX:false,
636 FILE_SUFFIX:'.html',
637 HAS_SOURCE: true
638 };
639 </script>
640 <script type="text/javascript" src="../../_static/jquery.js"></script>
641 <script type="text/javascript" src="../../_static/underscore.js"></script>
642 <script type="text/javascript" src="../../_static/doctools.js"></script>
643
644
645
646
647
648 <script type="text/javascript" src="../../_static/js/theme.js"></script>
649
650
651
652
653 <script type="text/javascript">
654 jQuery(function () {
655 SphinxRtdTheme.StickyNav.enable();
656 });
657 </script>
658
659
660 </body>
661 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>server &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="../genindex.html"/>
34 <link rel="search" title="Search" href="../search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="../index.html"/>
36 <link rel="up" title="Module code" href="index.html"/>
37
38
39 <script src="../_static/js/modernizr.min.js"></script>
40
41 </head>
42
43 <body class="wy-body-for-nav" role="document">
44
45 <div class="wy-grid-for-nav">
46
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search">
51
52
53
54 <a href="../index.html" class="icon icon-home"> Faraday
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 0.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85 <!-- Local TOC -->
86 <div class="local-toc"></div>
87
88
89 </div>
90 </div>
91 </nav>
92
93 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
95
96 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
97 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
98 <a href="../index.html">Faraday</a>
99 </nav>
100
101
102
103 <div class="wy-nav-content">
104 <div class="rst-content">
105
106
107
108
109
110
111 <div role="navigation" aria-label="breadcrumbs navigation">
112 <ul class="wy-breadcrumbs">
113 <li><a href="../index.html">Docs</a> &raquo;</li>
114
115 <li><a href="index.html">Module code</a> &raquo;</li>
116
117 <li>server</li>
118 <li class="wy-breadcrumbs-aside">
119
120
121
122 </li>
123 </ul>
124 <hr/>
125 </div>
126 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
127 <div itemprop="articleBody">
128
129 <h1>Source code for server</h1><div class="highlight"><pre>
130 <span></span><span class="ch">#!/usr/bin/python2.7</span>
131 <span class="c1"># -*- coding: utf-8 -*-</span>
132 <span class="sd">&#39;&#39;&#39;</span>
133 <span class="sd">Faraday Penetration Test IDE</span>
134 <span class="sd">Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)</span>
135 <span class="sd">See the file &#39;doc/LICENSE&#39; for the license information</span>
136
137 <span class="sd">&#39;&#39;&#39;</span>
138 <span class="kn">import</span> <span class="nn">requests</span>
139 <span class="kn">import</span> <span class="nn">json</span>
140 <span class="kn">from</span> <span class="nn">persistence.server.utils</span> <span class="k">import</span> <span class="n">force_unique</span>
141 <span class="kn">from</span> <span class="nn">persistence.server.server_io_exceptions</span> <span class="k">import</span> <span class="p">(</span><span class="n">WrongObjectSignature</span><span class="p">,</span>
142 <span class="n">CantCommunicateWithServerError</span><span class="p">,</span>
143 <span class="n">ConflictInDatabase</span><span class="p">,</span>
144 <span class="n">ResourceDoesNotExist</span><span class="p">,</span>
145 <span class="n">Unauthorized</span><span class="p">,</span>
146 <span class="n">MoreThanOneObjectFoundByID</span><span class="p">)</span>
147
148 <span class="kn">from</span> <span class="nn">persistence.server.changes_stream</span> <span class="k">import</span> <span class="n">CouchChangesStream</span>
149
150 <span class="c1"># NOTE: Change is you want to use this module by itself.</span>
151 <span class="c1"># If FARADAY_UP is False, SERVER_URL must be a valid faraday server url</span>
152 <span class="n">FARADAY_UP</span> <span class="o">=</span> <span class="kc">True</span>
153 <span class="n">SERVER_URL</span> <span class="o">=</span> <span class="s2">&quot;http://127.0.0.1:5984&quot;</span>
154
155 <span class="k">def</span> <span class="nf">_conf</span><span class="p">():</span>
156 <span class="kn">from</span> <span class="nn">config.configuration</span> <span class="k">import</span> <span class="n">getInstanceConfiguration</span>
157 <span class="n">CONF</span> <span class="o">=</span> <span class="n">getInstanceConfiguration</span><span class="p">()</span>
158 <span class="k">return</span> <span class="n">CONF</span>
159
160 <span class="k">def</span> <span class="nf">_get_base_server_url</span><span class="p">():</span>
161 <span class="k">if</span> <span class="n">FARADAY_UP</span><span class="p">:</span>
162 <span class="n">server_url</span> <span class="o">=</span> <span class="n">_conf</span><span class="p">()</span><span class="o">.</span><span class="n">getCouchURI</span><span class="p">()</span>
163 <span class="k">else</span><span class="p">:</span>
164 <span class="n">server_url</span> <span class="o">=</span> <span class="n">SERVER_URL</span>
165 <span class="k">return</span> <span class="n">server_url</span>
166
167
168 <span class="k">def</span> <span class="nf">_create_server_api_url</span><span class="p">():</span>
169 <span class="sd">&quot;&quot;&quot;Return the server&#39;s api url.&quot;&quot;&quot;</span>
170 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/_api&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_get_base_server_url</span><span class="p">())</span>
171
172 <span class="k">def</span> <span class="nf">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_name</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
173 <span class="sd">&quot;&quot;&quot;Creates a url to get from the server. Takes the workspace name</span>
174 <span class="sd"> as a string, an object_name paramter which is the object you want to</span>
175 <span class="sd"> query as a string (&#39;hosts&#39;, &#39;interfaces&#39;, etc) .</span>
176
177 <span class="sd"> object_name may be None if you want to get the workspace itself.</span>
178
179 <span class="sd"> Return the get_url as a string.</span>
180 <span class="sd"> &quot;&quot;&quot;</span>
181 <span class="n">object_name</span> <span class="o">=</span> <span class="s2">&quot;/</span><span class="si">{0}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">object_name</span><span class="p">)</span> <span class="k">if</span> <span class="n">object_name</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
182 <span class="n">get_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}{2}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">(),</span>
183 <span class="n">workspace_name</span><span class="p">,</span>
184 <span class="n">object_name</span><span class="p">)</span>
185 <span class="k">return</span> <span class="n">get_url</span>
186
187
188 <span class="k">def</span> <span class="nf">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
189 <span class="n">server_api_url</span> <span class="o">=</span> <span class="n">_create_server_api_url</span><span class="p">()</span>
190 <span class="n">post_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}</span><span class="s1">/doc/</span><span class="si">{2}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_api_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
191 <span class="k">return</span> <span class="n">post_url</span>
192
193
194 <span class="k">def</span> <span class="nf">_create_server_delete_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
195 <span class="k">return</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
196
197 <span class="c1"># XXX: COUCH IT!</span>
198 <span class="k">def</span> <span class="nf">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
199 <span class="n">server_url</span> <span class="o">=</span> <span class="n">_get_base_server_url</span><span class="p">()</span>
200 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/</span><span class="si">{1}</span><span class="s2">/</span><span class="si">{2}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
201
202
203 <span class="c1"># XXX: COUCH IT!</span>
204 <span class="k">def</span> <span class="nf">_create_couch_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
205 <span class="k">return</span> <span class="n">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
206
207
208 <span class="c1"># XXX: COUCH IT!</span>
209 <span class="k">def</span> <span class="nf">_create_couch_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
210 <span class="n">server_base_url</span> <span class="o">=</span> <span class="n">_get_base_server_url</span><span class="p">()</span>
211 <span class="n">db_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/</span><span class="si">{1}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_base_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">)</span>
212 <span class="k">return</span> <span class="n">db_url</span>
213
214 <span class="k">def</span> <span class="nf">_create_server_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
215 <span class="n">server_api_url</span> <span class="o">=</span> <span class="n">_create_server_api_url</span><span class="p">()</span>
216 <span class="n">db_url</span> <span class="o">=</span> <span class="s1">&#39;</span><span class="si">{0}</span><span class="s1">/ws/</span><span class="si">{1}</span><span class="s1">&#39;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">server_api_url</span><span class="p">,</span> <span class="n">workspace_name</span><span class="p">)</span>
217 <span class="k">return</span> <span class="n">db_url</span>
218
219 <span class="k">def</span> <span class="nf">_unsafe_io_with_server</span><span class="p">(</span><span class="n">server_io_function</span><span class="p">,</span> <span class="n">server_expected_response</span><span class="p">,</span>
220 <span class="n">server_url</span><span class="p">,</span> <span class="o">**</span><span class="n">payload</span><span class="p">):</span>
221 <span class="sd">&quot;&quot;&quot;A wrapper for functions which deals with I/O to or from the server.</span>
222 <span class="sd"> It calls the server_io_function with url server_url and the payload,</span>
223 <span class="sd"> raising an CantCommunicateWithServerError if the response wasn&#39;t</span>
224 <span class="sd"> server_expected_response or if there was a Connection Error.</span>
225
226 <span class="sd"> Return the response from the server.</span>
227 <span class="sd"> &quot;&quot;&quot;</span>
228 <span class="k">try</span><span class="p">:</span>
229 <span class="n">answer</span> <span class="o">=</span> <span class="n">server_io_function</span><span class="p">(</span><span class="n">server_url</span><span class="p">,</span> <span class="o">**</span><span class="n">payload</span><span class="p">)</span>
230 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">409</span> <span class="ow">and</span> <span class="n">answer</span><span class="o">.</span><span class="n">json</span><span class="p">()[</span><span class="s1">&#39;error&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;conflict&#39;</span><span class="p">:</span>
231 <span class="k">raise</span> <span class="n">ConflictInDatabase</span><span class="p">(</span><span class="n">answer</span><span class="p">)</span>
232 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">404</span><span class="p">:</span>
233 <span class="k">raise</span> <span class="n">ResourceDoesNotExist</span><span class="p">(</span><span class="n">server_url</span><span class="p">)</span>
234 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">403</span> <span class="ow">or</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">==</span> <span class="mi">401</span><span class="p">:</span>
235 <span class="k">raise</span> <span class="n">Unauthorized</span><span class="p">(</span><span class="n">answer</span><span class="p">)</span>
236 <span class="k">if</span> <span class="n">answer</span><span class="o">.</span><span class="n">status_code</span> <span class="o">!=</span> <span class="n">server_expected_response</span><span class="p">:</span>
237 <span class="k">raise</span> <span class="n">requests</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RequestException</span><span class="p">(</span><span class="n">response</span><span class="o">=</span><span class="n">answer</span><span class="p">)</span>
238 <span class="k">except</span> <span class="n">requests</span><span class="o">.</span><span class="n">exceptions</span><span class="o">.</span><span class="n">RequestException</span><span class="p">:</span>
239 <span class="k">raise</span> <span class="n">CantCommunicateWithServerError</span><span class="p">(</span><span class="n">server_io_function</span><span class="p">,</span> <span class="n">server_url</span><span class="p">,</span> <span class="n">payload</span><span class="p">)</span>
240 <span class="k">return</span> <span class="n">answer</span>
241
242
243 <span class="k">def</span> <span class="nf">_parse_json</span><span class="p">(</span><span class="n">response_object</span><span class="p">):</span>
244 <span class="sd">&quot;&quot;&quot;Takes a response object and return its response as a dictionary.&quot;&quot;&quot;</span>
245 <span class="k">try</span><span class="p">:</span>
246 <span class="k">return</span> <span class="n">response_object</span><span class="o">.</span><span class="n">json</span><span class="p">()</span>
247 <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
248 <span class="k">return</span> <span class="p">{}</span>
249
250
251 <span class="k">def</span> <span class="nf">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
252 <span class="sd">&quot;&quot;&quot;Get from the request_url. Takes an arbitrary number of parameters</span>
253 <span class="sd"> to customize the request_url if necessary.</span>
254
255 <span class="sd"> Will raise a CantCommunicateWithServerError if requests cant stablish</span>
256 <span class="sd"> connection to server or if response is not equal to 200.</span>
257
258 <span class="sd"> Return a dictionary with the information in the json.</span>
259 <span class="sd"> &quot;&quot;&quot;</span>
260 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">,</span>
261 <span class="mi">200</span><span class="p">,</span>
262 <span class="n">request_url</span><span class="p">,</span>
263 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
264
265 <span class="k">def</span> <span class="nf">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">201</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
266 <span class="sd">&quot;&quot;&quot;Put to the post_url. If update is True, try to get the object</span>
267 <span class="sd"> revision first so as to update the object in Couch. You can</span>
268 <span class="sd"> customize the expected response (it should be 201, but Couchdbkit returns</span>
269 <span class="sd"> 200, so...). Also take an arbitrary number of parameters to put into the</span>
270 <span class="sd"> post_url.</span>
271
272 <span class="sd"> Will raise a CantCommunicateWithServerError if requests cant stablish</span>
273 <span class="sd"> connection to server or if response is not equal to 201.</span>
274
275 <span class="sd"> Return a dictionary with the response from couchdb, which looks like this:</span>
276 <span class="sd"> {u&#39;id&#39;: u&#39;61&#39;, u&#39;ok&#39;: True, u&#39;rev&#39;: u&#39;1-967a00dff5e02add41819138abb3284d&#39;}</span>
277 <span class="sd"> &quot;&quot;&quot;</span>
278 <span class="k">if</span> <span class="n">update</span><span class="p">:</span>
279 <span class="n">last_rev</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">post_url</span><span class="p">)[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span>
280 <span class="n">params</span><span class="p">[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">last_rev</span>
281 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">put</span><span class="p">,</span>
282 <span class="n">expected_response</span><span class="p">,</span>
283 <span class="n">post_url</span><span class="p">,</span>
284 <span class="n">json</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
285
286
287 <span class="k">def</span> <span class="nf">_delete</span><span class="p">(</span><span class="n">delete_url</span><span class="p">,</span> <span class="n">database</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
288 <span class="sd">&quot;&quot;&quot;Deletes the object on delete_url. If you&#39;re deleting a database,</span>
289 <span class="sd"> specify the database parameter to True&quot;&quot;&quot;</span>
290 <span class="n">params</span> <span class="o">=</span> <span class="p">{}</span>
291 <span class="k">if</span> <span class="ow">not</span> <span class="n">database</span><span class="p">:</span>
292 <span class="n">last_rev</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">delete_url</span><span class="p">)[</span><span class="s1">&#39;_rev&#39;</span><span class="p">]</span>
293 <span class="n">params</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;rev&#39;</span><span class="p">:</span> <span class="n">last_rev</span><span class="p">}</span>
294 <span class="k">return</span> <span class="n">_parse_json</span><span class="p">(</span><span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">delete</span><span class="p">,</span>
295 <span class="mi">200</span><span class="p">,</span>
296 <span class="n">delete_url</span><span class="p">,</span>
297 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">))</span>
298
299
300 <span class="k">def</span> <span class="nf">_get_raw_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
301 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
302 <span class="sd"> a dictionary with the hosts table.&quot;&quot;&quot;</span>
303 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;hosts&#39;</span><span class="p">)</span>
304 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
305
306
307 <span class="k">def</span> <span class="nf">_get_raw_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
308 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
309 <span class="sd"> a dictionary with the vulns table.&quot;&quot;&quot;</span>
310 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;vulns&#39;</span><span class="p">)</span>
311 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
312
313
314 <span class="k">def</span> <span class="nf">_get_raw_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
315 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
316 <span class="sd"> a dictionary with the interfaces table.&quot;&quot;&quot;</span>
317 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;interfaces&#39;</span><span class="p">)</span>
318 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
319
320
321 <span class="k">def</span> <span class="nf">_get_raw_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
322 <span class="sd">&quot;&quot;&quot;Take a workspace_name and an arbitrary number of params and return</span>
323 <span class="sd"> a dictionary with the services table.&quot;&quot;&quot;</span>
324 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;services&#39;</span><span class="p">)</span>
325 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
326
327
328 <span class="k">def</span> <span class="nf">_get_raw_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
329 <span class="sd">&quot;&quot;&quot;Take a workspace name and an arbitrary number of params and</span>
330 <span class="sd"> return a dictionary with the notes table.&quot;&quot;&quot;</span>
331 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;notes&#39;</span><span class="p">)</span>
332 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
333
334
335 <span class="k">def</span> <span class="nf">_get_raw_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
336 <span class="sd">&quot;&quot;&quot;Take a workspace name and an arbitrary number of params and</span>
337 <span class="sd"> return a dictionary with the credentials table.&quot;&quot;&quot;</span>
338 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;credentials&#39;</span><span class="p">)</span>
339 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
340
341
342 <span class="k">def</span> <span class="nf">_get_raw_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
343 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;commands&#39;</span><span class="p">)</span>
344 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
345
346
347 <span class="k">def</span> <span class="nf">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
348 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;summary&#39;</span><span class="p">)</span>
349 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">)</span>
350
351 <span class="c1"># XXX: COUCH IT!</span>
352 <span class="k">def</span> <span class="nf">_save_to_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
353 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_couch_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
354 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
355
356 <span class="c1"># XXX: COUCH IT!</span>
357 <span class="k">def</span> <span class="nf">_update_in_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
358 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
359 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
360
361 <span class="k">def</span> <span class="nf">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
362 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
363 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
364
365 <span class="k">def</span> <span class="nf">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
366 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_post_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
367 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">update</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
368
369 <span class="k">def</span> <span class="nf">_save_db_to_server</span><span class="p">(</span><span class="n">db_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
370 <span class="n">post_url</span> <span class="o">=</span> <span class="n">_create_server_db_url</span><span class="p">(</span><span class="n">db_name</span><span class="p">)</span>
371 <span class="k">return</span> <span class="n">_put</span><span class="p">(</span><span class="n">post_url</span><span class="p">,</span> <span class="n">expected_response</span><span class="o">=</span><span class="mi">200</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
372
373 <span class="c1"># XXX: SEMI COUCH IT!</span>
374 <span class="k">def</span> <span class="nf">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">):</span>
375 <span class="n">delete_url</span> <span class="o">=</span> <span class="n">_create_server_delete_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_id</span><span class="p">)</span>
376 <span class="k">return</span> <span class="n">_delete</span><span class="p">(</span><span class="n">delete_url</span><span class="p">)</span>
377
378 <span class="c1"># XXX: COUCH IT!</span>
379 <span class="k">def</span> <span class="nf">_couch_changes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
380 <span class="k">return</span> <span class="n">CouchChangesStream</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
381 <span class="n">_create_couch_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">),</span>
382 <span class="o">**</span><span class="n">params</span><span class="p">)</span>
383
384
385 <span class="k">def</span> <span class="nf">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">faraday_object_name</span><span class="p">,</span>
386 <span class="n">faraday_object_row_name</span><span class="p">,</span> <span class="n">full_table</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
387 <span class="o">**</span><span class="n">params</span><span class="p">):</span>
388 <span class="sd">&quot;&quot;&quot;Takes a workspace_name (str), a faraday_object_name (str),</span>
389 <span class="sd"> a faraday_object_row_name (str) and an arbitrary number of params.</span>
390 <span class="sd"> Return a list of dictionaries that hold the information for the objects</span>
391 <span class="sd"> in table faraday_object_name.</span>
392
393 <span class="sd"> The full_table paramether may be used to get the full dictionary instead</span>
394 <span class="sd"> of just the one inside the &#39;value&#39; key which holds information about the</span>
395 <span class="sd"> object.</span>
396
397 <span class="sd"> Preconditions:</span>
398 <span class="sd"> faraday_object_name == &#39;host&#39;, &#39;vuln&#39;, &#39;interface&#39;, &#39;service&#39;, &#39;note&#39;</span>
399 <span class="sd"> or &#39;credential&#39;</span>
400
401 <span class="sd"> faraday_object_row_name must be the key to the dictionary which holds</span>
402 <span class="sd"> the information of the object per se in the table. most times this is &#39;rows&#39;</span>
403 <span class="sd"> &quot;&quot;&quot;</span>
404 <span class="n">object_to_func</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;hosts&#39;</span><span class="p">:</span> <span class="n">_get_raw_hosts</span><span class="p">,</span>
405 <span class="s1">&#39;vulns&#39;</span><span class="p">:</span> <span class="n">_get_raw_vulns</span><span class="p">,</span>
406 <span class="s1">&#39;interfaces&#39;</span><span class="p">:</span> <span class="n">_get_raw_interfaces</span><span class="p">,</span>
407 <span class="s1">&#39;services&#39;</span><span class="p">:</span> <span class="n">_get_raw_services</span><span class="p">,</span>
408 <span class="s1">&#39;notes&#39;</span><span class="p">:</span> <span class="n">_get_raw_notes</span><span class="p">,</span>
409 <span class="s1">&#39;credentials&#39;</span><span class="p">:</span> <span class="n">_get_raw_credentials</span><span class="p">,</span>
410 <span class="s1">&#39;commands&#39;</span><span class="p">:</span> <span class="n">_get_raw_commands</span><span class="p">}</span>
411
412 <span class="n">appropiate_function</span> <span class="o">=</span> <span class="n">object_to_func</span><span class="p">[</span><span class="n">faraday_object_name</span><span class="p">]</span>
413 <span class="n">appropiate_dictionary</span> <span class="o">=</span> <span class="n">appropiate_function</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span>
414 <span class="n">faraday_ready_dictionaries</span> <span class="o">=</span> <span class="p">[]</span>
415 <span class="k">if</span> <span class="n">appropiate_dictionary</span><span class="p">:</span>
416 <span class="k">for</span> <span class="n">raw_dictionary</span> <span class="ow">in</span> <span class="n">appropiate_dictionary</span><span class="p">[</span><span class="n">faraday_object_row_name</span><span class="p">]:</span>
417 <span class="k">if</span> <span class="ow">not</span> <span class="n">full_table</span><span class="p">:</span>
418 <span class="n">faraday_ready_dictionaries</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">raw_dictionary</span><span class="p">[</span><span class="s1">&#39;value&#39;</span><span class="p">])</span>
419 <span class="k">else</span><span class="p">:</span>
420 <span class="n">faraday_ready_dictionaries</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">raw_dictionary</span><span class="p">)</span>
421 <span class="k">return</span> <span class="n">faraday_ready_dictionaries</span>
422
423
424 <div class="viewcode-block" id="get_hosts"><a class="viewcode-back" href="../server.html#server.get_hosts">[docs]</a><span class="k">def</span> <span class="nf">get_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
425 <span class="sd">&quot;&quot;&quot;Get hosts from the server.</span>
426
427 <span class="sd"> Args:</span>
428 <span class="sd"> workspace_name (str): the workspace from which to get the hosts.</span>
429 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
430
431 <span class="sd"> Returns:</span>
432 <span class="sd"> A dictionary containing the hosts matching the query.</span>
433 <span class="sd"> &quot;&quot;&quot;</span>
434 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;hosts&#39;</span><span class="p">,</span>
435 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
436
437
438 <div class="viewcode-block" id="get_all_vulns"><a class="viewcode-back" href="../server.html#server.get_all_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
439 <span class="sd">&quot;&quot;&quot;Get vulns, both normal and web, from the server.</span>
440
441 <span class="sd"> Args:</span>
442 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
443 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
444
445 <span class="sd"> Returns:</span>
446 <span class="sd"> A dictionary containing the vulns matching the query.</span>
447 <span class="sd"> &quot;&quot;&quot;</span>
448 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;vulns&#39;</span><span class="p">,</span>
449 <span class="s1">&#39;vulnerabilities&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
450
451
452 <div class="viewcode-block" id="get_vulns"><a class="viewcode-back" href="../server.html#server.get_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
453 <span class="sd">&quot;&quot;&quot;Get only normal vulns from the server.</span>
454
455 <span class="sd"> Args:</span>
456 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
457 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
458
459 <span class="sd"> Returns:</span>
460 <span class="sd"> A dictionary containing the vulns matching the query.</span>
461 <span class="sd"> &quot;&quot;&quot;</span>
462 <span class="k">return</span> <span class="n">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;Vulnerability&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
463
464
465 <div class="viewcode-block" id="get_web_vulns"><a class="viewcode-back" href="../server.html#server.get_web_vulns">[docs]</a><span class="k">def</span> <span class="nf">get_web_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
466 <span class="sd">&quot;&quot;&quot;Get only web vulns from the server.</span>
467
468 <span class="sd"> Args:</span>
469 <span class="sd"> workspace_name (str): the workspace from which to get the vulns.</span>
470 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
471
472 <span class="sd"> Returns:</span>
473 <span class="sd"> A dictionary containing the vulns matching the query.</span>
474 <span class="sd"> &quot;&quot;&quot;</span>
475 <span class="k">return</span> <span class="n">get_all_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;VulnerabilityWeb&quot;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
476
477 <div class="viewcode-block" id="get_interfaces"><a class="viewcode-back" href="../server.html#server.get_interfaces">[docs]</a><span class="k">def</span> <span class="nf">get_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
478 <span class="sd">&quot;&quot;&quot;Get interfaces from the server.</span>
479
480 <span class="sd"> Args:</span>
481 <span class="sd"> workspace_name (str): the workspace from which to get the interfaces.</span>
482 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
483
484 <span class="sd"> Returns:</span>
485 <span class="sd"> A dictionary containing the interfaces matching the query.</span>
486 <span class="sd"> &quot;&quot;&quot;</span>
487 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;interfaces&#39;</span><span class="p">,</span>
488 <span class="s1">&#39;interfaces&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
489
490 <div class="viewcode-block" id="get_services"><a class="viewcode-back" href="../server.html#server.get_services">[docs]</a><span class="k">def</span> <span class="nf">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
491 <span class="sd">&quot;&quot;&quot;Get services from the server.</span>
492
493 <span class="sd"> Args:</span>
494 <span class="sd"> workspace_name (str): the workspace from which to get the services.</span>
495 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
496
497 <span class="sd"> Returns:</span>
498 <span class="sd"> A dictionary containing the services matching the query.</span>
499 <span class="sd"> &quot;&quot;&quot;</span>
500 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;services&#39;</span><span class="p">,</span>
501 <span class="s1">&#39;services&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
502
503 <div class="viewcode-block" id="get_credentials"><a class="viewcode-back" href="../server.html#server.get_credentials">[docs]</a><span class="k">def</span> <span class="nf">get_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
504 <span class="sd">&quot;&quot;&quot;Get credentials from the server.</span>
505
506 <span class="sd"> Args:</span>
507 <span class="sd"> workspace_name (str): the workspace from which to get the credentials.</span>
508 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
509
510 <span class="sd"> Returns:</span>
511 <span class="sd"> A dictionary containing the credentials matching the query.</span>
512 <span class="sd"> &quot;&quot;&quot;</span>
513 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;credentials&#39;</span><span class="p">,</span>
514 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
515
516 <div class="viewcode-block" id="get_notes"><a class="viewcode-back" href="../server.html#server.get_notes">[docs]</a><span class="k">def</span> <span class="nf">get_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
517 <span class="sd">&quot;&quot;&quot;Get notes from the server.</span>
518
519 <span class="sd"> Args:</span>
520 <span class="sd"> workspace_name (str): the workspace from which to get the notes.</span>
521 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
522
523 <span class="sd"> Returns:</span>
524 <span class="sd"> A dictionary containing the notes matching the query.</span>
525 <span class="sd"> &quot;&quot;&quot;</span>
526 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;notes&#39;</span><span class="p">,</span>
527 <span class="s1">&#39;rows&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
528
529 <div class="viewcode-block" id="get_commands"><a class="viewcode-back" href="../server.html#server.get_commands">[docs]</a><span class="k">def</span> <span class="nf">get_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
530 <span class="sd">&quot;&quot;&quot;Get commands from the server.</span>
531
532 <span class="sd"> Args:</span>
533 <span class="sd"> workspace_name (str): the workspace from which to get the commands.</span>
534 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
535
536 <span class="sd"> Returns:</span>
537 <span class="sd"> A dictionary containing the commands matching the query.</span>
538 <span class="sd"> &quot;&quot;&quot;</span>
539 <span class="k">return</span> <span class="n">_get_faraday_ready_dictionaries</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="s1">&#39;commands&#39;</span><span class="p">,</span>
540 <span class="s1">&#39;commands&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
541
542 <div class="viewcode-block" id="get_objects"><a class="viewcode-back" href="../server.html#server.get_objects">[docs]</a><span class="k">def</span> <span class="nf">get_objects</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
543 <span class="sd">&quot;&quot;&quot;Get any type of object from the server, be it hosts, vulns, interfaces,</span>
544 <span class="sd"> services, credentials, commands or notes.</span>
545
546 <span class="sd"> Args:</span>
547 <span class="sd"> workspace_name (str): the workspace from which to get the commands.</span>
548 <span class="sd"> object_signature (str): the type of object to get. Must equal &#39;hosts&#39;,</span>
549 <span class="sd"> &#39;vulns&#39;, &#39;interfaces&#39;, &#39;services&#39;, &#39;credentials&#39;, &#39;notes&#39; or &#39;commands&#39;</span>
550 <span class="sd"> **params: any of valid request parameters for CouchDB.</span>
551
552 <span class="sd"> Returns:</span>
553 <span class="sd"> A dictionary containing the commands matching the query.</span>
554
555 <span class="sd"> Raises:</span>
556 <span class="sd"> WrongObjectSignature: if the object_signature string didn&#39;t match</span>
557 <span class="sd"> a faraday object.</span>
558 <span class="sd"> &quot;&quot;&quot;</span>
559 <span class="n">object_to_func</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;hosts&#39;</span><span class="p">:</span> <span class="n">get_hosts</span><span class="p">,</span>
560 <span class="s1">&#39;vulns&#39;</span><span class="p">:</span> <span class="n">get_vulns</span><span class="p">,</span>
561 <span class="s1">&#39;interfaces&#39;</span><span class="p">:</span> <span class="n">get_interfaces</span><span class="p">,</span>
562 <span class="s1">&#39;services&#39;</span><span class="p">:</span> <span class="n">get_services</span><span class="p">,</span>
563 <span class="s1">&#39;credentials&#39;</span><span class="p">:</span> <span class="n">get_credentials</span><span class="p">,</span>
564 <span class="s1">&#39;notes&#39;</span><span class="p">:</span> <span class="n">get_notes</span><span class="p">,</span>
565 <span class="s1">&#39;commands&#39;</span><span class="p">:</span> <span class="n">get_commands</span><span class="p">}</span>
566 <span class="k">try</span><span class="p">:</span>
567 <span class="n">appropiate_function</span> <span class="o">=</span> <span class="n">object_to_func</span><span class="p">[</span><span class="n">object_signature</span><span class="p">]</span>
568 <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
569 <span class="k">raise</span> <span class="n">WrongObjectSignature</span><span class="p">(</span><span class="n">object_signature</span><span class="p">)</span>
570
571 <span class="k">return</span> <span class="n">appropiate_function</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
572
573 <span class="c1"># cha cha cha chaaaanges!</span>
574 <div class="viewcode-block" id="get_changes_stream"><a class="viewcode-back" href="../server.html#server.get_changes_stream">[docs]</a><span class="k">def</span> <span class="nf">get_changes_stream</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">since</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">heartbeat</span><span class="o">=</span><span class="s1">&#39;1000&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_params</span><span class="p">):</span>
575 <span class="k">return</span> <span class="n">_couch_changes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">since</span><span class="o">=</span><span class="n">since</span><span class="p">,</span> <span class="n">feed</span><span class="o">=</span><span class="s1">&#39;continuous&#39;</span><span class="p">,</span>
576 <span class="n">heartbeat</span><span class="o">=</span><span class="n">heartbeat</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_params</span><span class="p">)</span></div>
577
578 <div class="viewcode-block" id="get_workspaces_names"><a class="viewcode-back" href="../server.html#server.get_workspaces_names">[docs]</a><span class="k">def</span> <span class="nf">get_workspaces_names</span><span class="p">():</span>
579 <span class="sd">&quot;&quot;&quot;Returns:</span>
580 <span class="sd"> A dictionary with a list with the workspaces names.&quot;&quot;&quot;</span>
581 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/ws&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">()))</span></div>
582
583 <span class="c1"># XXX: COUCH IT!</span>
584 <span class="k">def</span> <span class="nf">_clean_up_stupid_couch_response</span><span class="p">(</span><span class="n">response_string</span><span class="p">):</span>
585 <span class="sd">&quot;&quot;&quot;Couch likes to give invalid jsons as a response :). So nice.&quot;&quot;&quot;</span>
586 <span class="n">interesting_part</span> <span class="o">=</span> <span class="s2">&quot;{&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">response_string</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;{&quot;</span><span class="p">)[</span><span class="mi">1</span><span class="p">:])</span>
587 <span class="n">almost_there</span> <span class="o">=</span> <span class="n">interesting_part</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;}&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
588 <span class="n">ok_yeah</span> <span class="o">=</span> <span class="s2">&quot;}&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">almost_there</span><span class="p">)</span>
589 <span class="n">hopefully_valid_json</span> <span class="o">=</span> <span class="s2">&quot;{{</span><span class="si">{0}</span><span class="s2">}}&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">ok_yeah</span><span class="p">)</span>
590 <span class="k">return</span> <span class="n">json</span><span class="o">.</span><span class="n">loads</span><span class="p">(</span><span class="n">hopefully_valid_json</span><span class="p">)</span>
591
592 <span class="c1"># XXX: COUCH IT!</span>
593 <span class="c1"># COUCH IT LEVEL: REVOLUTIONS</span>
594 <div class="viewcode-block" id="get_object_before_last_revision"><a class="viewcode-back" href="../server.html#server.get_object_before_last_revision">[docs]</a><span class="k">def</span> <span class="nf">get_object_before_last_revision</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
595 <span class="sd">&quot;&quot;&quot;Get an object before its last revision. Useful to get information about</span>
596 <span class="sd"> recently deleted objects.</span>
597
598 <span class="sd"> Warning:</span>
599 <span class="sd"> Error-pronce process. You should check for &#39;None&#39; after usage,</span>
600 <span class="sd"> as that&#39;s the return value if any problem arose during execution.</span>
601
602 <span class="sd"> Args:</span>
603 <span class="sd"> workspace_name (str): the workspace where the object was</span>
604 <span class="sd"> object_id (str): the id of the object</span>
605
606 <span class="sd"> Returns:</span>
607 <span class="sd"> A dictionary with the object&#39;s information.</span>
608 <span class="sd"> &quot;&quot;&quot;</span>
609 <span class="n">get_url</span> <span class="o">=</span> <span class="n">_create_couch_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_id</span><span class="p">)</span>
610 <span class="n">response</span> <span class="o">=</span> <span class="n">_unsafe_io_with_server</span><span class="p">(</span><span class="n">requests</span><span class="o">.</span><span class="n">get</span><span class="p">,</span> <span class="mi">200</span><span class="p">,</span> <span class="n">get_url</span><span class="p">,</span>
611 <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;revs&#39;</span><span class="p">:</span> <span class="s1">&#39;true&#39;</span><span class="p">,</span> <span class="s1">&#39;open_revs&#39;</span><span class="p">:</span> <span class="s1">&#39;all&#39;</span><span class="p">})</span>
612 <span class="k">try</span><span class="p">:</span>
613 <span class="n">valid_json_response</span> <span class="o">=</span> <span class="n">_clean_up_stupid_couch_response</span><span class="p">(</span><span class="n">response</span><span class="o">.</span><span class="n">text</span><span class="p">)</span>
614 <span class="k">except</span> <span class="ne">ValueError</span><span class="p">:</span>
615 <span class="k">return</span> <span class="kc">None</span>
616 <span class="k">try</span><span class="p">:</span>
617 <span class="n">id_before_del</span> <span class="o">=</span> <span class="n">valid_json_response</span><span class="p">[</span><span class="s1">&#39;_revisions&#39;</span><span class="p">][</span><span class="s1">&#39;ids&#39;</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span>
618 <span class="n">new_number_for_rev</span> <span class="o">=</span> <span class="n">valid_json_response</span><span class="p">[</span><span class="s1">&#39;_revisions&#39;</span><span class="p">][</span><span class="s1">&#39;start&#39;</span><span class="p">]</span> <span class="o">-</span> <span class="mi">1</span>
619 <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span> <span class="c1"># one if never too safe when you call a function called &quot;_clean_up_stupid_couch_response&quot;</span>
620 <span class="k">return</span> <span class="kc">None</span>
621
622 <span class="n">rev_id_before_del</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">-</span><span class="si">{1}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">new_number_for_rev</span><span class="p">,</span> <span class="n">id_before_del</span><span class="p">)</span>
623 <span class="n">object_dict</span> <span class="o">=</span> <span class="n">_get</span><span class="p">(</span><span class="n">get_url</span><span class="p">,</span> <span class="n">rev</span><span class="o">=</span><span class="n">rev_id_before_del</span><span class="p">)</span>
624 <span class="k">return</span> <span class="n">object_dict</span></div>
625
626
627 <div class="viewcode-block" id="get_object"><a class="viewcode-back" href="../server.html#server.get_object">[docs]</a><span class="k">def</span> <span class="nf">get_object</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="n">object_id</span><span class="p">):</span>
628 <span class="sd">&quot;&quot;&quot;Get an unique object of arbitrary type.</span>
629
630 <span class="sd"> Args:</span>
631 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
632 <span class="sd"> object_signature (str): must be either &#39;hosts&#39;, &#39;vulns&#39;, &#39;interfaces&#39;</span>
633 <span class="sd"> &#39;services&#39;, &#39;credentials&#39;, &#39;notes&#39; or &#39;commands&#39;.</span>
634 <span class="sd"> object_id (str): the id of the object</span>
635
636 <span class="sd"> Returns:</span>
637 <span class="sd"> A dictionary containing information about the object.</span>
638
639 <span class="sd"> Raises:</span>
640 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the object_id is shared</span>
641 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
642 <span class="sd"> contact Infobyte LCC.</span>
643 <span class="sd"> &quot;&quot;&quot;</span>
644 <span class="n">objects</span> <span class="o">=</span> <span class="n">get_objects</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">object_signature</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">object_id</span><span class="p">)</span>
645 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">objects</span><span class="p">)</span></div>
646
647 <div class="viewcode-block" id="get_host"><a class="viewcode-back" href="../server.html#server.get_host">[docs]</a><span class="k">def</span> <span class="nf">get_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">):</span>
648 <span class="sd">&quot;&quot;&quot;Get an unique host.</span>
649
650 <span class="sd"> Args:</span>
651 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
652 <span class="sd"> host_id (str): the id of the host</span>
653
654 <span class="sd"> Returns:</span>
655 <span class="sd"> A dictionary containing information about the host.</span>
656
657 <span class="sd"> Raises:</span>
658 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the host id is shared</span>
659 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
660 <span class="sd"> contact Infobyte LCC.</span>
661 <span class="sd"> &quot;&quot;&quot;</span>
662 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_hosts</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">host_id</span><span class="p">))</span></div>
663
664 <div class="viewcode-block" id="get_vuln"><a class="viewcode-back" href="../server.html#server.get_vuln">[docs]</a><span class="k">def</span> <span class="nf">get_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
665 <span class="sd">&quot;&quot;&quot;Get an unique vuln.</span>
666
667 <span class="sd"> Args:</span>
668 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
669 <span class="sd"> vuln_id (str): the id of the vuln</span>
670
671 <span class="sd"> Returns:</span>
672 <span class="sd"> A dictionary containing information about the vuln.</span>
673
674 <span class="sd"> Raises:</span>
675 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the vuln id is shared</span>
676 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
677 <span class="sd"> contact Infobyte LCC.</span>
678 <span class="sd"> &quot;&quot;&quot;</span>
679 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">vuln_id</span><span class="p">))</span></div>
680
681 <div class="viewcode-block" id="get_web_vuln"><a class="viewcode-back" href="../server.html#server.get_web_vuln">[docs]</a><span class="k">def</span> <span class="nf">get_web_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
682 <span class="sd">&quot;&quot;&quot;Get an unique web vuln.</span>
683
684 <span class="sd"> Args:</span>
685 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
686 <span class="sd"> web vuln_id (str): the id of the web vuln</span>
687
688 <span class="sd"> Returns:</span>
689 <span class="sd"> A dictionary containing information about the web vuln.</span>
690
691 <span class="sd"> Raises:</span>
692 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the web vuln id is shared</span>
693 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
694 <span class="sd"> contact Infobyte LCC.</span>
695 <span class="sd"> &quot;&quot;&quot;</span>
696 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_web_vulns</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">vuln_id</span><span class="p">))</span></div>
697
698 <div class="viewcode-block" id="get_interface"><a class="viewcode-back" href="../server.html#server.get_interface">[docs]</a><span class="k">def</span> <span class="nf">get_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">):</span>
699 <span class="sd">&quot;&quot;&quot;Get an unique interface.</span>
700
701 <span class="sd"> Args:</span>
702 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
703 <span class="sd"> interface_id (str): the id of the interface</span>
704
705 <span class="sd"> Returns:</span>
706 <span class="sd"> A dictionary containing information about the interface.</span>
707
708 <span class="sd"> Raises:</span>
709 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the interface id is shared</span>
710 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
711 <span class="sd"> contact Infobyte LCC.</span>
712 <span class="sd"> &quot;&quot;&quot;</span>
713 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_interfaces</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">interface_id</span><span class="p">))</span></div>
714
715 <div class="viewcode-block" id="get_service"><a class="viewcode-back" href="../server.html#server.get_service">[docs]</a><span class="k">def</span> <span class="nf">get_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">):</span>
716 <span class="sd">&quot;&quot;&quot;Get an unique service.</span>
717
718 <span class="sd"> Args:</span>
719 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
720 <span class="sd"> service_id (str): the id of the service</span>
721
722 <span class="sd"> Returns:</span>
723 <span class="sd"> A dictionary containing information about the service.</span>
724
725 <span class="sd"> Raises:</span>
726 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the service id is shared</span>
727 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
728 <span class="sd"> contact Infobyte LCC.</span>
729 <span class="sd"> &quot;&quot;&quot;</span>
730 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">service_id</span><span class="p">))</span></div>
731
732 <div class="viewcode-block" id="get_note"><a class="viewcode-back" href="../server.html#server.get_note">[docs]</a><span class="k">def</span> <span class="nf">get_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">):</span>
733 <span class="sd">&quot;&quot;&quot;Get an unique note.</span>
734
735 <span class="sd"> Args:</span>
736 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
737 <span class="sd"> note_id (str): the id of the note</span>
738
739 <span class="sd"> Returns:</span>
740 <span class="sd"> A dictionary containing information about the note.</span>
741
742 <span class="sd"> Raises:</span>
743 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the note id is shared</span>
744 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
745 <span class="sd"> contact Infobyte LCC.</span>
746 <span class="sd"> &quot;&quot;&quot;</span>
747 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_notes</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">note_id</span><span class="p">))</span></div>
748
749 <div class="viewcode-block" id="get_credential"><a class="viewcode-back" href="../server.html#server.get_credential">[docs]</a><span class="k">def</span> <span class="nf">get_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">):</span>
750 <span class="sd">&quot;&quot;&quot;Get an unique credential.</span>
751
752 <span class="sd"> Args:</span>
753 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
754 <span class="sd"> credential_id (str): the id of the credential</span>
755
756 <span class="sd"> Returns:</span>
757 <span class="sd"> A dictionary containing information about the credential.</span>
758
759 <span class="sd"> Raises:</span>
760 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the credential id is shared</span>
761 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
762 <span class="sd"> contact Infobyte LCC.</span>
763 <span class="sd"> &quot;&quot;&quot;</span>
764 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_services</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">credential_id</span><span class="p">))</span></div>
765
766 <div class="viewcode-block" id="get_command"><a class="viewcode-back" href="../server.html#server.get_command">[docs]</a><span class="k">def</span> <span class="nf">get_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">):</span>
767 <span class="sd">&quot;&quot;&quot;Get an unique command.</span>
768
769 <span class="sd"> Args:</span>
770 <span class="sd"> workspace_name (str): the workspace where the object should be found.</span>
771 <span class="sd"> command_id (str): the id of the command</span>
772
773 <span class="sd"> Returns:</span>
774 <span class="sd"> A dictionary containing information about the command.</span>
775
776 <span class="sd"> Raises:</span>
777 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the command id is shared</span>
778 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
779 <span class="sd"> contact Infobyte LCC.</span>
780 <span class="sd"> &quot;&quot;&quot;</span>
781 <span class="k">return</span> <span class="n">force_unique</span><span class="p">(</span><span class="n">get_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">couchid</span><span class="o">=</span><span class="n">command_id</span><span class="p">))</span></div>
782
783 <div class="viewcode-block" id="get_workspace"><a class="viewcode-back" href="../server.html#server.get_workspace">[docs]</a><span class="k">def</span> <span class="nf">get_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
784 <span class="sd">&quot;&quot;&quot;Get an unique command.</span>
785
786 <span class="sd"> Args:</span>
787 <span class="sd"> command_name (str): the command where the object should be found.</span>
788 <span class="sd"> command_id (str): the id of the command</span>
789
790 <span class="sd"> Returns:</span>
791 <span class="sd"> A dictionary containing information about the command.</span>
792
793 <span class="sd"> Raises:</span>
794 <span class="sd"> MoreThanOneObjectFoundByID: if for some reason the command id is shared</span>
795 <span class="sd"> by two or more objects. This should never happen. If it does,</span>
796 <span class="sd"> contact Infobyte LCC.</span>
797 <span class="sd"> &quot;&quot;&quot;</span>
798 <span class="n">request_url</span> <span class="o">=</span> <span class="n">_create_server_get_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)</span>
799 <span class="k">return</span> <span class="n">_get</span><span class="p">(</span><span class="n">request_url</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">)</span></div>
800
801 <div class="viewcode-block" id="get_workspace_summary"><a class="viewcode-back" href="../server.html#server.get_workspace_summary">[docs]</a><span class="k">def</span> <span class="nf">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
802 <span class="sd">&quot;&quot;&quot;Get a collection of data about the workspace.</span>
803
804 <span class="sd"> Args:</span>
805 <span class="sd"> workspace_name (str): the workspace to get the stats from.</span>
806
807 <span class="sd"> Returns:</span>
808 <span class="sd"> A dictionary with the workspace&#39;s information</span>
809 <span class="sd"> &quot;&quot;&quot;</span>
810 <span class="k">return</span> <span class="n">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;stats&#39;</span><span class="p">]</span></div>
811
812 <div class="viewcode-block" id="get_workspace_numbers"><a class="viewcode-back" href="../server.html#server.get_workspace_numbers">[docs]</a><span class="k">def</span> <span class="nf">get_workspace_numbers</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
813 <span class="sd">&quot;&quot;&quot;Get the number of hosts, interfaces, services and vulns in the workspace.</span>
814
815 <span class="sd"> Args:</span>
816 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
817
818 <span class="sd"> Return:</span>
819 <span class="sd"> A tuple of 4 elements with the amounts of hosts, interfaces, services and vulns.</span>
820 <span class="sd"> &quot;&quot;&quot;</span>
821 <span class="n">stats</span> <span class="o">=</span> <span class="n">_get_raw_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;stats&#39;</span><span class="p">]</span>
822 <span class="k">return</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;hosts&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;services&#39;</span><span class="p">],</span> <span class="n">stats</span><span class="p">[</span><span class="s1">&#39;total_vulns&#39;</span><span class="p">]</span></div>
823
824 <div class="viewcode-block" id="get_hosts_number"><a class="viewcode-back" href="../server.html#server.get_hosts_number">[docs]</a><span class="k">def</span> <span class="nf">get_hosts_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
825 <span class="sd">&quot;&quot;&quot;</span>
826 <span class="sd"> Args:</span>
827 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
828 <span class="sd"> **params: any of the Couchdb request parameters</span>
829
830 <span class="sd"> Returns:</span>
831 <span class="sd"> The amount of hosts in the workspace as an integer.</span>
832 <span class="sd"> &quot;&quot;&quot;</span>
833 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;hosts&#39;</span><span class="p">])</span></div>
834
835 <div class="viewcode-block" id="get_services_number"><a class="viewcode-back" href="../server.html#server.get_services_number">[docs]</a><span class="k">def</span> <span class="nf">get_services_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
836 <span class="sd">&quot;&quot;&quot;</span>
837 <span class="sd"> Args:</span>
838 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
839 <span class="sd"> **params: any of the Couchdb request parameters</span>
840
841 <span class="sd"> Returns:</span>
842 <span class="sd"> The amount of services in the workspace as an integer.</span>
843 <span class="sd"> &quot;&quot;&quot;</span>
844 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">])</span></div>
845
846 <div class="viewcode-block" id="get_interfaces_number"><a class="viewcode-back" href="../server.html#server.get_interfaces_number">[docs]</a><span class="k">def</span> <span class="nf">get_interfaces_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
847 <span class="sd">&quot;&quot;&quot;</span>
848 <span class="sd"> Args:</span>
849 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
850 <span class="sd"> **params: any of the Couchdb request parameters</span>
851
852 <span class="sd"> Returns:</span>
853 <span class="sd"> The amount of interfaces in the workspace as an integer.</span>
854 <span class="sd"> &quot;&quot;&quot;</span>
855 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;interfaces&#39;</span><span class="p">])</span></div>
856
857 <div class="viewcode-block" id="get_vulns_number"><a class="viewcode-back" href="../server.html#server.get_vulns_number">[docs]</a><span class="k">def</span> <span class="nf">get_vulns_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
858 <span class="sd">&quot;&quot;&quot;</span>
859 <span class="sd"> Args:</span>
860 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
861 <span class="sd"> **params: any of the Couchdb request parameters</span>
862
863 <span class="sd"> Returns:</span>
864 <span class="sd"> The amount of vulns in the workspace as an integer.</span>
865 <span class="sd"> &quot;&quot;&quot;</span>
866 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;total_vulns&#39;</span><span class="p">])</span></div>
867
868 <div class="viewcode-block" id="get_notes_number"><a class="viewcode-back" href="../server.html#server.get_notes_number">[docs]</a><span class="k">def</span> <span class="nf">get_notes_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
869 <span class="sd">&quot;&quot;&quot;</span>
870 <span class="sd"> Args:</span>
871 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
872 <span class="sd"> **params: any of the Couchdb request parameters</span>
873
874 <span class="sd"> Returns:</span>
875 <span class="sd"> The amount of notes in the workspace as an integer.</span>
876 <span class="sd"> &quot;&quot;&quot;</span>
877 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">get_workspace_summary</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)[</span><span class="s1">&#39;notes&#39;</span><span class="p">])</span></div>
878
879 <div class="viewcode-block" id="get_credentials_number"><a class="viewcode-back" href="../server.html#server.get_credentials_number">[docs]</a><span class="k">def</span> <span class="nf">get_credentials_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
880 <span class="sd">&quot;&quot;&quot;</span>
881 <span class="sd"> Args:</span>
882 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
883 <span class="sd"> **params: any of the Couchdb request parameters</span>
884
885 <span class="sd"> Returns:</span>
886 <span class="sd"> The amount of credentials in the workspace as an integer.</span>
887 <span class="sd"> &quot;&quot;&quot;</span>
888 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">_get_raw_credentials</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">))</span></div>
889
890 <div class="viewcode-block" id="get_commands_number"><a class="viewcode-back" href="../server.html#server.get_commands_number">[docs]</a><span class="k">def</span> <span class="nf">get_commands_number</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">):</span>
891 <span class="sd">&quot;&quot;&quot;</span>
892 <span class="sd"> Args:</span>
893 <span class="sd"> workspace_name (str): the name of the workspace to query</span>
894 <span class="sd"> **params: any of the Couchdb request parameters</span>
895
896 <span class="sd"> Returns:</span>
897 <span class="sd"> The amount of commands in the workspace as an integer.</span>
898 <span class="sd"> &quot;&quot;&quot;</span>
899 <span class="k">return</span> <span class="nb">int</span><span class="p">(</span><span class="n">_get_raw_commands</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="o">**</span><span class="n">params</span><span class="p">))</span></div>
900
901 <div class="viewcode-block" id="create_host"><a class="viewcode-back" href="../server.html#server.create_host">[docs]</a><span class="k">def</span> <span class="nf">create_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="p">,</span> <span class="n">default_gateway</span><span class="p">,</span>
902 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
903 <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
904 <span class="sd">&quot;&quot;&quot;Create a host.</span>
905
906 <span class="sd"> Args:</span>
907 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
908 <span class="sd"> id (str): the id of the host. Must be unique.</span>
909 <span class="sd"> name (str): the host&#39;s name</span>
910 <span class="sd"> os (str): the operative system of the host</span>
911 <span class="sd"> default_gateway (str): the host&#39;s default_gateway</span>
912 <span class="sd"> description (str): a description.</span>
913 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
914 <span class="sd"> on None.</span>
915 <span class="sd"> owned (bool): is the host owned or not?</span>
916 <span class="sd"> owner (str): an owner for the host</span>
917 <span class="sd"> parent (Faraday Object): the host&#39;s parent. If you don&#39;t know this, leave</span>
918 <span class="sd"> on None.</span>
919
920 <span class="sd"> Returns:</span>
921 <span class="sd"> A dictionary with the server&#39;s response.</span>
922 <span class="sd"> &quot;&quot;&quot;</span>
923 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
924 <span class="nb">id</span><span class="p">,</span>
925 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="o">=</span><span class="n">os</span><span class="p">,</span>
926 <span class="n">default_gateway</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">,</span>
927 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
928 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
929 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
930 <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span>
931 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
932 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Host&quot;</span><span class="p">)</span></div>
933
934 <div class="viewcode-block" id="update_host"><a class="viewcode-back" href="../server.html#server.update_host">[docs]</a><span class="k">def</span> <span class="nf">update_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="p">,</span> <span class="n">default_gateway</span><span class="p">,</span>
935 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
936 <span class="n">parent</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
937 <span class="sd">&quot;&quot;&quot;Updates a host.</span>
938
939 <span class="sd"> Args:</span>
940 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
941 <span class="sd"> id (str): the id of the host. Must be unique.</span>
942 <span class="sd"> name (str): the host&#39;s name</span>
943 <span class="sd"> os (str): the operative system of the host</span>
944 <span class="sd"> default_gateway (str): the host&#39;s default_gateway</span>
945 <span class="sd"> description (str): a description.</span>
946 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
947 <span class="sd"> on None, it will be created automatically.</span>
948 <span class="sd"> owned (bool): is the host owned or not?</span>
949 <span class="sd"> owner (str): an owner for the host</span>
950 <span class="sd"> parent (Faraday Object): the host&#39;s parent. If you don&#39;t know this, leave</span>
951 <span class="sd"> on None.</span>
952
953 <span class="sd"> Returns:</span>
954 <span class="sd"> A dictionary with the server&#39;s response.</span>
955 <span class="sd"> &quot;&quot;&quot;</span>
956 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
957 <span class="nb">id</span><span class="p">,</span>
958 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">os</span><span class="o">=</span><span class="n">os</span><span class="p">,</span>
959 <span class="n">default_gateway</span><span class="o">=</span><span class="n">default_gateway</span><span class="p">,</span>
960 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
961 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
962 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
963 <span class="n">parent</span><span class="o">=</span><span class="n">parent</span><span class="p">,</span>
964 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
965 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Host&quot;</span><span class="p">)</span></div>
966
967
968 <span class="c1"># TODO: FIX. If you actually pass ipv4 or ipv6 as None, which are the defaults</span>
969 <span class="c1"># values here, the server will complain. Review if this should be fixed on</span>
970 <span class="c1"># the client or on the server.</span>
971 <div class="viewcode-block" id="create_interface"><a class="viewcode-back" href="../server.html#server.create_interface">[docs]</a><span class="k">def</span> <span class="nf">create_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">mac</span><span class="p">,</span>
972 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">hostnames</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">network_segment</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
973 <span class="n">ipv4</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ipv6</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
974 <span class="sd">&quot;&quot;&quot;Creates an interface.</span>
975
976 <span class="sd"> Warning:</span>
977 <span class="sd"> DO NOT leave ipv4 and ipv6 values on None, as the default indicated.</span>
978 <span class="sd"> This is a known bug and we&#39;re working to fix it. ipv4 and ipv6 need to</span>
979 <span class="sd"> be valid IP addresses, or, in case one of them is irrelevant, empty strings.</span>
980
981 <span class="sd"> Args:</span>
982 <span class="sd"> workspace_name (str): the name of the workspace where the interface will be saved.</span>
983 <span class="sd"> id (str): the id of the interface. Must be unique.</span>
984 <span class="sd"> name (str): the interface&#39;s name</span>
985 <span class="sd"> description (str): a description.</span>
986 <span class="sd"> mac (str) the mac address of the interface</span>
987 <span class="sd"> owned (bool): is the host owned or not?</span>
988 <span class="sd"> owner (str): an owner for the host</span>
989 <span class="sd"> hostnames ([str]): a list of hostnames</span>
990 <span class="sd"> network_segment (str): the network segment</span>
991 <span class="sd"> ipv4 (str): the ipv4 direction of the interface.</span>
992 <span class="sd"> ipv6 (str): the ipv6 direction of the interface.</span>
993 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
994 <span class="sd"> on None, it will be created automatically.</span>
995
996 <span class="sd"> Returns:</span>
997 <span class="sd"> A dictionary with the server&#39;s response.</span>
998 <span class="sd"> &quot;&quot;&quot;</span>
999 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1000 <span class="nb">id</span><span class="p">,</span>
1001 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1002 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1003 <span class="n">mac</span><span class="o">=</span><span class="n">mac</span><span class="p">,</span>
1004 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1005 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1006 <span class="n">hostnames</span><span class="o">=</span><span class="n">hostnames</span><span class="p">,</span>
1007 <span class="n">network_segment</span><span class="o">=</span><span class="n">network_segment</span><span class="p">,</span>
1008 <span class="n">ipv4</span><span class="o">=</span><span class="n">ipv4</span><span class="p">,</span>
1009 <span class="n">ipv6</span><span class="o">=</span><span class="n">ipv6</span><span class="p">,</span>
1010 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Interface&quot;</span><span class="p">,</span>
1011 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1012
1013 <div class="viewcode-block" id="update_interface"><a class="viewcode-back" href="../server.html#server.update_interface">[docs]</a><span class="k">def</span> <span class="nf">update_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">mac</span><span class="p">,</span>
1014 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">hostnames</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">network_segment</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1015 <span class="n">ipv4</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ipv6</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1016 <span class="sd">&quot;&quot;&quot;Creates an interface.</span>
1017
1018 <span class="sd"> Warning:</span>
1019 <span class="sd"> DO NOT leave ipv4 and ipv6 values on None, as the default indicated.</span>
1020 <span class="sd"> This is a known bug and we&#39;re working to fix it. ipv4 and ipv6 need to</span>
1021 <span class="sd"> be valid IP addresses, or, in case one of them is irrelevant, empty strings.</span>
1022
1023 <span class="sd"> Args:</span>
1024 <span class="sd"> workspace_name (str): the name of the workspace where the interface will be saved.</span>
1025 <span class="sd"> id (str): the id of the interface. Must be unique.</span>
1026 <span class="sd"> name (str): the interface&#39;s name</span>
1027 <span class="sd"> description (str): a description.</span>
1028 <span class="sd"> mac (str) the mac address of the interface</span>
1029 <span class="sd"> owned (bool): is the host owned or not?</span>
1030 <span class="sd"> owner (str): an owner for the host</span>
1031 <span class="sd"> hostnames ([str]): a list of hostnames</span>
1032 <span class="sd"> network_segment (str): the network segment</span>
1033 <span class="sd"> ipv4 (str): the ipv4 direction of the interface.</span>
1034 <span class="sd"> ipv6 (str): the ipv6 direction of the interface.</span>
1035 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1036 <span class="sd"> on None, it will be created automatically.</span>
1037
1038 <span class="sd"> Returns:</span>
1039 <span class="sd"> A dictionary with the server&#39;s response.</span>
1040 <span class="sd"> &quot;&quot;&quot;</span>
1041 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1042 <span class="nb">id</span><span class="p">,</span>
1043 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1044 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1045 <span class="n">mac</span><span class="o">=</span><span class="n">mac</span><span class="p">,</span>
1046 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1047 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1048 <span class="n">hostnames</span><span class="o">=</span><span class="n">hostnames</span><span class="p">,</span>
1049 <span class="n">network_segment</span><span class="o">=</span><span class="n">network_segment</span><span class="p">,</span>
1050 <span class="n">ipv4</span><span class="o">=</span><span class="n">ipv4</span><span class="p">,</span>
1051 <span class="n">ipv6</span><span class="o">=</span><span class="n">ipv6</span><span class="p">,</span>
1052 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Interface&quot;</span><span class="p">,</span>
1053 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1054
1055 <div class="viewcode-block" id="create_service"><a class="viewcode-back" href="../server.html#server.create_service">[docs]</a><span class="k">def</span> <span class="nf">create_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">ports</span><span class="p">,</span>
1056 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">protocol</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1057 <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1058 <span class="sd">&quot;&quot;&quot;Creates a service.</span>
1059
1060 <span class="sd"> Args:</span>
1061 <span class="sd"> workspace_name (str): the name of the workspace where the service will be saved.</span>
1062 <span class="sd"> id (str): the id of the service. Must be unique.</span>
1063 <span class="sd"> name (str): the host&#39;s name</span>
1064 <span class="sd"> description (str): a description.</span>
1065 <span class="sd"> ports ([str]): a list of ports for the service.</span>
1066 <span class="sd"> owned (bool): is the service owned or not?</span>
1067 <span class="sd"> owner (str): an owner for the service</span>
1068 <span class="sd"> protocol (str): the service&#39;s protocol</span>
1069 <span class="sd"> status (str): the service&#39;s status</span>
1070 <span class="sd"> version (str): the service&#39;s version</span>
1071 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1072 <span class="sd"> on None, it will be created automatically.</span>
1073
1074 <span class="sd"> Returns:</span>
1075 <span class="sd"> A dictionary with the server&#39;s response.</span>
1076 <span class="sd"> &quot;&quot;&quot;</span>
1077 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1078 <span class="nb">id</span><span class="p">,</span>
1079 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1080 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1081 <span class="n">ports</span><span class="o">=</span><span class="n">ports</span><span class="p">,</span>
1082 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1083 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1084 <span class="n">protocol</span><span class="o">=</span><span class="n">protocol</span><span class="p">,</span>
1085 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1086 <span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span>
1087 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Service&quot;</span><span class="p">,</span>
1088 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1089
1090 <div class="viewcode-block" id="update_service"><a class="viewcode-back" href="../server.html#server.update_service">[docs]</a><span class="k">def</span> <span class="nf">update_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">ports</span><span class="p">,</span>
1091 <span class="n">owned</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">protocol</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1092 <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1093 <span class="sd">&quot;&quot;&quot;Creates a service.</span>
1094
1095 <span class="sd"> Args:</span>
1096 <span class="sd"> workspace_name (str): the name of the workspace where the service will be saved.</span>
1097 <span class="sd"> id (str): the id of the service. Must be unique.</span>
1098 <span class="sd"> name (str): the service&#39;s name</span>
1099 <span class="sd"> description (str): a description.</span>
1100 <span class="sd"> ports ([str]): a list of ports for the service.</span>
1101 <span class="sd"> owned (bool): is the host owned or not?</span>
1102 <span class="sd"> owner (str): an owner for the service</span>
1103 <span class="sd"> protocol (str): the service&#39;s protocol</span>
1104 <span class="sd"> status (str): the service&#39;s status</span>
1105 <span class="sd"> version (str): the service&#39;s version</span>
1106 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1107 <span class="sd"> on None, it will be created automatically.</span>
1108
1109 <span class="sd"> Returns:</span>
1110 <span class="sd"> A dictionary with the server&#39;s response.</span>
1111 <span class="sd"> &quot;&quot;&quot;</span>
1112 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1113 <span class="nb">id</span><span class="p">,</span>
1114 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1115 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1116 <span class="n">ports</span><span class="o">=</span><span class="n">ports</span><span class="p">,</span>
1117 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1118 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1119 <span class="n">protocol</span><span class="o">=</span><span class="n">protocol</span><span class="p">,</span>
1120 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1121 <span class="n">version</span><span class="o">=</span><span class="n">version</span><span class="p">,</span>
1122 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Service&quot;</span><span class="p">,</span>
1123 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1124
1125
1126 <div class="viewcode-block" id="create_vuln"><a class="viewcode-back" href="../server.html#server.create_vuln">[docs]</a><span class="k">def</span> <span class="nf">create_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1127 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1128 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1129 <span class="sd">&quot;&quot;&quot;Creates a vuln.</span>
1130
1131 <span class="sd"> Args:</span>
1132 <span class="sd"> workspace_name (str): the name of the workspace where the vuln will be saved.</span>
1133 <span class="sd"> id (str): the id of the vuln. Must be unique.</span>
1134 <span class="sd"> name (str): the vuln&#39;s name</span>
1135 <span class="sd"> description (str): a description.</span>
1136 <span class="sd"> owned (bool): is the vuln owned or not?</span>
1137 <span class="sd"> owner (str): an owner for the vuln</span>
1138 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1139 <span class="sd"> data (str): any aditional data about the vuln</span>
1140 <span class="sd"> refs ([str]): references for the vulnerability</span>
1141 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1142 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1143 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1144 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1145 <span class="sd"> status (str): the service&#39;s status</span>
1146 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1147 <span class="sd"> on None, it will be created automatically.</span>
1148
1149 <span class="sd"> Returns:</span>
1150 <span class="sd"> A dictionary with the server&#39;s response.</span>
1151 <span class="sd"> &quot;&quot;&quot;</span>
1152 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1153 <span class="nb">id</span><span class="p">,</span>
1154 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1155 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1156 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1157 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1158 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1159 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1160 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1161 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1162 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1163 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1164 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Vulnerability&quot;</span><span class="p">,</span>
1165 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1166 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1167
1168 <div class="viewcode-block" id="update_vuln"><a class="viewcode-back" href="../server.html#server.update_vuln">[docs]</a><span class="k">def</span> <span class="nf">update_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1169 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1170 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1171 <span class="sd">&quot;&quot;&quot;Updates a vuln.</span>
1172
1173 <span class="sd"> Args:</span>
1174 <span class="sd"> workspace_name (str): the name of the workspace where the host will be saved.</span>
1175 <span class="sd"> id (str): the id of the host. Must be unique.</span>
1176 <span class="sd"> name (str): the host&#39;s name</span>
1177 <span class="sd"> description (str): a description.</span>
1178 <span class="sd"> owned (bool): is the vuln owned or not?</span>
1179 <span class="sd"> owner (str): an owner for the vuln</span>
1180 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1181 <span class="sd"> data (str): any aditional data about the vuln</span>
1182 <span class="sd"> refs ([str]): references for the vulnerability</span>
1183 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1184 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1185 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1186 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1187 <span class="sd"> status (str): the service&#39;s status</span>
1188 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1189 <span class="sd"> on None, it will be created automatically.</span>
1190
1191 <span class="sd"> Returns:</span>
1192 <span class="sd"> A dictionary with the server&#39;s response.</span>
1193 <span class="sd"> &quot;&quot;&quot;</span>
1194 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1195 <span class="nb">id</span><span class="p">,</span>
1196 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1197 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1198 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1199 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1200 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1201 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1202 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1203 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1204 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1205 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1206 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Vulnerability&quot;</span><span class="p">,</span>
1207 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1208 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1209
1210 <div class="viewcode-block" id="create_vuln_web"><a class="viewcode-back" href="../server.html#server.create_vuln_web">[docs]</a><span class="k">def</span> <span class="nf">create_vuln_web</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1211 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1212 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1213 <span class="n">query</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">request</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">response</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">website</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1214 <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1215 <span class="sd">&quot;&quot;&quot;Creates a vuln web.</span>
1216
1217 <span class="sd"> Args:</span>
1218 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1219 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1220 <span class="sd"> name (str): the vuln web&#39;s name</span>
1221 <span class="sd"> description (str): a description.</span>
1222 <span class="sd"> owner (str): an owner for the host</span>
1223 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1224 <span class="sd"> data (str): any aditional data about the vuln</span>
1225 <span class="sd"> refs ([str]): references for the vulnerability</span>
1226 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1227 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1228 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1229 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1230 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1231 <span class="sd"> on None, it will be created automatically.</span>
1232 <span class="sd"> method (str): the web vuln method</span>
1233 <span class="sd"> params (str): the parameters for the web vuln</span>
1234 <span class="sd"> path (str): the web vuln&#39;s path</span>
1235 <span class="sd"> query (str): the web vuln&#39;s query</span>
1236 <span class="sd"> request (str): the web vuln&#39;s request</span>
1237 <span class="sd"> response (str): the web vuln&#39;s response</span>
1238 <span class="sd"> category (str): a category for the web vuln&#39;s</span>
1239 <span class="sd"> website (str): the website where the vuln was found</span>
1240 <span class="sd"> status (str): the web vulns&#39;s status</span>
1241
1242 <span class="sd"> Returns:</span>
1243 <span class="sd"> A dictionary with the server&#39;s response.</span>
1244 <span class="sd"> &quot;&quot;&quot;</span>
1245 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1246 <span class="nb">id</span><span class="p">,</span>
1247 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1248 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1249 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1250 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1251 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1252 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1253 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1254 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1255 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1256 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1257 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1258 <span class="n">method</span><span class="o">=</span><span class="n">method</span><span class="p">,</span>
1259 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1260 <span class="n">path</span><span class="o">=</span><span class="n">path</span><span class="p">,</span>
1261 <span class="n">pname</span><span class="o">=</span><span class="n">pname</span><span class="p">,</span>
1262 <span class="n">query</span><span class="o">=</span><span class="n">query</span><span class="p">,</span>
1263 <span class="n">request</span><span class="o">=</span><span class="n">request</span><span class="p">,</span>
1264 <span class="n">response</span><span class="o">=</span><span class="n">response</span><span class="p">,</span>
1265 <span class="n">website</span><span class="o">=</span><span class="n">website</span><span class="p">,</span>
1266 <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span>
1267 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1268 <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;VulnerabilityWeb&#39;</span><span class="p">)</span></div>
1269
1270 <div class="viewcode-block" id="update_vuln_web"><a class="viewcode-back" href="../server.html#server.update_vuln_web">[docs]</a><span class="k">def</span> <span class="nf">update_vuln_web</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1271 <span class="n">confirmed</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">refs</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">severity</span><span class="o">=</span><span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="n">resolution</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1272 <span class="n">desc</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1273 <span class="n">query</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">request</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">response</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">website</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1274 <span class="n">status</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1275 <span class="sd">&quot;&quot;&quot;Creates a vuln web.</span>
1276
1277 <span class="sd"> Args:</span>
1278 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1279 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1280 <span class="sd"> name (str): the vuln web&#39;s name</span>
1281 <span class="sd"> description (str): a description.</span>
1282 <span class="sd"> owner (str): an owner for the host</span>
1283 <span class="sd"> confirmed (bool): is the vulnerability confirmed?</span>
1284 <span class="sd"> data (str): any aditional data about the vuln</span>
1285 <span class="sd"> refs ([str]): references for the vulnerability</span>
1286 <span class="sd"> severity (str): a string indicating the vuln&#39;s severity. can be &#39;info&#39;,</span>
1287 <span class="sd"> &#39;low&#39;, &#39;med&#39;, &#39;high&#39;, &#39;critical&#39;</span>
1288 <span class="sd"> resolution (str): the vuln&#39;s possible resolution</span>
1289 <span class="sd"> desc (str): a vuln&#39;s description.</span>
1290 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1291 <span class="sd"> on None, it will be created automatically.</span>
1292 <span class="sd"> method (str): the web vuln method</span>
1293 <span class="sd"> params (str): the parameters for the web vuln</span>
1294 <span class="sd"> path (str): the web vuln&#39;s path</span>
1295 <span class="sd"> query (str): the web vuln&#39;s query</span>
1296 <span class="sd"> request (str): the web vuln&#39;s request</span>
1297 <span class="sd"> response (str): the web vuln&#39;s response</span>
1298 <span class="sd"> category (str): a category for the web vuln&#39;s</span>
1299 <span class="sd"> website (str): the website where the vuln was found</span>
1300 <span class="sd"> status (str): the web vulns&#39;s status</span>
1301
1302 <span class="sd"> Returns:</span>
1303 <span class="sd"> A dictionary with the server&#39;s response.</span>
1304 <span class="sd"> &quot;&quot;&quot;</span>
1305 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1306 <span class="nb">id</span><span class="p">,</span>
1307 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1308 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1309 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1310 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1311 <span class="n">confirmed</span><span class="o">=</span><span class="n">confirmed</span><span class="p">,</span>
1312 <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span>
1313 <span class="n">refs</span><span class="o">=</span><span class="n">refs</span><span class="p">,</span>
1314 <span class="n">severity</span><span class="o">=</span><span class="n">severity</span><span class="p">,</span>
1315 <span class="n">resolution</span><span class="o">=</span><span class="n">resolution</span><span class="p">,</span>
1316 <span class="n">desc</span><span class="o">=</span><span class="n">desc</span><span class="p">,</span>
1317 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1318 <span class="n">method</span><span class="o">=</span><span class="n">method</span><span class="p">,</span>
1319 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1320 <span class="n">path</span><span class="o">=</span><span class="n">path</span><span class="p">,</span>
1321 <span class="n">pname</span><span class="o">=</span><span class="n">pname</span><span class="p">,</span>
1322 <span class="n">query</span><span class="o">=</span><span class="n">query</span><span class="p">,</span>
1323 <span class="n">request</span><span class="o">=</span><span class="n">request</span><span class="p">,</span>
1324 <span class="n">response</span><span class="o">=</span><span class="n">response</span><span class="p">,</span>
1325 <span class="n">website</span><span class="o">=</span><span class="n">website</span><span class="p">,</span>
1326 <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span>
1327 <span class="n">status</span><span class="o">=</span><span class="n">status</span><span class="p">,</span>
1328 <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;VulnerabilityWeb&#39;</span><span class="p">)</span></div>
1329
1330 <div class="viewcode-block" id="create_note"><a class="viewcode-back" href="../server.html#server.create_note">[docs]</a><span class="k">def</span> <span class="nf">create_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">text</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1331 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1332 <span class="sd">&quot;&quot;&quot;Creates a note.</span>
1333
1334 <span class="sd"> Args:</span>
1335 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1336 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1337 <span class="sd"> name (str): the vuln web&#39;s name</span>
1338 <span class="sd"> text (str): the note&#39;s text</span>
1339 <span class="sd"> owned (bool): is the note owned?</span>
1340 <span class="sd"> owner (str): the note&#39;s owner</span>
1341 <span class="sd"> description (str): a description</span>
1342 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1343 <span class="sd"> on None, it will be created automatically.</span>
1344
1345 <span class="sd"> Returns:</span>
1346 <span class="sd"> A dictionary with the server&#39;s response.</span>
1347 <span class="sd"> &quot;&quot;&quot;</span>
1348 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1349 <span class="nb">id</span><span class="p">,</span>
1350 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1351 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1352 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1353 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1354 <span class="n">text</span><span class="o">=</span><span class="n">text</span><span class="p">,</span>
1355 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Note&quot;</span><span class="p">,</span>
1356 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1357
1358 <div class="viewcode-block" id="update_note"><a class="viewcode-back" href="../server.html#server.update_note">[docs]</a><span class="k">def</span> <span class="nf">update_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">text</span><span class="p">,</span> <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span>
1359 <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1360 <span class="sd">&quot;&quot;&quot;Updates a note.</span>
1361
1362 <span class="sd"> Args:</span>
1363 <span class="sd"> workspace_name (str): the name of the workspace where the vuln web will be saved.</span>
1364 <span class="sd"> id (str): the id of the vuln web. Must be unique.</span>
1365 <span class="sd"> name (str): the vuln web&#39;s name</span>
1366 <span class="sd"> text (str): the note&#39;s text</span>
1367 <span class="sd"> owned (bool): is the note owned?</span>
1368 <span class="sd"> owner (str): the note&#39;s owner</span>
1369 <span class="sd"> description (str): a description</span>
1370 <span class="sd"> metadata: a collection of metadata. If you don&#39;t know the metada. leave</span>
1371 <span class="sd"> on None, it will be created automatically.</span>
1372
1373 <span class="sd"> Returns:</span>
1374 <span class="sd"> A dictionary with the server&#39;s response.</span>
1375 <span class="sd"> &quot;&quot;&quot;</span>
1376 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1377 <span class="nb">id</span><span class="p">,</span>
1378 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1379 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1380 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1381 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1382 <span class="n">text</span><span class="o">=</span><span class="n">text</span><span class="p">,</span>
1383 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Note&quot;</span><span class="p">,</span>
1384 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">)</span></div>
1385
1386
1387 <div class="viewcode-block" id="create_credential"><a class="viewcode-back" href="../server.html#server.create_credential">[docs]</a><span class="k">def</span> <span class="nf">create_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span>
1388 <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1389 <span class="sd">&quot;&quot;&quot;Save a credential to the server. Return the json with the</span>
1390 <span class="sd"> server&#39;s response.</span>
1391 <span class="sd"> &quot;&quot;&quot;</span>
1392 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1393 <span class="nb">id</span><span class="p">,</span>
1394 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1395 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1396 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1397 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1398 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1399 <span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
1400 <span class="n">password</span><span class="o">=</span><span class="n">password</span><span class="p">,</span>
1401 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Credential&quot;</span><span class="p">)</span></div>
1402
1403 <div class="viewcode-block" id="update_credential"><a class="viewcode-back" href="../server.html#server.update_credential">[docs]</a><span class="k">def</span> <span class="nf">update_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span>
1404 <span class="n">owned</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">owner</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">description</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">metadata</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1405 <span class="sd">&quot;&quot;&quot;Update a credential in the server. Return the json with the</span>
1406 <span class="sd"> server&#39;s response.</span>
1407 <span class="sd"> &quot;&quot;&quot;</span>
1408 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1409 <span class="nb">id</span><span class="p">,</span>
1410 <span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span>
1411 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1412 <span class="n">owned</span><span class="o">=</span><span class="n">owned</span><span class="p">,</span>
1413 <span class="n">owner</span><span class="o">=</span><span class="n">owner</span><span class="p">,</span>
1414 <span class="n">metadata</span><span class="o">=</span><span class="n">metadata</span><span class="p">,</span>
1415 <span class="n">username</span><span class="o">=</span><span class="n">username</span><span class="p">,</span>
1416 <span class="n">password</span><span class="o">=</span><span class="n">password</span><span class="p">,</span>
1417 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Credential&quot;</span><span class="p">)</span></div>
1418
1419 <div class="viewcode-block" id="create_command"><a class="viewcode-back" href="../server.html#server.create_command">[docs]</a><span class="k">def</span> <span class="nf">create_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1420 <span class="n">ip</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">itime</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1421 <span class="sd">&quot;&quot;&quot;Create a command in the server. Return the json with the</span>
1422 <span class="sd"> server&#39;s response.</span>
1423 <span class="sd"> &quot;&quot;&quot;</span>
1424 <span class="k">return</span> <span class="n">_save_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1425 <span class="nb">id</span><span class="p">,</span>
1426 <span class="n">command</span><span class="o">=</span><span class="n">command</span><span class="p">,</span>
1427 <span class="n">duration</span><span class="o">=</span><span class="n">duration</span><span class="p">,</span>
1428 <span class="n">hostname</span><span class="o">=</span><span class="n">hostname</span><span class="p">,</span>
1429 <span class="n">ip</span><span class="o">=</span><span class="n">ip</span><span class="p">,</span>
1430 <span class="n">itime</span><span class="o">=</span><span class="n">itime</span><span class="p">,</span>
1431 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1432 <span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span>
1433 <span class="n">workspace</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1434 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;CommandRunInformation&quot;</span><span class="p">)</span></div>
1435
1436 <div class="viewcode-block" id="update_command"><a class="viewcode-back" href="../server.html#server.update_command">[docs]</a><span class="k">def</span> <span class="nf">update_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">command</span><span class="p">,</span> <span class="n">duration</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">hostname</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1437 <span class="n">ip</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">itime</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1438 <span class="sd">&quot;&quot;&quot;Update a command in the server. Return the json with the</span>
1439 <span class="sd"> server&#39;s response.</span>
1440 <span class="sd"> &quot;&quot;&quot;</span>
1441 <span class="k">return</span> <span class="n">_update_in_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1442 <span class="nb">id</span><span class="p">,</span>
1443 <span class="n">command</span><span class="o">=</span><span class="n">command</span><span class="p">,</span>
1444 <span class="n">duration</span><span class="o">=</span><span class="n">duration</span><span class="p">,</span>
1445 <span class="n">hostname</span><span class="o">=</span><span class="n">hostname</span><span class="p">,</span>
1446 <span class="n">ip</span><span class="o">=</span><span class="n">ip</span><span class="p">,</span>
1447 <span class="n">itime</span><span class="o">=</span><span class="n">itime</span><span class="p">,</span>
1448 <span class="n">params</span><span class="o">=</span><span class="n">params</span><span class="p">,</span>
1449 <span class="n">user</span><span class="o">=</span><span class="n">user</span><span class="p">,</span>
1450 <span class="n">workspace</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1451 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;CommandRunInformation&quot;</span><span class="p">)</span></div>
1452
1453
1454 <div class="viewcode-block" id="create_workspace"><a class="viewcode-back" href="../server.html#server.create_workspace">[docs]</a><span class="k">def</span> <span class="nf">create_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="n">start_date</span><span class="p">,</span> <span class="n">finish_date</span><span class="p">,</span>
1455 <span class="n">customer</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1456 <span class="sd">&quot;&quot;&quot;Create a workspace in the server. Return the json with the</span>
1457 <span class="sd"> server&#39;s response.</span>
1458 <span class="sd"> &quot;&quot;&quot;</span>
1459 <span class="k">return</span> <span class="n">_save_db_to_server</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span>
1460 <span class="n">name</span><span class="o">=</span><span class="n">workspace_name</span><span class="p">,</span>
1461 <span class="n">description</span><span class="o">=</span><span class="n">description</span><span class="p">,</span>
1462 <span class="n">customer</span><span class="o">=</span><span class="n">customer</span><span class="p">,</span>
1463 <span class="n">sdate</span><span class="o">=</span><span class="n">start_date</span><span class="p">,</span>
1464 <span class="n">fdate</span><span class="o">=</span><span class="n">finish_date</span><span class="p">,</span>
1465 <span class="nb">type</span><span class="o">=</span><span class="s2">&quot;Workspace&quot;</span><span class="p">)</span></div>
1466
1467 <div class="viewcode-block" id="delete_host"><a class="viewcode-back" href="../server.html#server.delete_host">[docs]</a><span class="k">def</span> <span class="nf">delete_host</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">):</span>
1468 <span class="sd">&quot;&quot;&quot;Delete host of id host_id from the database.&quot;&quot;&quot;</span>
1469 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">host_id</span><span class="p">)</span></div>
1470
1471 <div class="viewcode-block" id="delete_interface"><a class="viewcode-back" href="../server.html#server.delete_interface">[docs]</a><span class="k">def</span> <span class="nf">delete_interface</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">):</span>
1472 <span class="sd">&quot;&quot;&quot;Delete interface of id interface_id from the database.&quot;&quot;&quot;</span>
1473 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">interface_id</span><span class="p">)</span></div>
1474
1475 <div class="viewcode-block" id="delete_service"><a class="viewcode-back" href="../server.html#server.delete_service">[docs]</a><span class="k">def</span> <span class="nf">delete_service</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">):</span>
1476 <span class="sd">&quot;&quot;&quot;Delete service of id service_id from the database.&quot;&quot;&quot;</span>
1477 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">service_id</span><span class="p">)</span></div>
1478
1479 <div class="viewcode-block" id="delete_vuln"><a class="viewcode-back" href="../server.html#server.delete_vuln">[docs]</a><span class="k">def</span> <span class="nf">delete_vuln</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">):</span>
1480 <span class="sd">&quot;&quot;&quot;Delete vuln of id vuln_id from the database.&quot;&quot;&quot;</span>
1481 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">vuln_id</span><span class="p">)</span></div>
1482
1483 <div class="viewcode-block" id="delete_note"><a class="viewcode-back" href="../server.html#server.delete_note">[docs]</a><span class="k">def</span> <span class="nf">delete_note</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">):</span>
1484 <span class="sd">&quot;&quot;&quot;Delete note of id note_id from the database.&quot;&quot;&quot;</span>
1485 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">note_id</span><span class="p">)</span></div>
1486
1487 <div class="viewcode-block" id="delete_credential"><a class="viewcode-back" href="../server.html#server.delete_credential">[docs]</a><span class="k">def</span> <span class="nf">delete_credential</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">):</span>
1488 <span class="sd">&quot;&quot;&quot;Delete credential of id credential_id from the database.&quot;&quot;&quot;</span>
1489 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">credential_id</span><span class="p">)</span></div>
1490
1491 <div class="viewcode-block" id="delete_command"><a class="viewcode-back" href="../server.html#server.delete_command">[docs]</a><span class="k">def</span> <span class="nf">delete_command</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">):</span>
1492 <span class="sd">&quot;&quot;&quot;Delete command of id command_id from the database.&quot;&quot;&quot;</span>
1493 <span class="k">return</span> <span class="n">_delete_from_couch</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">,</span> <span class="n">command_id</span><span class="p">)</span></div>
1494
1495 <div class="viewcode-block" id="delete_workspace"><a class="viewcode-back" href="../server.html#server.delete_workspace">[docs]</a><span class="k">def</span> <span class="nf">delete_workspace</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">):</span>
1496 <span class="sd">&quot;&quot;&quot;Delete the couch database of id workspace_name&quot;&quot;&quot;</span>
1497 <span class="n">db_url</span> <span class="o">=</span> <span class="n">_create_server_db_url</span><span class="p">(</span><span class="n">workspace_name</span><span class="p">)</span>
1498 <span class="k">return</span> <span class="n">_delete</span><span class="p">(</span><span class="n">db_url</span><span class="p">,</span> <span class="n">database</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
1499
1500 <div class="viewcode-block" id="is_server_up"><a class="viewcode-back" href="../server.html#server.is_server_up">[docs]</a><span class="k">def</span> <span class="nf">is_server_up</span><span class="p">():</span>
1501 <span class="sd">&quot;&quot;&quot;Return True if we can stablish a connection with the server,</span>
1502 <span class="sd"> False otherwise.</span>
1503 <span class="sd"> &quot;&quot;&quot;</span>
1504 <span class="k">try</span><span class="p">:</span>
1505 <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/info&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">_create_server_api_url</span><span class="p">()))</span>
1506 <span class="n">is_server_up</span> <span class="o">=</span> <span class="kc">True</span>
1507 <span class="k">except</span><span class="p">:</span>
1508 <span class="n">is_server_up</span> <span class="o">=</span> <span class="kc">False</span>
1509 <span class="k">return</span> <span class="n">is_server_up</span></div>
1510
1511 <div class="viewcode-block" id="test_server_url"><a class="viewcode-back" href="../server.html#server.test_server_url">[docs]</a><span class="k">def</span> <span class="nf">test_server_url</span><span class="p">(</span><span class="n">url_to_test</span><span class="p">):</span>
1512 <span class="sd">&quot;&quot;&quot;Return True if the url_to_test is indeed a valid Faraday Server URL.</span>
1513 <span class="sd"> False otherwise.</span>
1514 <span class="sd"> &quot;&quot;&quot;</span>
1515 <span class="k">try</span><span class="p">:</span>
1516 <span class="n">_get</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">{0}</span><span class="s2">/_api/info&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">url_to_test</span><span class="p">))</span>
1517 <span class="n">test_okey</span> <span class="o">=</span> <span class="kc">True</span>
1518 <span class="k">except</span><span class="p">:</span>
1519 <span class="n">test_okey</span> <span class="o">=</span> <span class="kc">False</span>
1520 <span class="k">return</span> <span class="n">test_okey</span></div>
1521 </pre></div>
1522
1523 </div>
1524 </div>
1525 <footer>
1526
1527
1528 <hr/>
1529
1530 <div role="contentinfo">
1531 <p>
1532 &copy; Copyright 2016, Infobyte.
1533
1534 </p>
1535 </div>
1536 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
1537
1538 </footer>
1539
1540 </div>
1541 </div>
1542
1543 </section>
1544
1545 </div>
1546
1547
1548
1549
1550
1551 <script type="text/javascript">
1552 var DOCUMENTATION_OPTIONS = {
1553 URL_ROOT:'../',
1554 VERSION:'0.1',
1555 COLLAPSE_INDEX:false,
1556 FILE_SUFFIX:'.html',
1557 HAS_SOURCE: true
1558 };
1559 </script>
1560 <script type="text/javascript" src="../_static/jquery.js"></script>
1561 <script type="text/javascript" src="../_static/underscore.js"></script>
1562 <script type="text/javascript" src="../_static/doctools.js"></script>
1563
1564
1565
1566
1567
1568 <script type="text/javascript" src="../_static/js/theme.js"></script>
1569
1570
1571
1572
1573 <script type="text/javascript">
1574 jQuery(function () {
1575 SphinxRtdTheme.StickyNav.enable();
1576 });
1577 </script>
1578
1579
1580 </body>
1581 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>sqlalchemy.orm.attributes &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="../../../genindex.html"/>
34 <link rel="search" title="Search" href="../../../search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="../../../index.html"/>
36 <link rel="up" title="Module code" href="../../index.html"/>
37
38
39 <script src="../../../_static/js/modernizr.min.js"></script>
40
41 </head>
42
43 <body class="wy-body-for-nav" role="document">
44
45 <div class="wy-grid-for-nav">
46
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search">
51
52
53
54 <a href="../../../index.html" class="icon icon-home"> Faraday
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 0.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85 <!-- Local TOC -->
86 <div class="local-toc"></div>
87
88
89 </div>
90 </div>
91 </nav>
92
93 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
95
96 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
97 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
98 <a href="../../../index.html">Faraday</a>
99 </nav>
100
101
102
103 <div class="wy-nav-content">
104 <div class="rst-content">
105
106
107
108
109
110
111 <div role="navigation" aria-label="breadcrumbs navigation">
112 <ul class="wy-breadcrumbs">
113 <li><a href="../../../index.html">Docs</a> &raquo;</li>
114
115 <li><a href="../../index.html">Module code</a> &raquo;</li>
116
117 <li>sqlalchemy.orm.attributes</li>
118 <li class="wy-breadcrumbs-aside">
119
120
121
122 </li>
123 </ul>
124 <hr/>
125 </div>
126 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
127 <div itemprop="articleBody">
128
129 <h1>Source code for sqlalchemy.orm.attributes</h1><div class="highlight"><pre>
130 <span></span><span class="c1"># orm/attributes.py</span>
131 <span class="c1"># Copyright (C) 2005-2016 the SQLAlchemy authors and contributors</span>
132 <span class="c1"># &lt;see AUTHORS file&gt;</span>
133 <span class="c1">#</span>
134 <span class="c1"># This module is part of SQLAlchemy and is released under</span>
135 <span class="c1"># the MIT License: http://www.opensource.org/licenses/mit-license.php</span>
136
137 <span class="sd">&quot;&quot;&quot;Defines instrumentation for class attributes and their interaction</span>
138 <span class="sd">with instances.</span>
139
140 <span class="sd">This module is usually not directly visible to user applications, but</span>
141 <span class="sd">defines a large part of the ORM&#39;s interactivity.</span>
142
143
144 <span class="sd">&quot;&quot;&quot;</span>
145
146 <span class="kn">import</span> <span class="nn">operator</span>
147 <span class="kn">from</span> <span class="nn">..</span> <span class="k">import</span> <span class="n">util</span><span class="p">,</span> <span class="n">event</span><span class="p">,</span> <span class="n">inspection</span>
148 <span class="kn">from</span> <span class="nn">.</span> <span class="k">import</span> <span class="n">interfaces</span><span class="p">,</span> <span class="n">collections</span><span class="p">,</span> <span class="n">exc</span> <span class="k">as</span> <span class="n">orm_exc</span>
149
150 <span class="kn">from</span> <span class="nn">.base</span> <span class="k">import</span> <span class="n">instance_state</span><span class="p">,</span> <span class="n">instance_dict</span><span class="p">,</span> <span class="n">manager_of_class</span>
151
152 <span class="kn">from</span> <span class="nn">.base</span> <span class="k">import</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">,</span> <span class="n">ATTR_WAS_SET</span><span class="p">,</span> <span class="n">ATTR_EMPTY</span><span class="p">,</span> <span class="n">NO_VALUE</span><span class="p">,</span>\
153 <span class="n">NEVER_SET</span><span class="p">,</span> <span class="n">NO_CHANGE</span><span class="p">,</span> <span class="n">CALLABLES_OK</span><span class="p">,</span> <span class="n">SQL_OK</span><span class="p">,</span> <span class="n">RELATED_OBJECT_OK</span><span class="p">,</span>\
154 <span class="n">INIT_OK</span><span class="p">,</span> <span class="n">NON_PERSISTENT_OK</span><span class="p">,</span> <span class="n">LOAD_AGAINST_COMMITTED</span><span class="p">,</span> <span class="n">PASSIVE_OFF</span><span class="p">,</span>\
155 <span class="n">PASSIVE_RETURN_NEVER_SET</span><span class="p">,</span> <span class="n">PASSIVE_NO_INITIALIZE</span><span class="p">,</span> <span class="n">PASSIVE_NO_FETCH</span><span class="p">,</span>\
156 <span class="n">PASSIVE_NO_FETCH_RELATED</span><span class="p">,</span> <span class="n">PASSIVE_ONLY_PERSISTENT</span><span class="p">,</span> <span class="n">NO_AUTOFLUSH</span>
157 <span class="kn">from</span> <span class="nn">.base</span> <span class="k">import</span> <span class="n">state_str</span><span class="p">,</span> <span class="n">instance_str</span>
158
159
160 <span class="nd">@inspection</span><span class="o">.</span><span class="n">_self_inspects</span>
161 <span class="k">class</span> <span class="nc">QueryableAttribute</span><span class="p">(</span><span class="n">interfaces</span><span class="o">.</span><span class="n">_MappedAttribute</span><span class="p">,</span>
162 <span class="n">interfaces</span><span class="o">.</span><span class="n">InspectionAttr</span><span class="p">,</span>
163 <span class="n">interfaces</span><span class="o">.</span><span class="n">PropComparator</span><span class="p">):</span>
164 <span class="sd">&quot;&quot;&quot;Base class for :term:`descriptor` objects that intercept</span>
165 <span class="sd"> attribute events on behalf of a :class:`.MapperProperty`</span>
166 <span class="sd"> object. The actual :class:`.MapperProperty` is accessible</span>
167 <span class="sd"> via the :attr:`.QueryableAttribute.property`</span>
168 <span class="sd"> attribute.</span>
169
170
171 <span class="sd"> .. seealso::</span>
172
173 <span class="sd"> :class:`.InstrumentedAttribute`</span>
174
175 <span class="sd"> :class:`.MapperProperty`</span>
176
177 <span class="sd"> :attr:`.Mapper.all_orm_descriptors`</span>
178
179 <span class="sd"> :attr:`.Mapper.attrs`</span>
180 <span class="sd"> &quot;&quot;&quot;</span>
181
182 <span class="n">is_attribute</span> <span class="o">=</span> <span class="kc">True</span>
183
184 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">impl</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
185 <span class="n">comparator</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">parententity</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
186 <span class="n">of_type</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
187 <span class="bp">self</span><span class="o">.</span><span class="n">class_</span> <span class="o">=</span> <span class="n">class_</span>
188 <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">key</span>
189 <span class="bp">self</span><span class="o">.</span><span class="n">impl</span> <span class="o">=</span> <span class="n">impl</span>
190 <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span> <span class="o">=</span> <span class="n">comparator</span>
191 <span class="bp">self</span><span class="o">.</span><span class="n">_parententity</span> <span class="o">=</span> <span class="n">parententity</span>
192 <span class="bp">self</span><span class="o">.</span><span class="n">_of_type</span> <span class="o">=</span> <span class="n">of_type</span>
193
194 <span class="n">manager</span> <span class="o">=</span> <span class="n">manager_of_class</span><span class="p">(</span><span class="n">class_</span><span class="p">)</span>
195 <span class="c1"># manager is None in the case of AliasedClass</span>
196 <span class="k">if</span> <span class="n">manager</span><span class="p">:</span>
197 <span class="c1"># propagate existing event listeners from</span>
198 <span class="c1"># immediate superclass</span>
199 <span class="k">for</span> <span class="n">base</span> <span class="ow">in</span> <span class="n">manager</span><span class="o">.</span><span class="n">_bases</span><span class="p">:</span>
200 <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">base</span><span class="p">:</span>
201 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_update</span><span class="p">(</span><span class="n">base</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dispatch</span><span class="p">)</span>
202
203 <span class="nd">@util</span><span class="o">.</span><span class="n">memoized_property</span>
204 <span class="k">def</span> <span class="nf">_supports_population</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
205 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">supports_population</span>
206
207 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
208 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">get_history</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span>
209 <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">passive</span><span class="p">)</span>
210
211 <span class="k">def</span> <span class="nf">__selectable__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
212 <span class="c1"># TODO: conditionally attach this method based on clause_element ?</span>
213 <span class="k">return</span> <span class="bp">self</span>
214
215 <span class="nd">@util</span><span class="o">.</span><span class="n">memoized_property</span>
216 <span class="k">def</span> <span class="nf">info</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
217 <span class="sd">&quot;&quot;&quot;Return the &#39;info&#39; dictionary for the underlying SQL element.</span>
218
219 <span class="sd"> The behavior here is as follows:</span>
220
221 <span class="sd"> * If the attribute is a column-mapped property, i.e.</span>
222 <span class="sd"> :class:`.ColumnProperty`, which is mapped directly</span>
223 <span class="sd"> to a schema-level :class:`.Column` object, this attribute</span>
224 <span class="sd"> will return the :attr:`.SchemaItem.info` dictionary associated</span>
225 <span class="sd"> with the core-level :class:`.Column` object.</span>
226
227 <span class="sd"> * If the attribute is a :class:`.ColumnProperty` but is mapped to</span>
228 <span class="sd"> any other kind of SQL expression other than a :class:`.Column`,</span>
229 <span class="sd"> the attribute will refer to the :attr:`.MapperProperty.info`</span>
230 <span class="sd"> dictionary associated directly with the :class:`.ColumnProperty`,</span>
231 <span class="sd"> assuming the SQL expression itself does not have its own ``.info``</span>
232 <span class="sd"> attribute (which should be the case, unless a user-defined SQL</span>
233 <span class="sd"> construct has defined one).</span>
234
235 <span class="sd"> * If the attribute refers to any other kind of</span>
236 <span class="sd"> :class:`.MapperProperty`, including :class:`.RelationshipProperty`,</span>
237 <span class="sd"> the attribute will refer to the :attr:`.MapperProperty.info`</span>
238 <span class="sd"> dictionary associated with that :class:`.MapperProperty`.</span>
239
240 <span class="sd"> * To access the :attr:`.MapperProperty.info` dictionary of the</span>
241 <span class="sd"> :class:`.MapperProperty` unconditionally, including for a</span>
242 <span class="sd"> :class:`.ColumnProperty` that&#39;s associated directly with a</span>
243 <span class="sd"> :class:`.schema.Column`, the attribute can be referred to using</span>
244 <span class="sd"> :attr:`.QueryableAttribute.property` attribute, as</span>
245 <span class="sd"> ``MyClass.someattribute.property.info``.</span>
246
247 <span class="sd"> .. versionadded:: 0.8.0</span>
248
249 <span class="sd"> .. seealso::</span>
250
251 <span class="sd"> :attr:`.SchemaItem.info`</span>
252
253 <span class="sd"> :attr:`.MapperProperty.info`</span>
254
255 <span class="sd"> &quot;&quot;&quot;</span>
256 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">info</span>
257
258 <span class="nd">@util</span><span class="o">.</span><span class="n">memoized_property</span>
259 <span class="k">def</span> <span class="nf">parent</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
260 <span class="sd">&quot;&quot;&quot;Return an inspection instance representing the parent.</span>
261
262 <span class="sd"> This will be either an instance of :class:`.Mapper`</span>
263 <span class="sd"> or :class:`.AliasedInsp`, depending upon the nature</span>
264 <span class="sd"> of the parent entity which this attribute is associated</span>
265 <span class="sd"> with.</span>
266
267 <span class="sd"> &quot;&quot;&quot;</span>
268 <span class="k">return</span> <span class="n">inspection</span><span class="o">.</span><span class="n">inspect</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_parententity</span><span class="p">)</span>
269
270 <span class="nd">@property</span>
271 <span class="k">def</span> <span class="nf">expression</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
272 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">__clause_element__</span><span class="p">()</span>
273
274 <span class="k">def</span> <span class="nf">__clause_element__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
275 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">__clause_element__</span><span class="p">()</span>
276
277 <span class="k">def</span> <span class="nf">_query_clause_element</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
278 <span class="sd">&quot;&quot;&quot;like __clause_element__(), but called specifically</span>
279 <span class="sd"> by :class:`.Query` to allow special behavior.&quot;&quot;&quot;</span>
280
281 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">_query_clause_element</span><span class="p">()</span>
282
283 <span class="k">def</span> <span class="nf">adapt_to_entity</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">adapt_to_entity</span><span class="p">):</span>
284 <span class="k">assert</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">_of_type</span>
285 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="p">(</span><span class="n">adapt_to_entity</span><span class="o">.</span><span class="n">entity</span><span class="p">,</span>
286 <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">impl</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="p">,</span>
287 <span class="n">comparator</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">adapt_to_entity</span><span class="p">(</span>
288 <span class="n">adapt_to_entity</span><span class="p">),</span>
289 <span class="n">parententity</span><span class="o">=</span><span class="n">adapt_to_entity</span><span class="p">)</span>
290
291 <span class="k">def</span> <span class="nf">of_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cls</span><span class="p">):</span>
292 <span class="k">return</span> <span class="n">QueryableAttribute</span><span class="p">(</span>
293 <span class="bp">self</span><span class="o">.</span><span class="n">class_</span><span class="p">,</span>
294 <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
295 <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="p">,</span>
296 <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">of_type</span><span class="p">(</span><span class="n">cls</span><span class="p">),</span>
297 <span class="bp">self</span><span class="o">.</span><span class="n">_parententity</span><span class="p">,</span>
298 <span class="n">of_type</span><span class="o">=</span><span class="n">cls</span><span class="p">)</span>
299
300 <span class="k">def</span> <span class="nf">label</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
301 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_query_clause_element</span><span class="p">()</span><span class="o">.</span><span class="n">label</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
302
303 <span class="k">def</span> <span class="nf">operate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">op</span><span class="p">,</span> <span class="o">*</span><span class="n">other</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
304 <span class="k">return</span> <span class="n">op</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">,</span> <span class="o">*</span><span class="n">other</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
305
306 <span class="k">def</span> <span class="nf">reverse_operate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">op</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
307 <span class="k">return</span> <span class="n">op</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
308
309 <span class="k">def</span> <span class="nf">hasparent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">optimistic</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
310 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">hasparent</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">optimistic</span><span class="o">=</span><span class="n">optimistic</span><span class="p">)</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span>
311
312 <span class="k">def</span> <span class="nf">__getattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
313 <span class="k">try</span><span class="p">:</span>
314 <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
315 <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
316 <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span>
317 <span class="s1">&#39;Neither </span><span class="si">%r</span><span class="s1"> object nor </span><span class="si">%r</span><span class="s1"> object associated with </span><span class="si">%s</span><span class="s1"> &#39;</span>
318 <span class="s1">&#39;has an attribute </span><span class="si">%r</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span>
319 <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
320 <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
321 <span class="bp">self</span><span class="p">,</span>
322 <span class="n">key</span><span class="p">)</span>
323 <span class="p">)</span>
324
325 <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
326 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">.</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">class_</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
327
328 <span class="nd">@util</span><span class="o">.</span><span class="n">memoized_property</span>
329 <span class="k">def</span> <span class="nf">property</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
330 <span class="sd">&quot;&quot;&quot;Return the :class:`.MapperProperty` associated with this</span>
331 <span class="sd"> :class:`.QueryableAttribute`.</span>
332
333
334 <span class="sd"> Return values here will commonly be instances of</span>
335 <span class="sd"> :class:`.ColumnProperty` or :class:`.RelationshipProperty`.</span>
336
337
338 <span class="sd"> &quot;&quot;&quot;</span>
339 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">property</span>
340
341
342 <span class="k">class</span> <span class="nc">InstrumentedAttribute</span><span class="p">(</span><span class="n">QueryableAttribute</span><span class="p">):</span>
343 <span class="sd">&quot;&quot;&quot;Class bound instrumented attribute which adds basic</span>
344 <span class="sd"> :term:`descriptor` methods.</span>
345
346 <span class="sd"> See :class:`.QueryableAttribute` for a description of most features.</span>
347
348
349 <span class="sd"> &quot;&quot;&quot;</span>
350
351 <span class="k">def</span> <span class="nf">__set__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
352 <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span>
353 <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">value</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
354
355 <span class="k">def</span> <span class="nf">__delete__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">):</span>
356 <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">))</span>
357
358 <span class="k">def</span> <span class="nf">__get__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">owner</span><span class="p">):</span>
359 <span class="k">if</span> <span class="n">instance</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
360 <span class="k">return</span> <span class="bp">self</span>
361
362 <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
363 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_supports_population</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
364 <span class="k">return</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
365 <span class="k">else</span><span class="p">:</span>
366 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">dict_</span><span class="p">)</span>
367
368
369 <span class="k">def</span> <span class="nf">create_proxied_attribute</span><span class="p">(</span><span class="n">descriptor</span><span class="p">):</span>
370 <span class="sd">&quot;&quot;&quot;Create an QueryableAttribute / user descriptor hybrid.</span>
371
372 <span class="sd"> Returns a new QueryableAttribute type that delegates descriptor</span>
373 <span class="sd"> behavior and getattr() to the given descriptor.</span>
374 <span class="sd"> &quot;&quot;&quot;</span>
375
376 <span class="c1"># TODO: can move this to descriptor_props if the need for this</span>
377 <span class="c1"># function is removed from ext/hybrid.py</span>
378
379 <span class="k">class</span> <span class="nc">Proxy</span><span class="p">(</span><span class="n">QueryableAttribute</span><span class="p">):</span>
380 <span class="sd">&quot;&quot;&quot;Presents the :class:`.QueryableAttribute` interface as a</span>
381 <span class="sd"> proxy on top of a Python descriptor / :class:`.PropComparator`</span>
382 <span class="sd"> combination.</span>
383
384 <span class="sd"> &quot;&quot;&quot;</span>
385
386 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">descriptor</span><span class="p">,</span>
387 <span class="n">comparator</span><span class="p">,</span>
388 <span class="n">adapt_to_entity</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
389 <span class="n">original_property</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
390 <span class="bp">self</span><span class="o">.</span><span class="n">class_</span> <span class="o">=</span> <span class="n">class_</span>
391 <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">key</span>
392 <span class="bp">self</span><span class="o">.</span><span class="n">descriptor</span> <span class="o">=</span> <span class="n">descriptor</span>
393 <span class="bp">self</span><span class="o">.</span><span class="n">original_property</span> <span class="o">=</span> <span class="n">original_property</span>
394 <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span> <span class="o">=</span> <span class="n">comparator</span>
395 <span class="bp">self</span><span class="o">.</span><span class="n">_adapt_to_entity</span> <span class="o">=</span> <span class="n">adapt_to_entity</span>
396 <span class="bp">self</span><span class="o">.</span><span class="n">__doc__</span> <span class="o">=</span> <span class="n">doc</span>
397
398 <span class="nd">@property</span>
399 <span class="k">def</span> <span class="nf">property</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
400 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="o">.</span><span class="n">property</span>
401
402 <span class="nd">@util</span><span class="o">.</span><span class="n">memoized_property</span>
403 <span class="k">def</span> <span class="nf">comparator</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
404 <span class="k">if</span> <span class="n">util</span><span class="o">.</span><span class="n">callable</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span><span class="p">):</span>
405 <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span><span class="p">()</span>
406 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_adapt_to_entity</span><span class="p">:</span>
407 <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span><span class="o">.</span><span class="n">adapt_to_entity</span><span class="p">(</span>
408 <span class="bp">self</span><span class="o">.</span><span class="n">_adapt_to_entity</span><span class="p">)</span>
409 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span>
410
411 <span class="k">def</span> <span class="nf">adapt_to_entity</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">adapt_to_entity</span><span class="p">):</span>
412 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">__class__</span><span class="p">(</span><span class="n">adapt_to_entity</span><span class="o">.</span><span class="n">entity</span><span class="p">,</span>
413 <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
414 <span class="bp">self</span><span class="o">.</span><span class="n">descriptor</span><span class="p">,</span>
415 <span class="bp">self</span><span class="o">.</span><span class="n">_comparator</span><span class="p">,</span>
416 <span class="n">adapt_to_entity</span><span class="p">)</span>
417
418 <span class="k">def</span> <span class="nf">__get__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">instance</span><span class="p">,</span> <span class="n">owner</span><span class="p">):</span>
419 <span class="k">if</span> <span class="n">instance</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
420 <span class="k">return</span> <span class="bp">self</span>
421 <span class="k">else</span><span class="p">:</span>
422 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">descriptor</span><span class="o">.</span><span class="n">__get__</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">owner</span><span class="p">)</span>
423
424 <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
425 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">.</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">class_</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
426
427 <span class="k">def</span> <span class="nf">__getattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attribute</span><span class="p">):</span>
428 <span class="sd">&quot;&quot;&quot;Delegate __getattr__ to the original descriptor and/or</span>
429 <span class="sd"> comparator.&quot;&quot;&quot;</span>
430
431 <span class="k">try</span><span class="p">:</span>
432 <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">descriptor</span><span class="p">,</span> <span class="n">attribute</span><span class="p">)</span>
433 <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
434 <span class="k">try</span><span class="p">:</span>
435 <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">,</span> <span class="n">attribute</span><span class="p">)</span>
436 <span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
437 <span class="k">raise</span> <span class="ne">AttributeError</span><span class="p">(</span>
438 <span class="s1">&#39;Neither </span><span class="si">%r</span><span class="s1"> object nor </span><span class="si">%r</span><span class="s1"> object associated with </span><span class="si">%s</span><span class="s1"> &#39;</span>
439 <span class="s1">&#39;has an attribute </span><span class="si">%r</span><span class="s1">&#39;</span> <span class="o">%</span> <span class="p">(</span>
440 <span class="nb">type</span><span class="p">(</span><span class="n">descriptor</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
441 <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comparator</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span>
442 <span class="bp">self</span><span class="p">,</span>
443 <span class="n">attribute</span><span class="p">)</span>
444 <span class="p">)</span>
445
446 <span class="n">Proxy</span><span class="o">.</span><span class="n">__name__</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">descriptor</span><span class="p">)</span><span class="o">.</span><span class="n">__name__</span> <span class="o">+</span> <span class="s1">&#39;Proxy&#39;</span>
447
448 <span class="n">util</span><span class="o">.</span><span class="n">monkeypatch_proxied_specials</span><span class="p">(</span><span class="n">Proxy</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">descriptor</span><span class="p">),</span>
449 <span class="n">name</span><span class="o">=</span><span class="s1">&#39;descriptor&#39;</span><span class="p">,</span>
450 <span class="n">from_instance</span><span class="o">=</span><span class="n">descriptor</span><span class="p">)</span>
451 <span class="k">return</span> <span class="n">Proxy</span>
452
453 <span class="n">OP_REMOVE</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">symbol</span><span class="p">(</span><span class="s2">&quot;REMOVE&quot;</span><span class="p">)</span>
454 <span class="n">OP_APPEND</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">symbol</span><span class="p">(</span><span class="s2">&quot;APPEND&quot;</span><span class="p">)</span>
455 <span class="n">OP_REPLACE</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">symbol</span><span class="p">(</span><span class="s2">&quot;REPLACE&quot;</span><span class="p">)</span>
456
457
458 <span class="k">class</span> <span class="nc">Event</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
459 <span class="sd">&quot;&quot;&quot;A token propagated throughout the course of a chain of attribute</span>
460 <span class="sd"> events.</span>
461
462 <span class="sd"> Serves as an indicator of the source of the event and also provides</span>
463 <span class="sd"> a means of controlling propagation across a chain of attribute</span>
464 <span class="sd"> operations.</span>
465
466 <span class="sd"> The :class:`.Event` object is sent as the ``initiator`` argument</span>
467 <span class="sd"> when dealing with the :meth:`.AttributeEvents.append`,</span>
468 <span class="sd"> :meth:`.AttributeEvents.set`,</span>
469 <span class="sd"> and :meth:`.AttributeEvents.remove` events.</span>
470
471 <span class="sd"> The :class:`.Event` object is currently interpreted by the backref</span>
472 <span class="sd"> event handlers, and is used to control the propagation of operations</span>
473 <span class="sd"> across two mutually-dependent attributes.</span>
474
475 <span class="sd"> .. versionadded:: 0.9.0</span>
476
477 <span class="sd"> :var impl: The :class:`.AttributeImpl` which is the current event</span>
478 <span class="sd"> initiator.</span>
479
480 <span class="sd"> :var op: The symbol :attr:`.OP_APPEND`, :attr:`.OP_REMOVE` or</span>
481 <span class="sd"> :attr:`.OP_REPLACE`, indicating the source operation.</span>
482
483 <span class="sd"> &quot;&quot;&quot;</span>
484
485 <span class="n">__slots__</span> <span class="o">=</span> <span class="s1">&#39;impl&#39;</span><span class="p">,</span> <span class="s1">&#39;op&#39;</span><span class="p">,</span> <span class="s1">&#39;parent_token&#39;</span>
486
487 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attribute_impl</span><span class="p">,</span> <span class="n">op</span><span class="p">):</span>
488 <span class="bp">self</span><span class="o">.</span><span class="n">impl</span> <span class="o">=</span> <span class="n">attribute_impl</span>
489 <span class="bp">self</span><span class="o">.</span><span class="n">op</span> <span class="o">=</span> <span class="n">op</span>
490 <span class="bp">self</span><span class="o">.</span><span class="n">parent_token</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">parent_token</span>
491
492 <span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
493 <span class="k">return</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">Event</span><span class="p">)</span> <span class="ow">and</span> \
494 <span class="n">other</span><span class="o">.</span><span class="n">impl</span> <span class="ow">is</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span> <span class="ow">and</span> \
495 <span class="n">other</span><span class="o">.</span><span class="n">op</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">op</span>
496
497 <span class="nd">@property</span>
498 <span class="k">def</span> <span class="nf">key</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
499 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">key</span>
500
501 <span class="k">def</span> <span class="nf">hasparent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">):</span>
502 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">hasparent</span><span class="p">(</span><span class="n">state</span><span class="p">)</span>
503
504
505 <span class="k">class</span> <span class="nc">AttributeImpl</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
506 <span class="sd">&quot;&quot;&quot;internal implementation for instrumented attributes.&quot;&quot;&quot;</span>
507
508 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span>
509 <span class="n">callable_</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span> <span class="n">trackparent</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
510 <span class="n">compare_function</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">active_history</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
511 <span class="n">parent_token</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">expire_missing</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
512 <span class="n">send_modified_events</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
513 <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
514 <span class="sd">&quot;&quot;&quot;Construct an AttributeImpl.</span>
515
516 <span class="sd"> \class_</span>
517 <span class="sd"> associated class</span>
518
519 <span class="sd"> key</span>
520 <span class="sd"> string name of the attribute</span>
521
522 <span class="sd"> \callable_</span>
523 <span class="sd"> optional function which generates a callable based on a parent</span>
524 <span class="sd"> instance, which produces the &quot;default&quot; values for a scalar or</span>
525 <span class="sd"> collection attribute when it&#39;s first accessed, if not present</span>
526 <span class="sd"> already.</span>
527
528 <span class="sd"> trackparent</span>
529 <span class="sd"> if True, attempt to track if an instance has a parent attached</span>
530 <span class="sd"> to it via this attribute.</span>
531
532 <span class="sd"> extension</span>
533 <span class="sd"> a single or list of AttributeExtension object(s) which will</span>
534 <span class="sd"> receive set/delete/append/remove/etc. events. Deprecated.</span>
535 <span class="sd"> The event package is now used.</span>
536
537 <span class="sd"> compare_function</span>
538 <span class="sd"> a function that compares two values which are normally</span>
539 <span class="sd"> assignable to this attribute.</span>
540
541 <span class="sd"> active_history</span>
542 <span class="sd"> indicates that get_history() should always return the &quot;old&quot; value,</span>
543 <span class="sd"> even if it means executing a lazy callable upon attribute change.</span>
544
545 <span class="sd"> parent_token</span>
546 <span class="sd"> Usually references the MapperProperty, used as a key for</span>
547 <span class="sd"> the hasparent() function to identify an &quot;owning&quot; attribute.</span>
548 <span class="sd"> Allows multiple AttributeImpls to all match a single</span>
549 <span class="sd"> owner attribute.</span>
550
551 <span class="sd"> expire_missing</span>
552 <span class="sd"> if False, don&#39;t add an &quot;expiry&quot; callable to this attribute</span>
553 <span class="sd"> during state.expire_attributes(None), if no value is present</span>
554 <span class="sd"> for this key.</span>
555
556 <span class="sd"> send_modified_events</span>
557 <span class="sd"> if False, the InstanceState._modified_event method will have no</span>
558 <span class="sd"> effect; this means the attribute will never show up as changed in a</span>
559 <span class="sd"> history entry.</span>
560 <span class="sd"> &quot;&quot;&quot;</span>
561 <span class="bp">self</span><span class="o">.</span><span class="n">class_</span> <span class="o">=</span> <span class="n">class_</span>
562 <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">key</span>
563 <span class="bp">self</span><span class="o">.</span><span class="n">callable_</span> <span class="o">=</span> <span class="n">callable_</span>
564 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span> <span class="o">=</span> <span class="n">dispatch</span>
565 <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span> <span class="o">=</span> <span class="n">trackparent</span>
566 <span class="bp">self</span><span class="o">.</span><span class="n">parent_token</span> <span class="o">=</span> <span class="n">parent_token</span> <span class="ow">or</span> <span class="bp">self</span>
567 <span class="bp">self</span><span class="o">.</span><span class="n">send_modified_events</span> <span class="o">=</span> <span class="n">send_modified_events</span>
568 <span class="k">if</span> <span class="n">compare_function</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
569 <span class="bp">self</span><span class="o">.</span><span class="n">is_equal</span> <span class="o">=</span> <span class="n">operator</span><span class="o">.</span><span class="n">eq</span>
570 <span class="k">else</span><span class="p">:</span>
571 <span class="bp">self</span><span class="o">.</span><span class="n">is_equal</span> <span class="o">=</span> <span class="n">compare_function</span>
572
573 <span class="c1"># TODO: pass in the manager here</span>
574 <span class="c1"># instead of doing a lookup</span>
575 <span class="n">attr</span> <span class="o">=</span> <span class="n">manager_of_class</span><span class="p">(</span><span class="n">class_</span><span class="p">)[</span><span class="n">key</span><span class="p">]</span>
576
577 <span class="k">for</span> <span class="n">ext</span> <span class="ow">in</span> <span class="n">util</span><span class="o">.</span><span class="n">to_list</span><span class="p">(</span><span class="n">extension</span> <span class="ow">or</span> <span class="p">[]):</span>
578 <span class="n">ext</span><span class="o">.</span><span class="n">_adapt_listener</span><span class="p">(</span><span class="n">attr</span><span class="p">,</span> <span class="n">ext</span><span class="p">)</span>
579
580 <span class="k">if</span> <span class="n">active_history</span><span class="p">:</span>
581 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span> <span class="o">=</span> <span class="kc">True</span>
582
583 <span class="bp">self</span><span class="o">.</span><span class="n">expire_missing</span> <span class="o">=</span> <span class="n">expire_missing</span>
584
585 <span class="n">__slots__</span> <span class="o">=</span> <span class="p">(</span>
586 <span class="s1">&#39;class_&#39;</span><span class="p">,</span> <span class="s1">&#39;key&#39;</span><span class="p">,</span> <span class="s1">&#39;callable_&#39;</span><span class="p">,</span> <span class="s1">&#39;dispatch&#39;</span><span class="p">,</span> <span class="s1">&#39;trackparent&#39;</span><span class="p">,</span>
587 <span class="s1">&#39;parent_token&#39;</span><span class="p">,</span> <span class="s1">&#39;send_modified_events&#39;</span><span class="p">,</span> <span class="s1">&#39;is_equal&#39;</span><span class="p">,</span> <span class="s1">&#39;expire_missing&#39;</span>
588 <span class="p">)</span>
589
590 <span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
591 <span class="k">return</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">.</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">class_</span><span class="o">.</span><span class="n">__name__</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
592
593 <span class="k">def</span> <span class="nf">_get_active_history</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
594 <span class="sd">&quot;&quot;&quot;Backwards compat for impl.active_history&quot;&quot;&quot;</span>
595
596 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span>
597
598 <span class="k">def</span> <span class="nf">_set_active_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
599 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span> <span class="o">=</span> <span class="n">value</span>
600
601 <span class="n">active_history</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">_get_active_history</span><span class="p">,</span> <span class="n">_set_active_history</span><span class="p">)</span>
602
603 <span class="k">def</span> <span class="nf">hasparent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">optimistic</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
604 <span class="sd">&quot;&quot;&quot;Return the boolean value of a `hasparent` flag attached to</span>
605 <span class="sd"> the given state.</span>
606
607 <span class="sd"> The `optimistic` flag determines what the default return value</span>
608 <span class="sd"> should be if no `hasparent` flag can be located.</span>
609
610 <span class="sd"> As this function is used to determine if an instance is an</span>
611 <span class="sd"> *orphan*, instances that were loaded from storage should be</span>
612 <span class="sd"> assumed to not be orphans, until a True/False value for this</span>
613 <span class="sd"> flag is set.</span>
614
615 <span class="sd"> An instance attribute that is loaded by a callable function</span>
616 <span class="sd"> will also not have a `hasparent` flag.</span>
617
618 <span class="sd"> &quot;&quot;&quot;</span>
619 <span class="n">msg</span> <span class="o">=</span> <span class="s2">&quot;This AttributeImpl is not configured to track parents.&quot;</span>
620 <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span><span class="p">,</span> <span class="n">msg</span>
621
622 <span class="k">return</span> <span class="n">state</span><span class="o">.</span><span class="n">parents</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="nb">id</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent_token</span><span class="p">),</span> <span class="n">optimistic</span><span class="p">)</span> \
623 <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span>
624
625 <span class="k">def</span> <span class="nf">sethasparent</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">parent_state</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
626 <span class="sd">&quot;&quot;&quot;Set a boolean flag on the given item corresponding to</span>
627 <span class="sd"> whether or not it is attached to a parent object via the</span>
628 <span class="sd"> attribute represented by this ``InstrumentedAttribute``.</span>
629
630 <span class="sd"> &quot;&quot;&quot;</span>
631 <span class="n">msg</span> <span class="o">=</span> <span class="s2">&quot;This AttributeImpl is not configured to track parents.&quot;</span>
632 <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span><span class="p">,</span> <span class="n">msg</span>
633
634 <span class="n">id_</span> <span class="o">=</span> <span class="nb">id</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">parent_token</span><span class="p">)</span>
635 <span class="k">if</span> <span class="n">value</span><span class="p">:</span>
636 <span class="n">state</span><span class="o">.</span><span class="n">parents</span><span class="p">[</span><span class="n">id_</span><span class="p">]</span> <span class="o">=</span> <span class="n">parent_state</span>
637 <span class="k">else</span><span class="p">:</span>
638 <span class="k">if</span> <span class="n">id_</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">parents</span><span class="p">:</span>
639 <span class="n">last_parent</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">parents</span><span class="p">[</span><span class="n">id_</span><span class="p">]</span>
640
641 <span class="k">if</span> <span class="n">last_parent</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">False</span> <span class="ow">and</span> \
642 <span class="n">last_parent</span><span class="o">.</span><span class="n">key</span> <span class="o">!=</span> <span class="n">parent_state</span><span class="o">.</span><span class="n">key</span><span class="p">:</span>
643
644 <span class="k">if</span> <span class="n">last_parent</span><span class="o">.</span><span class="n">obj</span><span class="p">()</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
645 <span class="k">raise</span> <span class="n">orm_exc</span><span class="o">.</span><span class="n">StaleDataError</span><span class="p">(</span>
646 <span class="s2">&quot;Removing state </span><span class="si">%s</span><span class="s2"> from parent &quot;</span>
647 <span class="s2">&quot;state </span><span class="si">%s</span><span class="s2"> along attribute &#39;</span><span class="si">%s</span><span class="s2">&#39;, &quot;</span>
648 <span class="s2">&quot;but the parent record &quot;</span>
649 <span class="s2">&quot;has gone stale, can&#39;t be sure this &quot;</span>
650 <span class="s2">&quot;is the most recent parent.&quot;</span> <span class="o">%</span>
651 <span class="p">(</span><span class="n">state_str</span><span class="p">(</span><span class="n">state</span><span class="p">),</span>
652 <span class="n">state_str</span><span class="p">(</span><span class="n">parent_state</span><span class="p">),</span>
653 <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">))</span>
654
655 <span class="k">return</span>
656
657 <span class="n">state</span><span class="o">.</span><span class="n">parents</span><span class="p">[</span><span class="n">id_</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
658
659 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
660 <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">()</span>
661
662 <span class="k">def</span> <span class="nf">get_all_pending</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_INITIALIZE</span><span class="p">):</span>
663 <span class="sd">&quot;&quot;&quot;Return a list of tuples of (state, obj)</span>
664 <span class="sd"> for all objects in this attribute&#39;s current state</span>
665 <span class="sd"> + history.</span>
666
667 <span class="sd"> Only applies to object-based attributes.</span>
668
669 <span class="sd"> This is an inlining of existing functionality</span>
670 <span class="sd"> which roughly corresponds to:</span>
671
672 <span class="sd"> get_state_history(</span>
673 <span class="sd"> state,</span>
674 <span class="sd"> key,</span>
675 <span class="sd"> passive=PASSIVE_NO_INITIALIZE).sum()</span>
676
677 <span class="sd"> &quot;&quot;&quot;</span>
678 <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">()</span>
679
680 <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">):</span>
681 <span class="sd">&quot;&quot;&quot;Initialize the given state&#39;s attribute with an empty value.&quot;&quot;&quot;</span>
682
683 <span class="c1"># As of 1.0, we don&#39;t actually set a value in</span>
684 <span class="c1"># dict_. This is so that the state of the object does not get</span>
685 <span class="c1"># modified without emitting the appropriate events.</span>
686
687
688 <span class="k">return</span> <span class="kc">None</span>
689
690 <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
691 <span class="sd">&quot;&quot;&quot;Retrieve a value from the given object.</span>
692 <span class="sd"> If a callable is assembled on this object&#39;s attribute, and</span>
693 <span class="sd"> passive is False, the callable will be executed and the</span>
694 <span class="sd"> resulting value will be set as the new value for this attribute.</span>
695 <span class="sd"> &quot;&quot;&quot;</span>
696 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
697 <span class="k">return</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
698 <span class="k">else</span><span class="p">:</span>
699 <span class="c1"># if history present, don&#39;t load</span>
700 <span class="n">key</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span>
701 <span class="k">if</span> <span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span> <span class="ow">or</span> \
702 <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
703 <span class="k">if</span> <span class="ow">not</span> <span class="n">passive</span> <span class="o">&amp;</span> <span class="n">CALLABLES_OK</span><span class="p">:</span>
704 <span class="k">return</span> <span class="n">PASSIVE_NO_RESULT</span>
705
706 <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">expired_attributes</span><span class="p">:</span>
707 <span class="n">value</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">_load_expired</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">passive</span><span class="p">)</span>
708 <span class="k">elif</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">callables</span><span class="p">:</span>
709 <span class="n">callable_</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">callables</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
710 <span class="n">value</span> <span class="o">=</span> <span class="n">callable_</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">passive</span><span class="p">)</span>
711 <span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">callable_</span><span class="p">:</span>
712 <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">callable_</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">passive</span><span class="p">)</span>
713 <span class="k">else</span><span class="p">:</span>
714 <span class="n">value</span> <span class="o">=</span> <span class="n">ATTR_EMPTY</span>
715
716 <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span> <span class="ow">or</span> <span class="n">value</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
717 <span class="k">return</span> <span class="n">value</span>
718 <span class="k">elif</span> <span class="n">value</span> <span class="ow">is</span> <span class="n">ATTR_WAS_SET</span><span class="p">:</span>
719 <span class="k">try</span><span class="p">:</span>
720 <span class="k">return</span> <span class="n">dict_</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
721 <span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
722 <span class="c1"># TODO: no test coverage here.</span>
723 <span class="k">raise</span> <span class="ne">KeyError</span><span class="p">(</span>
724 <span class="s2">&quot;Deferred loader for attribute &quot;</span>
725 <span class="s2">&quot;</span><span class="si">%r</span><span class="s2"> failed to populate &quot;</span>
726 <span class="s2">&quot;correctly&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
727 <span class="k">elif</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">ATTR_EMPTY</span><span class="p">:</span>
728 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">set_committed_value</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
729
730 <span class="k">if</span> <span class="ow">not</span> <span class="n">passive</span> <span class="o">&amp;</span> <span class="n">INIT_OK</span><span class="p">:</span>
731 <span class="k">return</span> <span class="n">NEVER_SET</span>
732 <span class="k">else</span><span class="p">:</span>
733 <span class="c1"># Return a new, empty value</span>
734 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
735
736 <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
737 <span class="bp">self</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
738
739 <span class="k">def</span> <span class="nf">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
740 <span class="bp">self</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
741 <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">,</span> <span class="n">check_old</span><span class="o">=</span><span class="n">value</span><span class="p">)</span>
742
743 <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
744 <span class="bp">self</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
745 <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">,</span> <span class="n">check_old</span><span class="o">=</span><span class="n">value</span><span class="p">,</span> <span class="n">pop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
746
747 <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
748 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">,</span> <span class="n">check_old</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pop</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
749 <span class="k">raise</span> <span class="ne">NotImplementedError</span><span class="p">()</span>
750
751 <span class="k">def</span> <span class="nf">get_committed_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
752 <span class="sd">&quot;&quot;&quot;return the unchanged value of this attribute&quot;&quot;&quot;</span>
753
754 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">:</span>
755 <span class="n">value</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
756 <span class="k">if</span> <span class="n">value</span> <span class="ow">in</span> <span class="p">(</span><span class="n">NO_VALUE</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">):</span>
757 <span class="k">return</span> <span class="kc">None</span>
758 <span class="k">else</span><span class="p">:</span>
759 <span class="k">return</span> <span class="n">value</span>
760 <span class="k">else</span><span class="p">:</span>
761 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
762
763 <span class="k">def</span> <span class="nf">set_committed_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
764 <span class="sd">&quot;&quot;&quot;set an attribute value on the given instance and &#39;commit&#39; it.&quot;&quot;&quot;</span>
765
766 <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
767 <span class="n">state</span><span class="o">.</span><span class="n">_commit</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">])</span>
768 <span class="k">return</span> <span class="n">value</span>
769
770
771 <span class="k">class</span> <span class="nc">ScalarAttributeImpl</span><span class="p">(</span><span class="n">AttributeImpl</span><span class="p">):</span>
772 <span class="sd">&quot;&quot;&quot;represents a scalar value-holding InstrumentedAttribute.&quot;&quot;&quot;</span>
773
774 <span class="n">accepts_scalar_loader</span> <span class="o">=</span> <span class="kc">True</span>
775 <span class="n">uses_objects</span> <span class="o">=</span> <span class="kc">False</span>
776 <span class="n">supports_population</span> <span class="o">=</span> <span class="kc">True</span>
777 <span class="n">collection</span> <span class="o">=</span> <span class="kc">False</span>
778
779 <span class="n">__slots__</span> <span class="o">=</span> <span class="s1">&#39;_replace_token&#39;</span><span class="p">,</span> <span class="s1">&#39;_append_token&#39;</span><span class="p">,</span> <span class="s1">&#39;_remove_token&#39;</span>
780
781 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">arg</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
782 <span class="nb">super</span><span class="p">(</span><span class="n">ScalarAttributeImpl</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="o">*</span><span class="n">arg</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
783 <span class="bp">self</span><span class="o">.</span><span class="n">_replace_token</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span> <span class="o">=</span> <span class="kc">None</span>
784 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="o">=</span> <span class="kc">None</span>
785
786 <span class="k">def</span> <span class="nf">_init_append_token</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
787 <span class="bp">self</span><span class="o">.</span><span class="n">_replace_token</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span> <span class="o">=</span> <span class="n">Event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">OP_REPLACE</span><span class="p">)</span>
788 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_replace_token</span>
789
790 <span class="n">_init_append_or_replace_token</span> <span class="o">=</span> <span class="n">_init_append_token</span>
791
792 <span class="k">def</span> <span class="nf">_init_remove_token</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
793 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="o">=</span> <span class="n">Event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">OP_REMOVE</span><span class="p">)</span>
794 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span>
795
796 <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">):</span>
797
798 <span class="c1"># TODO: catch key errors, convert to attributeerror?</span>
799 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span><span class="p">:</span>
800 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">PASSIVE_RETURN_NEVER_SET</span><span class="p">)</span>
801 <span class="k">else</span><span class="p">:</span>
802 <span class="n">old</span> <span class="o">=</span> <span class="n">dict_</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">NO_VALUE</span><span class="p">)</span>
803
804 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">remove</span><span class="p">:</span>
805 <span class="bp">self</span><span class="o">.</span><span class="n">fire_remove_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span><span class="p">)</span>
806 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">old</span><span class="p">)</span>
807 <span class="k">del</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
808
809 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
810 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
811 <span class="k">return</span> <span class="n">History</span><span class="o">.</span><span class="n">from_scalar_attribute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">])</span>
812 <span class="k">else</span><span class="p">:</span>
813 <span class="k">if</span> <span class="n">passive</span> <span class="o">&amp;</span> <span class="n">INIT_OK</span><span class="p">:</span>
814 <span class="n">passive</span> <span class="o">^=</span> <span class="n">INIT_OK</span>
815 <span class="n">current</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
816 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
817 <span class="k">return</span> <span class="n">HISTORY_BLANK</span>
818 <span class="k">else</span><span class="p">:</span>
819 <span class="k">return</span> <span class="n">History</span><span class="o">.</span><span class="n">from_scalar_attribute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">)</span>
820
821 <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
822 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">,</span> <span class="n">check_old</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pop</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
823 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span><span class="p">:</span>
824 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">PASSIVE_RETURN_NEVER_SET</span><span class="p">)</span>
825 <span class="k">else</span><span class="p">:</span>
826 <span class="n">old</span> <span class="o">=</span> <span class="n">dict_</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">NO_VALUE</span><span class="p">)</span>
827
828 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">set</span><span class="p">:</span>
829 <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fire_replace_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span>
830 <span class="n">value</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
831 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">old</span><span class="p">)</span>
832 <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
833
834 <span class="k">def</span> <span class="nf">fire_replace_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">previous</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
835 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">set</span><span class="p">:</span>
836 <span class="n">value</span> <span class="o">=</span> <span class="n">fn</span><span class="p">(</span>
837 <span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">previous</span><span class="p">,</span>
838 <span class="n">initiator</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_replace_token</span> <span class="ow">or</span>
839 <span class="bp">self</span><span class="o">.</span><span class="n">_init_append_or_replace_token</span><span class="p">())</span>
840 <span class="k">return</span> <span class="n">value</span>
841
842 <span class="k">def</span> <span class="nf">fire_remove_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
843 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">remove</span><span class="p">:</span>
844 <span class="n">fn</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
845 <span class="n">initiator</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_remove_token</span><span class="p">())</span>
846
847 <span class="nd">@property</span>
848 <span class="k">def</span> <span class="nf">type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
849 <span class="bp">self</span><span class="o">.</span><span class="n">property</span><span class="o">.</span><span class="n">columns</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">type</span>
850
851
852 <span class="k">class</span> <span class="nc">ScalarObjectAttributeImpl</span><span class="p">(</span><span class="n">ScalarAttributeImpl</span><span class="p">):</span>
853 <span class="sd">&quot;&quot;&quot;represents a scalar-holding InstrumentedAttribute,</span>
854 <span class="sd"> where the target object is also instrumented.</span>
855
856 <span class="sd"> Adds events to delete/set operations.</span>
857
858 <span class="sd"> &quot;&quot;&quot;</span>
859
860 <span class="n">accepts_scalar_loader</span> <span class="o">=</span> <span class="kc">False</span>
861 <span class="n">uses_objects</span> <span class="o">=</span> <span class="kc">True</span>
862 <span class="n">supports_population</span> <span class="o">=</span> <span class="kc">True</span>
863 <span class="n">collection</span> <span class="o">=</span> <span class="kc">False</span>
864
865 <span class="n">__slots__</span> <span class="o">=</span> <span class="p">()</span>
866
867 <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">):</span>
868 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
869 <span class="bp">self</span><span class="o">.</span><span class="n">fire_remove_event</span><span class="p">(</span>
870 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span>
871 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_remove_token</span><span class="p">())</span>
872 <span class="k">del</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
873
874 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
875 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
876 <span class="k">return</span> <span class="n">History</span><span class="o">.</span><span class="n">from_object_attribute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">])</span>
877 <span class="k">else</span><span class="p">:</span>
878 <span class="k">if</span> <span class="n">passive</span> <span class="o">&amp;</span> <span class="n">INIT_OK</span><span class="p">:</span>
879 <span class="n">passive</span> <span class="o">^=</span> <span class="n">INIT_OK</span>
880 <span class="n">current</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
881 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
882 <span class="k">return</span> <span class="n">HISTORY_BLANK</span>
883 <span class="k">else</span><span class="p">:</span>
884 <span class="k">return</span> <span class="n">History</span><span class="o">.</span><span class="n">from_object_attribute</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">)</span>
885
886 <span class="k">def</span> <span class="nf">get_all_pending</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_INITIALIZE</span><span class="p">):</span>
887 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
888 <span class="n">current</span> <span class="o">=</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
889 <span class="k">elif</span> <span class="n">passive</span> <span class="o">&amp;</span> <span class="n">CALLABLES_OK</span><span class="p">:</span>
890 <span class="n">current</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
891 <span class="k">else</span><span class="p">:</span>
892 <span class="k">return</span> <span class="p">[]</span>
893
894 <span class="c1"># can&#39;t use __hash__(), can&#39;t use __eq__() here</span>
895 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> \
896 <span class="n">current</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">PASSIVE_NO_RESULT</span> <span class="ow">and</span> \
897 <span class="n">current</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">NEVER_SET</span><span class="p">:</span>
898 <span class="n">ret</span> <span class="o">=</span> <span class="p">[(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">current</span><span class="p">),</span> <span class="n">current</span><span class="p">)]</span>
899 <span class="k">else</span><span class="p">:</span>
900 <span class="n">ret</span> <span class="o">=</span> <span class="p">[(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)]</span>
901
902 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">:</span>
903 <span class="n">original</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
904 <span class="k">if</span> <span class="n">original</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> \
905 <span class="n">original</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">PASSIVE_NO_RESULT</span> <span class="ow">and</span> \
906 <span class="n">original</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">NEVER_SET</span> <span class="ow">and</span> \
907 <span class="n">original</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">current</span><span class="p">:</span>
908
909 <span class="n">ret</span><span class="o">.</span><span class="n">append</span><span class="p">((</span><span class="n">instance_state</span><span class="p">(</span><span class="n">original</span><span class="p">),</span> <span class="n">original</span><span class="p">))</span>
910 <span class="k">return</span> <span class="n">ret</span>
911
912 <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
913 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">,</span> <span class="n">check_old</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">pop</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
914 <span class="sd">&quot;&quot;&quot;Set a value on the given InstanceState.</span>
915
916 <span class="sd"> &quot;&quot;&quot;</span>
917 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">_active_history</span><span class="p">:</span>
918 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
919 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_ONLY_PERSISTENT</span> <span class="o">|</span> <span class="n">NO_AUTOFLUSH</span><span class="p">)</span>
920 <span class="k">else</span><span class="p">:</span>
921 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_FETCH</span> <span class="o">^</span> <span class="n">INIT_OK</span><span class="p">)</span>
922
923 <span class="k">if</span> <span class="n">check_old</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> \
924 <span class="n">old</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">PASSIVE_NO_RESULT</span> <span class="ow">and</span> \
925 <span class="n">check_old</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">old</span><span class="p">:</span>
926 <span class="k">if</span> <span class="n">pop</span><span class="p">:</span>
927 <span class="k">return</span>
928 <span class="k">else</span><span class="p">:</span>
929 <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
930 <span class="s2">&quot;Object </span><span class="si">%s</span><span class="s2"> not associated with </span><span class="si">%s</span><span class="s2"> on attribute &#39;</span><span class="si">%s</span><span class="s2">&#39;&quot;</span> <span class="o">%</span> <span class="p">(</span>
931 <span class="n">instance_str</span><span class="p">(</span><span class="n">check_old</span><span class="p">),</span>
932 <span class="n">state_str</span><span class="p">(</span><span class="n">state</span><span class="p">),</span>
933 <span class="bp">self</span><span class="o">.</span><span class="n">key</span>
934 <span class="p">))</span>
935
936 <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fire_replace_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
937 <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span>
938
939 <span class="k">def</span> <span class="nf">fire_remove_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
940 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span> <span class="ow">and</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
941 <span class="bp">self</span><span class="o">.</span><span class="n">sethasparent</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">value</span><span class="p">),</span> <span class="n">state</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
942
943 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">remove</span><span class="p">:</span>
944 <span class="n">fn</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span> <span class="ow">or</span>
945 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_remove_token</span><span class="p">())</span>
946
947 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
948
949 <span class="k">def</span> <span class="nf">fire_replace_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">previous</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
950 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span><span class="p">:</span>
951 <span class="k">if</span> <span class="p">(</span><span class="n">previous</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">value</span> <span class="ow">and</span>
952 <span class="n">previous</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">)):</span>
953 <span class="bp">self</span><span class="o">.</span><span class="n">sethasparent</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">previous</span><span class="p">),</span> <span class="n">state</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
954
955 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">set</span><span class="p">:</span>
956 <span class="n">value</span> <span class="o">=</span> <span class="n">fn</span><span class="p">(</span>
957 <span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">previous</span><span class="p">,</span> <span class="n">initiator</span> <span class="ow">or</span>
958 <span class="bp">self</span><span class="o">.</span><span class="n">_replace_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_append_or_replace_token</span><span class="p">())</span>
959
960 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">previous</span><span class="p">)</span>
961
962 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span><span class="p">:</span>
963 <span class="k">if</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
964 <span class="bp">self</span><span class="o">.</span><span class="n">sethasparent</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">value</span><span class="p">),</span> <span class="n">state</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
965
966 <span class="k">return</span> <span class="n">value</span>
967
968
969 <span class="k">class</span> <span class="nc">CollectionAttributeImpl</span><span class="p">(</span><span class="n">AttributeImpl</span><span class="p">):</span>
970 <span class="sd">&quot;&quot;&quot;A collection-holding attribute that instruments changes in membership.</span>
971
972 <span class="sd"> Only handles collections of instrumented objects.</span>
973
974 <span class="sd"> InstrumentedCollectionAttribute holds an arbitrary, user-specified</span>
975 <span class="sd"> container object (defaulting to a list) and brokers access to the</span>
976 <span class="sd"> CollectionAdapter, a &quot;view&quot; onto that object that presents consistent bag</span>
977 <span class="sd"> semantics to the orm layer independent of the user data implementation.</span>
978
979 <span class="sd"> &quot;&quot;&quot;</span>
980 <span class="n">accepts_scalar_loader</span> <span class="o">=</span> <span class="kc">False</span>
981 <span class="n">uses_objects</span> <span class="o">=</span> <span class="kc">True</span>
982 <span class="n">supports_population</span> <span class="o">=</span> <span class="kc">True</span>
983 <span class="n">collection</span> <span class="o">=</span> <span class="kc">True</span>
984
985 <span class="n">__slots__</span> <span class="o">=</span> <span class="s1">&#39;copy&#39;</span><span class="p">,</span> <span class="s1">&#39;collection_factory&#39;</span><span class="p">,</span> <span class="s1">&#39;_append_token&#39;</span><span class="p">,</span> <span class="s1">&#39;_remove_token&#39;</span>
986
987 <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">callable_</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span>
988 <span class="n">typecallable</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">trackparent</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">extension</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
989 <span class="n">copy_function</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">compare_function</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
990 <span class="nb">super</span><span class="p">(</span><span class="n">CollectionAttributeImpl</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span>
991 <span class="n">class_</span><span class="p">,</span>
992 <span class="n">key</span><span class="p">,</span>
993 <span class="n">callable_</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span>
994 <span class="n">trackparent</span><span class="o">=</span><span class="n">trackparent</span><span class="p">,</span>
995 <span class="n">extension</span><span class="o">=</span><span class="n">extension</span><span class="p">,</span>
996 <span class="n">compare_function</span><span class="o">=</span><span class="n">compare_function</span><span class="p">,</span>
997 <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
998
999 <span class="k">if</span> <span class="n">copy_function</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
1000 <span class="n">copy_function</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">__copy</span>
1001 <span class="bp">self</span><span class="o">.</span><span class="n">copy</span> <span class="o">=</span> <span class="n">copy_function</span>
1002 <span class="bp">self</span><span class="o">.</span><span class="n">collection_factory</span> <span class="o">=</span> <span class="n">typecallable</span>
1003 <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span> <span class="o">=</span> <span class="kc">None</span>
1004 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="o">=</span> <span class="kc">None</span>
1005
1006 <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">collection_factory</span><span class="p">,</span> <span class="s2">&quot;_sa_linker&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">):</span>
1007
1008 <span class="nd">@event</span><span class="o">.</span><span class="n">listens_for</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;init_collection&quot;</span><span class="p">)</span>
1009 <span class="k">def</span> <span class="nf">link</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">collection</span><span class="p">,</span> <span class="n">collection_adapter</span><span class="p">):</span>
1010 <span class="n">collection</span><span class="o">.</span><span class="n">_sa_linker</span><span class="p">(</span><span class="n">collection_adapter</span><span class="p">)</span>
1011
1012 <span class="nd">@event</span><span class="o">.</span><span class="n">listens_for</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;dispose_collection&quot;</span><span class="p">)</span>
1013 <span class="k">def</span> <span class="nf">unlink</span><span class="p">(</span><span class="n">target</span><span class="p">,</span> <span class="n">collection</span><span class="p">,</span> <span class="n">collection_adapter</span><span class="p">):</span>
1014 <span class="n">collection</span><span class="o">.</span><span class="n">_sa_linker</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
1015
1016 <span class="k">def</span> <span class="nf">_init_append_token</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1017 <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span> <span class="o">=</span> <span class="n">Event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">OP_APPEND</span><span class="p">)</span>
1018 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span>
1019
1020 <span class="k">def</span> <span class="nf">_init_remove_token</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1021 <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="o">=</span> <span class="n">Event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">OP_REMOVE</span><span class="p">)</span>
1022 <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span>
1023
1024 <span class="k">def</span> <span class="nf">__copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
1025 <span class="k">return</span> <span class="p">[</span><span class="n">y</span> <span class="k">for</span> <span class="n">y</span> <span class="ow">in</span> <span class="n">collections</span><span class="o">.</span><span class="n">collection_adapter</span><span class="p">(</span><span class="n">item</span><span class="p">)]</span>
1026
1027 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1028 <span class="n">current</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
1029 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
1030 <span class="k">return</span> <span class="n">HISTORY_BLANK</span>
1031 <span class="k">else</span><span class="p">:</span>
1032 <span class="k">return</span> <span class="n">History</span><span class="o">.</span><span class="n">from_collection</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">)</span>
1033
1034 <span class="k">def</span> <span class="nf">get_all_pending</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_INITIALIZE</span><span class="p">):</span>
1035 <span class="c1"># NOTE: passive is ignored here at the moment</span>
1036
1037 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
1038 <span class="k">return</span> <span class="p">[]</span>
1039
1040 <span class="n">current</span> <span class="o">=</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
1041 <span class="n">current</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">current</span><span class="p">,</span> <span class="s1">&#39;_sa_adapter&#39;</span><span class="p">)</span>
1042
1043 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">:</span>
1044 <span class="n">original</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
1045 <span class="k">if</span> <span class="n">original</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">NO_VALUE</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">):</span>
1046 <span class="n">current_states</span> <span class="o">=</span> <span class="p">[((</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">and</span>
1047 <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span>
1048 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">current</span><span class="p">]</span>
1049 <span class="n">original_states</span> <span class="o">=</span> <span class="p">[((</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">and</span>
1050 <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span>
1051 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">original</span><span class="p">]</span>
1052
1053 <span class="n">current_set</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">current_states</span><span class="p">)</span>
1054 <span class="n">original_set</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">original_states</span><span class="p">)</span>
1055
1056 <span class="k">return</span> \
1057 <span class="p">[(</span><span class="n">s</span><span class="p">,</span> <span class="n">o</span><span class="p">)</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">current_states</span>
1058 <span class="k">if</span> <span class="n">s</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">original_set</span><span class="p">]</span> <span class="o">+</span> \
1059 <span class="p">[(</span><span class="n">s</span><span class="p">,</span> <span class="n">o</span><span class="p">)</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">current_states</span>
1060 <span class="k">if</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">original_set</span><span class="p">]</span> <span class="o">+</span> \
1061 <span class="p">[(</span><span class="n">s</span><span class="p">,</span> <span class="n">o</span><span class="p">)</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">original_states</span>
1062 <span class="k">if</span> <span class="n">s</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">current_set</span><span class="p">]</span>
1063
1064 <span class="k">return</span> <span class="p">[(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">o</span><span class="p">),</span> <span class="n">o</span><span class="p">)</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">current</span><span class="p">]</span>
1065
1066 <span class="k">def</span> <span class="nf">fire_append_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1067 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">append</span><span class="p">:</span>
1068 <span class="n">value</span> <span class="o">=</span> <span class="n">fn</span><span class="p">(</span>
1069 <span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
1070 <span class="n">initiator</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_append_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_append_token</span><span class="p">())</span>
1071
1072 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1073
1074 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span> <span class="ow">and</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
1075 <span class="bp">self</span><span class="o">.</span><span class="n">sethasparent</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">value</span><span class="p">),</span> <span class="n">state</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1076
1077 <span class="k">return</span> <span class="n">value</span>
1078
1079 <span class="k">def</span> <span class="nf">fire_pre_remove_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1080 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1081
1082 <span class="k">def</span> <span class="nf">fire_remove_event</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1083 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">trackparent</span> <span class="ow">and</span> <span class="n">value</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
1084 <span class="bp">self</span><span class="o">.</span><span class="n">sethasparent</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">value</span><span class="p">),</span> <span class="n">state</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
1085
1086 <span class="k">for</span> <span class="n">fn</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">remove</span><span class="p">:</span>
1087 <span class="n">fn</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
1088 <span class="n">initiator</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_remove_token</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_init_remove_token</span><span class="p">())</span>
1089
1090 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1091
1092 <span class="k">def</span> <span class="nf">delete</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">):</span>
1093 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">:</span>
1094 <span class="k">return</span>
1095
1096 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1097
1098 <span class="n">collection</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">state</span><span class="o">.</span><span class="n">dict</span><span class="p">)</span>
1099 <span class="n">collection</span><span class="o">.</span><span class="n">clear_with_event</span><span class="p">()</span>
1100 <span class="c1"># TODO: catch key errors, convert to attributeerror?</span>
1101 <span class="k">del</span> <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span>
1102
1103 <span class="k">def</span> <span class="nf">initialize</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">):</span>
1104 <span class="sd">&quot;&quot;&quot;Initialize this attribute with an empty collection.&quot;&quot;&quot;</span>
1105
1106 <span class="n">_</span><span class="p">,</span> <span class="n">user_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_initialize_collection</span><span class="p">(</span><span class="n">state</span><span class="p">)</span>
1107 <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">user_data</span>
1108 <span class="k">return</span> <span class="n">user_data</span>
1109
1110 <span class="k">def</span> <span class="nf">_initialize_collection</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">):</span>
1111
1112 <span class="n">adapter</span><span class="p">,</span> <span class="n">collection</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="o">.</span><span class="n">initialize_collection</span><span class="p">(</span>
1113 <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">collection_factory</span><span class="p">)</span>
1114
1115 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">init_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">collection</span><span class="p">,</span> <span class="n">adapter</span><span class="p">)</span>
1116
1117 <span class="k">return</span> <span class="n">adapter</span><span class="p">,</span> <span class="n">collection</span>
1118
1119 <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1120 <span class="n">collection</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
1121 <span class="k">if</span> <span class="n">collection</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
1122 <span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fire_append_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
1123 <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">,</span> \
1124 <span class="s2">&quot;Collection was loaded during event handling.&quot;</span>
1125 <span class="n">state</span><span class="o">.</span><span class="n">_get_pending_mutation</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
1126 <span class="k">else</span><span class="p">:</span>
1127 <span class="n">collection</span><span class="o">.</span><span class="n">append_with_event</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
1128
1129 <span class="k">def</span> <span class="nf">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1130 <span class="n">collection</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">state</span><span class="o">.</span><span class="n">dict</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
1131 <span class="k">if</span> <span class="n">collection</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
1132 <span class="bp">self</span><span class="o">.</span><span class="n">fire_remove_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
1133 <span class="k">assert</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">dict_</span><span class="p">,</span> \
1134 <span class="s2">&quot;Collection was loaded during event handling.&quot;</span>
1135 <span class="n">state</span><span class="o">.</span><span class="n">_get_pending_mutation</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
1136 <span class="k">else</span><span class="p">:</span>
1137 <span class="n">collection</span><span class="o">.</span><span class="n">remove_with_event</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">)</span>
1138
1139 <span class="k">def</span> <span class="nf">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1140 <span class="k">try</span><span class="p">:</span>
1141 <span class="c1"># TODO: better solution here would be to add</span>
1142 <span class="c1"># a &quot;popper&quot; role to collections.py to complement</span>
1143 <span class="c1"># &quot;remover&quot;.</span>
1144 <span class="bp">self</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
1145 <span class="k">except</span> <span class="p">(</span><span class="ne">ValueError</span><span class="p">,</span> <span class="ne">KeyError</span><span class="p">,</span> <span class="ne">IndexError</span><span class="p">):</span>
1146 <span class="k">pass</span>
1147
1148 <span class="k">def</span> <span class="nf">set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span>
1149 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">,</span> <span class="n">pop</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
1150 <span class="sd">&quot;&quot;&quot;Set a value on the given object.</span>
1151
1152 <span class="sd"> &quot;&quot;&quot;</span>
1153
1154 <span class="bp">self</span><span class="o">.</span><span class="n">_set_iterable</span><span class="p">(</span>
1155 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span>
1156 <span class="k">lambda</span> <span class="n">adapter</span><span class="p">,</span> <span class="n">i</span><span class="p">:</span> <span class="n">adapter</span><span class="o">.</span><span class="n">adapt_like_to_iterable</span><span class="p">(</span><span class="n">i</span><span class="p">))</span>
1157
1158 <span class="k">def</span> <span class="nf">_set_iterable</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">iterable</span><span class="p">,</span> <span class="n">adapter</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1159 <span class="sd">&quot;&quot;&quot;Set a collection value from an iterable of state-bearers.</span>
1160
1161 <span class="sd"> ``adapter`` is an optional callable invoked with a CollectionAdapter</span>
1162 <span class="sd"> and the iterable. Should return an iterable of state-bearing</span>
1163 <span class="sd"> instances suitable for appending via a CollectionAdapter. Can be used</span>
1164 <span class="sd"> for, e.g., adapting an incoming dictionary into an iterator of values</span>
1165 <span class="sd"> rather than keys.</span>
1166
1167 <span class="sd"> &quot;&quot;&quot;</span>
1168 <span class="c1"># pulling a new collection first so that an adaptation exception does</span>
1169 <span class="c1"># not trigger a lazy load of the old collection.</span>
1170 <span class="n">new_collection</span><span class="p">,</span> <span class="n">user_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_initialize_collection</span><span class="p">(</span><span class="n">state</span><span class="p">)</span>
1171 <span class="k">if</span> <span class="n">adapter</span><span class="p">:</span>
1172 <span class="n">new_values</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">adapter</span><span class="p">(</span><span class="n">new_collection</span><span class="p">,</span> <span class="n">iterable</span><span class="p">))</span>
1173 <span class="k">else</span><span class="p">:</span>
1174 <span class="n">new_values</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">iterable</span><span class="p">)</span>
1175
1176 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_ONLY_PERSISTENT</span><span class="p">)</span>
1177 <span class="k">if</span> <span class="n">old</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
1178 <span class="n">old</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
1179 <span class="k">elif</span> <span class="n">old</span> <span class="ow">is</span> <span class="n">iterable</span><span class="p">:</span>
1180 <span class="c1"># ignore re-assignment of the current collection, as happens</span>
1181 <span class="c1"># implicitly with in-place operators (foo.collection |= other)</span>
1182 <span class="k">return</span>
1183
1184 <span class="c1"># place a copy of &quot;old&quot; in state.committed_state</span>
1185 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1186
1187 <span class="n">old_collection</span> <span class="o">=</span> <span class="n">old</span><span class="o">.</span><span class="n">_sa_adapter</span>
1188
1189 <span class="n">dict_</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">user_data</span>
1190
1191 <span class="n">collections</span><span class="o">.</span><span class="n">bulk_replace</span><span class="p">(</span><span class="n">new_values</span><span class="p">,</span> <span class="n">old_collection</span><span class="p">,</span> <span class="n">new_collection</span><span class="p">)</span>
1192
1193 <span class="k">del</span> <span class="n">old</span><span class="o">.</span><span class="n">_sa_adapter</span>
1194 <span class="bp">self</span><span class="o">.</span><span class="n">dispatch</span><span class="o">.</span><span class="n">dispose_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">old</span><span class="p">,</span> <span class="n">old_collection</span><span class="p">)</span>
1195
1196 <span class="k">def</span> <span class="nf">_invalidate_collection</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">collection</span><span class="p">):</span>
1197 <span class="n">adapter</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">collection</span><span class="p">,</span> <span class="s1">&#39;_sa_adapter&#39;</span><span class="p">)</span>
1198 <span class="n">adapter</span><span class="o">.</span><span class="n">invalidated</span> <span class="o">=</span> <span class="kc">True</span>
1199
1200 <span class="k">def</span> <span class="nf">set_committed_value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
1201 <span class="sd">&quot;&quot;&quot;Set an attribute value on the given instance and &#39;commit&#39; it.&quot;&quot;&quot;</span>
1202
1203 <span class="n">collection</span><span class="p">,</span> <span class="n">user_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_initialize_collection</span><span class="p">(</span><span class="n">state</span><span class="p">)</span>
1204
1205 <span class="k">if</span> <span class="n">value</span><span class="p">:</span>
1206 <span class="n">collection</span><span class="o">.</span><span class="n">append_multiple_without_event</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
1207
1208 <span class="n">state</span><span class="o">.</span><span class="n">dict</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">user_data</span>
1209
1210 <span class="n">state</span><span class="o">.</span><span class="n">_commit</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">])</span>
1211
1212 <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">in</span> <span class="n">state</span><span class="o">.</span><span class="n">_pending_mutations</span><span class="p">:</span>
1213 <span class="c1"># pending items exist. issue a modified event,</span>
1214 <span class="c1"># add/remove new items.</span>
1215 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="bp">self</span><span class="p">,</span> <span class="n">user_data</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
1216
1217 <span class="n">pending</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">_pending_mutations</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
1218 <span class="n">added</span> <span class="o">=</span> <span class="n">pending</span><span class="o">.</span><span class="n">added_items</span>
1219 <span class="n">removed</span> <span class="o">=</span> <span class="n">pending</span><span class="o">.</span><span class="n">deleted_items</span>
1220 <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">added</span><span class="p">:</span>
1221 <span class="n">collection</span><span class="o">.</span><span class="n">append_without_event</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
1222 <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">removed</span><span class="p">:</span>
1223 <span class="n">collection</span><span class="o">.</span><span class="n">remove_without_event</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
1224
1225 <span class="k">return</span> <span class="n">user_data</span>
1226
1227 <span class="k">def</span> <span class="nf">get_collection</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span>
1228 <span class="n">user_data</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1229 <span class="sd">&quot;&quot;&quot;Retrieve the CollectionAdapter associated with the given state.</span>
1230
1231 <span class="sd"> Creates a new CollectionAdapter if one does not exist.</span>
1232
1233 <span class="sd"> &quot;&quot;&quot;</span>
1234 <span class="k">if</span> <span class="n">user_data</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
1235 <span class="n">user_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">passive</span><span class="p">)</span>
1236 <span class="k">if</span> <span class="n">user_data</span> <span class="ow">is</span> <span class="n">PASSIVE_NO_RESULT</span><span class="p">:</span>
1237 <span class="k">return</span> <span class="n">user_data</span>
1238
1239 <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">user_data</span><span class="p">,</span> <span class="s1">&#39;_sa_adapter&#39;</span><span class="p">)</span>
1240
1241
1242 <span class="k">def</span> <span class="nf">backref_listeners</span><span class="p">(</span><span class="n">attribute</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">uselist</span><span class="p">):</span>
1243 <span class="sd">&quot;&quot;&quot;Apply listeners to synchronize a two-way relationship.&quot;&quot;&quot;</span>
1244
1245 <span class="c1"># use easily recognizable names for stack traces</span>
1246
1247 <span class="n">parent_token</span> <span class="o">=</span> <span class="n">attribute</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">parent_token</span>
1248 <span class="n">parent_impl</span> <span class="o">=</span> <span class="n">attribute</span><span class="o">.</span><span class="n">impl</span>
1249
1250 <span class="k">def</span> <span class="nf">_acceptable_key_err</span><span class="p">(</span><span class="n">child_state</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">child_impl</span><span class="p">):</span>
1251 <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
1252 <span class="s2">&quot;Bidirectional attribute conflict detected: &quot;</span>
1253 <span class="s1">&#39;Passing object </span><span class="si">%s</span><span class="s1"> to attribute &quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span>
1254 <span class="s1">&#39;triggers a modify event on attribute &quot;</span><span class="si">%s</span><span class="s1">&quot; &#39;</span>
1255 <span class="s1">&#39;via the backref &quot;</span><span class="si">%s</span><span class="s1">&quot;.&#39;</span> <span class="o">%</span> <span class="p">(</span>
1256 <span class="n">state_str</span><span class="p">(</span><span class="n">child_state</span><span class="p">),</span>
1257 <span class="n">initiator</span><span class="o">.</span><span class="n">parent_token</span><span class="p">,</span>
1258 <span class="n">child_impl</span><span class="o">.</span><span class="n">parent_token</span><span class="p">,</span>
1259 <span class="n">attribute</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">parent_token</span>
1260 <span class="p">)</span>
1261 <span class="p">)</span>
1262
1263 <span class="k">def</span> <span class="nf">emit_backref_from_scalar_set_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">child</span><span class="p">,</span> <span class="n">oldchild</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1264 <span class="k">if</span> <span class="n">oldchild</span> <span class="ow">is</span> <span class="n">child</span><span class="p">:</span>
1265 <span class="k">return</span> <span class="n">child</span>
1266 <span class="k">if</span> <span class="n">oldchild</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> \
1267 <span class="n">oldchild</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">PASSIVE_NO_RESULT</span> <span class="ow">and</span> \
1268 <span class="n">oldchild</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1269 <span class="c1"># With lazy=None, there&#39;s no guarantee that the full collection is</span>
1270 <span class="c1"># present when updating via a backref.</span>
1271 <span class="n">old_state</span><span class="p">,</span> <span class="n">old_dict</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">oldchild</span><span class="p">),</span>\
1272 <span class="n">instance_dict</span><span class="p">(</span><span class="n">oldchild</span><span class="p">)</span>
1273 <span class="n">impl</span> <span class="o">=</span> <span class="n">old_state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1274
1275 <span class="k">if</span> <span class="n">initiator</span><span class="o">.</span><span class="n">impl</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">impl</span> <span class="ow">or</span> \
1276 <span class="n">initiator</span><span class="o">.</span><span class="n">op</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">OP_REPLACE</span><span class="p">,</span> <span class="n">OP_REMOVE</span><span class="p">):</span>
1277 <span class="n">impl</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">old_state</span><span class="p">,</span>
1278 <span class="n">old_dict</span><span class="p">,</span>
1279 <span class="n">state</span><span class="o">.</span><span class="n">obj</span><span class="p">(),</span>
1280 <span class="n">parent_impl</span><span class="o">.</span><span class="n">_append_token</span> <span class="ow">or</span>
1281 <span class="n">parent_impl</span><span class="o">.</span><span class="n">_init_append_token</span><span class="p">(),</span>
1282 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_FETCH</span><span class="p">)</span>
1283
1284 <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
1285 <span class="n">child_state</span><span class="p">,</span> <span class="n">child_dict</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">child</span><span class="p">),</span>\
1286 <span class="n">instance_dict</span><span class="p">(</span><span class="n">child</span><span class="p">)</span>
1287 <span class="n">child_impl</span> <span class="o">=</span> <span class="n">child_state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1288 <span class="k">if</span> <span class="n">initiator</span><span class="o">.</span><span class="n">parent_token</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">parent_token</span> <span class="ow">and</span> \
1289 <span class="n">initiator</span><span class="o">.</span><span class="n">parent_token</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">child_impl</span><span class="o">.</span><span class="n">parent_token</span><span class="p">:</span>
1290 <span class="n">_acceptable_key_err</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">child_impl</span><span class="p">)</span>
1291 <span class="k">elif</span> <span class="n">initiator</span><span class="o">.</span><span class="n">impl</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">child_impl</span> <span class="ow">or</span> \
1292 <span class="n">initiator</span><span class="o">.</span><span class="n">op</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">OP_APPEND</span><span class="p">,</span> <span class="n">OP_REPLACE</span><span class="p">):</span>
1293 <span class="n">child_impl</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
1294 <span class="n">child_state</span><span class="p">,</span>
1295 <span class="n">child_dict</span><span class="p">,</span>
1296 <span class="n">state</span><span class="o">.</span><span class="n">obj</span><span class="p">(),</span>
1297 <span class="n">initiator</span><span class="p">,</span>
1298 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_FETCH</span><span class="p">)</span>
1299 <span class="k">return</span> <span class="n">child</span>
1300
1301 <span class="k">def</span> <span class="nf">emit_backref_from_collection_append_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">child</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1302 <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
1303 <span class="k">return</span>
1304
1305 <span class="n">child_state</span><span class="p">,</span> <span class="n">child_dict</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">child</span><span class="p">),</span> \
1306 <span class="n">instance_dict</span><span class="p">(</span><span class="n">child</span><span class="p">)</span>
1307 <span class="n">child_impl</span> <span class="o">=</span> <span class="n">child_state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1308
1309 <span class="k">if</span> <span class="n">initiator</span><span class="o">.</span><span class="n">parent_token</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">parent_token</span> <span class="ow">and</span> \
1310 <span class="n">initiator</span><span class="o">.</span><span class="n">parent_token</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">child_impl</span><span class="o">.</span><span class="n">parent_token</span><span class="p">:</span>
1311 <span class="n">_acceptable_key_err</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">initiator</span><span class="p">,</span> <span class="n">child_impl</span><span class="p">)</span>
1312 <span class="k">elif</span> <span class="n">initiator</span><span class="o">.</span><span class="n">impl</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">child_impl</span> <span class="ow">or</span> \
1313 <span class="n">initiator</span><span class="o">.</span><span class="n">op</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">OP_APPEND</span><span class="p">,</span> <span class="n">OP_REPLACE</span><span class="p">):</span>
1314 <span class="n">child_impl</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
1315 <span class="n">child_state</span><span class="p">,</span>
1316 <span class="n">child_dict</span><span class="p">,</span>
1317 <span class="n">state</span><span class="o">.</span><span class="n">obj</span><span class="p">(),</span>
1318 <span class="n">initiator</span><span class="p">,</span>
1319 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_FETCH</span><span class="p">)</span>
1320 <span class="k">return</span> <span class="n">child</span>
1321
1322 <span class="k">def</span> <span class="nf">emit_backref_from_collection_remove_event</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">child</span><span class="p">,</span> <span class="n">initiator</span><span class="p">):</span>
1323 <span class="k">if</span> <span class="n">child</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
1324 <span class="n">child_state</span><span class="p">,</span> <span class="n">child_dict</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">child</span><span class="p">),</span>\
1325 <span class="n">instance_dict</span><span class="p">(</span><span class="n">child</span><span class="p">)</span>
1326 <span class="n">child_impl</span> <span class="o">=</span> <span class="n">child_state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1327 <span class="k">if</span> <span class="n">initiator</span><span class="o">.</span><span class="n">impl</span> <span class="ow">is</span> <span class="ow">not</span> <span class="n">child_impl</span> <span class="ow">or</span> \
1328 <span class="n">initiator</span><span class="o">.</span><span class="n">op</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="n">OP_REMOVE</span><span class="p">,</span> <span class="n">OP_REPLACE</span><span class="p">):</span>
1329 <span class="n">child_impl</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span>
1330 <span class="n">child_state</span><span class="p">,</span>
1331 <span class="n">child_dict</span><span class="p">,</span>
1332 <span class="n">state</span><span class="o">.</span><span class="n">obj</span><span class="p">(),</span>
1333 <span class="n">initiator</span><span class="p">,</span>
1334 <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_NO_FETCH</span><span class="p">)</span>
1335
1336 <span class="k">if</span> <span class="n">uselist</span><span class="p">:</span>
1337 <span class="n">event</span><span class="o">.</span><span class="n">listen</span><span class="p">(</span><span class="n">attribute</span><span class="p">,</span> <span class="s2">&quot;append&quot;</span><span class="p">,</span>
1338 <span class="n">emit_backref_from_collection_append_event</span><span class="p">,</span>
1339 <span class="n">retval</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">raw</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
1340 <span class="k">else</span><span class="p">:</span>
1341 <span class="n">event</span><span class="o">.</span><span class="n">listen</span><span class="p">(</span><span class="n">attribute</span><span class="p">,</span> <span class="s2">&quot;set&quot;</span><span class="p">,</span>
1342 <span class="n">emit_backref_from_scalar_set_event</span><span class="p">,</span>
1343 <span class="n">retval</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">raw</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
1344 <span class="c1"># TODO: need coverage in test/orm/ of remove event</span>
1345 <span class="n">event</span><span class="o">.</span><span class="n">listen</span><span class="p">(</span><span class="n">attribute</span><span class="p">,</span> <span class="s2">&quot;remove&quot;</span><span class="p">,</span>
1346 <span class="n">emit_backref_from_collection_remove_event</span><span class="p">,</span>
1347 <span class="n">retval</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">raw</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
1348
1349 <span class="n">_NO_HISTORY</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">symbol</span><span class="p">(</span><span class="s1">&#39;NO_HISTORY&#39;</span><span class="p">)</span>
1350 <span class="n">_NO_STATE_SYMBOLS</span> <span class="o">=</span> <span class="nb">frozenset</span><span class="p">([</span>
1351 <span class="nb">id</span><span class="p">(</span><span class="n">PASSIVE_NO_RESULT</span><span class="p">),</span>
1352 <span class="nb">id</span><span class="p">(</span><span class="n">NO_VALUE</span><span class="p">),</span>
1353 <span class="nb">id</span><span class="p">(</span><span class="n">NEVER_SET</span><span class="p">)])</span>
1354
1355 <span class="n">History</span> <span class="o">=</span> <span class="n">util</span><span class="o">.</span><span class="n">namedtuple</span><span class="p">(</span><span class="s2">&quot;History&quot;</span><span class="p">,</span> <span class="p">[</span>
1356 <span class="s2">&quot;added&quot;</span><span class="p">,</span> <span class="s2">&quot;unchanged&quot;</span><span class="p">,</span> <span class="s2">&quot;deleted&quot;</span>
1357 <span class="p">])</span>
1358
1359
1360 <span class="k">class</span> <span class="nc">History</span><span class="p">(</span><span class="n">History</span><span class="p">):</span>
1361 <span class="sd">&quot;&quot;&quot;A 3-tuple of added, unchanged and deleted values,</span>
1362 <span class="sd"> representing the changes which have occurred on an instrumented</span>
1363 <span class="sd"> attribute.</span>
1364
1365 <span class="sd"> The easiest way to get a :class:`.History` object for a particular</span>
1366 <span class="sd"> attribute on an object is to use the :func:`.inspect` function::</span>
1367
1368 <span class="sd"> from sqlalchemy import inspect</span>
1369
1370 <span class="sd"> hist = inspect(myobject).attrs.myattribute.history</span>
1371
1372 <span class="sd"> Each tuple member is an iterable sequence:</span>
1373
1374 <span class="sd"> * ``added`` - the collection of items added to the attribute (the first</span>
1375 <span class="sd"> tuple element).</span>
1376
1377 <span class="sd"> * ``unchanged`` - the collection of items that have not changed on the</span>
1378 <span class="sd"> attribute (the second tuple element).</span>
1379
1380 <span class="sd"> * ``deleted`` - the collection of items that have been removed from the</span>
1381 <span class="sd"> attribute (the third tuple element).</span>
1382
1383 <span class="sd"> &quot;&quot;&quot;</span>
1384
1385 <span class="k">def</span> <span class="nf">__bool__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1386 <span class="k">return</span> <span class="bp">self</span> <span class="o">!=</span> <span class="n">HISTORY_BLANK</span>
1387 <span class="n">__nonzero__</span> <span class="o">=</span> <span class="n">__bool__</span>
1388
1389 <span class="k">def</span> <span class="nf">empty</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1390 <span class="sd">&quot;&quot;&quot;Return True if this :class:`.History` has no changes</span>
1391 <span class="sd"> and no existing, unchanged state.</span>
1392
1393 <span class="sd"> &quot;&quot;&quot;</span>
1394
1395 <span class="k">return</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span>
1396 <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">added</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">deleted</span><span class="p">)</span>
1397 <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">unchanged</span>
1398 <span class="p">)</span>
1399
1400 <span class="k">def</span> <span class="nf">sum</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1401 <span class="sd">&quot;&quot;&quot;Return a collection of added + unchanged + deleted.&quot;&quot;&quot;</span>
1402
1403 <span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">added</span> <span class="ow">or</span> <span class="p">[])</span> <span class="o">+</span>\
1404 <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">unchanged</span> <span class="ow">or</span> <span class="p">[])</span> <span class="o">+</span>\
1405 <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">deleted</span> <span class="ow">or</span> <span class="p">[])</span>
1406
1407 <span class="k">def</span> <span class="nf">non_deleted</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1408 <span class="sd">&quot;&quot;&quot;Return a collection of added + unchanged.&quot;&quot;&quot;</span>
1409
1410 <span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">added</span> <span class="ow">or</span> <span class="p">[])</span> <span class="o">+</span>\
1411 <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">unchanged</span> <span class="ow">or</span> <span class="p">[])</span>
1412
1413 <span class="k">def</span> <span class="nf">non_added</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1414 <span class="sd">&quot;&quot;&quot;Return a collection of unchanged + deleted.&quot;&quot;&quot;</span>
1415
1416 <span class="k">return</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">unchanged</span> <span class="ow">or</span> <span class="p">[])</span> <span class="o">+</span>\
1417 <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">deleted</span> <span class="ow">or</span> <span class="p">[])</span>
1418
1419 <span class="k">def</span> <span class="nf">has_changes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1420 <span class="sd">&quot;&quot;&quot;Return True if this :class:`.History` has changes.&quot;&quot;&quot;</span>
1421
1422 <span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">added</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">deleted</span><span class="p">)</span>
1423
1424 <span class="k">def</span> <span class="nf">as_state</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
1425 <span class="k">return</span> <span class="n">History</span><span class="p">(</span>
1426 <span class="p">[(</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span>
1427 <span class="ow">and</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span>
1428 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">added</span><span class="p">],</span>
1429 <span class="p">[(</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span>
1430 <span class="ow">and</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span>
1431 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">unchanged</span><span class="p">],</span>
1432 <span class="p">[(</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span>
1433 <span class="ow">and</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="ow">or</span> <span class="kc">None</span>
1434 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">deleted</span><span class="p">],</span>
1435 <span class="p">)</span>
1436
1437 <span class="nd">@classmethod</span>
1438 <span class="k">def</span> <span class="nf">from_scalar_attribute</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">attribute</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">):</span>
1439 <span class="n">original</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attribute</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">_NO_HISTORY</span><span class="p">)</span>
1440
1441 <span class="k">if</span> <span class="n">original</span> <span class="ow">is</span> <span class="n">_NO_HISTORY</span><span class="p">:</span>
1442 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1443 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">(),</span> <span class="p">())</span>
1444 <span class="k">else</span><span class="p">:</span>
1445 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">[</span><span class="n">current</span><span class="p">],</span> <span class="p">())</span>
1446 <span class="c1"># don&#39;t let ClauseElement expressions here trip things up</span>
1447 <span class="k">elif</span> <span class="n">attribute</span><span class="o">.</span><span class="n">is_equal</span><span class="p">(</span><span class="n">current</span><span class="p">,</span> <span class="n">original</span><span class="p">)</span> <span class="ow">is</span> <span class="kc">True</span><span class="p">:</span>
1448 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">[</span><span class="n">current</span><span class="p">],</span> <span class="p">())</span>
1449 <span class="k">else</span><span class="p">:</span>
1450 <span class="c1"># current convention on native scalars is to not</span>
1451 <span class="c1"># include information</span>
1452 <span class="c1"># about missing previous value in &quot;deleted&quot;, but</span>
1453 <span class="c1"># we do include None, which helps in some primary</span>
1454 <span class="c1"># key situations</span>
1455 <span class="k">if</span> <span class="nb">id</span><span class="p">(</span><span class="n">original</span><span class="p">)</span> <span class="ow">in</span> <span class="n">_NO_STATE_SYMBOLS</span><span class="p">:</span>
1456 <span class="n">deleted</span> <span class="o">=</span> <span class="p">()</span>
1457 <span class="k">else</span><span class="p">:</span>
1458 <span class="n">deleted</span> <span class="o">=</span> <span class="p">[</span><span class="n">original</span><span class="p">]</span>
1459 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1460 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">(),</span> <span class="n">deleted</span><span class="p">)</span>
1461 <span class="k">else</span><span class="p">:</span>
1462 <span class="k">return</span> <span class="n">cls</span><span class="p">([</span><span class="n">current</span><span class="p">],</span> <span class="p">(),</span> <span class="n">deleted</span><span class="p">)</span>
1463
1464 <span class="nd">@classmethod</span>
1465 <span class="k">def</span> <span class="nf">from_object_attribute</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">attribute</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">):</span>
1466 <span class="n">original</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attribute</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">_NO_HISTORY</span><span class="p">)</span>
1467
1468 <span class="k">if</span> <span class="n">original</span> <span class="ow">is</span> <span class="n">_NO_HISTORY</span><span class="p">:</span>
1469 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NO_VALUE</span> <span class="ow">or</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1470 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">(),</span> <span class="p">())</span>
1471 <span class="k">else</span><span class="p">:</span>
1472 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">[</span><span class="n">current</span><span class="p">],</span> <span class="p">())</span>
1473 <span class="k">elif</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">original</span><span class="p">:</span>
1474 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">[</span><span class="n">current</span><span class="p">],</span> <span class="p">())</span>
1475 <span class="k">else</span><span class="p">:</span>
1476 <span class="c1"># current convention on related objects is to not</span>
1477 <span class="c1"># include information</span>
1478 <span class="c1"># about missing previous value in &quot;deleted&quot;, and</span>
1479 <span class="c1"># to also not include None - the dependency.py rules</span>
1480 <span class="c1"># ignore the None in any case.</span>
1481 <span class="k">if</span> <span class="nb">id</span><span class="p">(</span><span class="n">original</span><span class="p">)</span> <span class="ow">in</span> <span class="n">_NO_STATE_SYMBOLS</span> <span class="ow">or</span> <span class="n">original</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
1482 <span class="n">deleted</span> <span class="o">=</span> <span class="p">()</span>
1483 <span class="k">else</span><span class="p">:</span>
1484 <span class="n">deleted</span> <span class="o">=</span> <span class="p">[</span><span class="n">original</span><span class="p">]</span>
1485 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NO_VALUE</span> <span class="ow">or</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1486 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">(),</span> <span class="n">deleted</span><span class="p">)</span>
1487 <span class="k">else</span><span class="p">:</span>
1488 <span class="k">return</span> <span class="n">cls</span><span class="p">([</span><span class="n">current</span><span class="p">],</span> <span class="p">(),</span> <span class="n">deleted</span><span class="p">)</span>
1489
1490 <span class="nd">@classmethod</span>
1491 <span class="k">def</span> <span class="nf">from_collection</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">attribute</span><span class="p">,</span> <span class="n">state</span><span class="p">,</span> <span class="n">current</span><span class="p">):</span>
1492 <span class="n">original</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">committed_state</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attribute</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">_NO_HISTORY</span><span class="p">)</span>
1493
1494 <span class="k">if</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NO_VALUE</span> <span class="ow">or</span> <span class="n">current</span> <span class="ow">is</span> <span class="n">NEVER_SET</span><span class="p">:</span>
1495 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="p">(),</span> <span class="p">())</span>
1496
1497 <span class="n">current</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">current</span><span class="p">,</span> <span class="s1">&#39;_sa_adapter&#39;</span><span class="p">)</span>
1498 <span class="k">if</span> <span class="n">original</span> <span class="ow">in</span> <span class="p">(</span><span class="n">NO_VALUE</span><span class="p">,</span> <span class="n">NEVER_SET</span><span class="p">):</span>
1499 <span class="k">return</span> <span class="n">cls</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">current</span><span class="p">),</span> <span class="p">(),</span> <span class="p">())</span>
1500 <span class="k">elif</span> <span class="n">original</span> <span class="ow">is</span> <span class="n">_NO_HISTORY</span><span class="p">:</span>
1501 <span class="k">return</span> <span class="n">cls</span><span class="p">((),</span> <span class="nb">list</span><span class="p">(</span><span class="n">current</span><span class="p">),</span> <span class="p">())</span>
1502 <span class="k">else</span><span class="p">:</span>
1503
1504 <span class="n">current_states</span> <span class="o">=</span> <span class="p">[((</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">and</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
1505 <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span>
1506 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">current</span>
1507 <span class="p">]</span>
1508 <span class="n">original_states</span> <span class="o">=</span> <span class="p">[((</span><span class="n">c</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">and</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">c</span><span class="p">)</span>
1509 <span class="ow">or</span> <span class="kc">None</span><span class="p">,</span> <span class="n">c</span><span class="p">)</span>
1510 <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">original</span>
1511 <span class="p">]</span>
1512
1513 <span class="n">current_set</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">current_states</span><span class="p">)</span>
1514 <span class="n">original_set</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</span><span class="n">original_states</span><span class="p">)</span>
1515
1516 <span class="k">return</span> <span class="n">cls</span><span class="p">(</span>
1517 <span class="p">[</span><span class="n">o</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">current_states</span> <span class="k">if</span> <span class="n">s</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">original_set</span><span class="p">],</span>
1518 <span class="p">[</span><span class="n">o</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">current_states</span> <span class="k">if</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">original_set</span><span class="p">],</span>
1519 <span class="p">[</span><span class="n">o</span> <span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">original_states</span> <span class="k">if</span> <span class="n">s</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">current_set</span><span class="p">]</span>
1520 <span class="p">)</span>
1521
1522 <span class="n">HISTORY_BLANK</span> <span class="o">=</span> <span class="n">History</span><span class="p">(</span><span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1523
1524
1525 <span class="k">def</span> <span class="nf">get_history</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1526 <span class="sd">&quot;&quot;&quot;Return a :class:`.History` record for the given object</span>
1527 <span class="sd"> and attribute key.</span>
1528
1529 <span class="sd"> :param obj: an object whose class is instrumented by the</span>
1530 <span class="sd"> attributes package.</span>
1531
1532 <span class="sd"> :param key: string attribute name.</span>
1533
1534 <span class="sd"> :param passive: indicates loading behavior for the attribute</span>
1535 <span class="sd"> if the value is not already present. This is a</span>
1536 <span class="sd"> bitflag attribute, which defaults to the symbol</span>
1537 <span class="sd"> :attr:`.PASSIVE_OFF` indicating all necessary SQL</span>
1538 <span class="sd"> should be emitted.</span>
1539
1540 <span class="sd"> &quot;&quot;&quot;</span>
1541 <span class="k">if</span> <span class="n">passive</span> <span class="ow">is</span> <span class="kc">True</span><span class="p">:</span>
1542 <span class="n">util</span><span class="o">.</span><span class="n">warn_deprecated</span><span class="p">(</span><span class="s2">&quot;Passing True for &#39;passive&#39; is deprecated. &quot;</span>
1543 <span class="s2">&quot;Use attributes.PASSIVE_NO_INITIALIZE&quot;</span><span class="p">)</span>
1544 <span class="n">passive</span> <span class="o">=</span> <span class="n">PASSIVE_NO_INITIALIZE</span>
1545 <span class="k">elif</span> <span class="n">passive</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span>
1546 <span class="n">util</span><span class="o">.</span><span class="n">warn_deprecated</span><span class="p">(</span><span class="s2">&quot;Passing False for &#39;passive&#39; is &quot;</span>
1547 <span class="s2">&quot;deprecated. Use attributes.PASSIVE_OFF&quot;</span><span class="p">)</span>
1548 <span class="n">passive</span> <span class="o">=</span> <span class="n">PASSIVE_OFF</span>
1549
1550 <span class="k">return</span> <span class="n">get_state_history</span><span class="p">(</span><span class="n">instance_state</span><span class="p">(</span><span class="n">obj</span><span class="p">),</span> <span class="n">key</span><span class="p">,</span> <span class="n">passive</span><span class="p">)</span>
1551
1552
1553 <span class="k">def</span> <span class="nf">get_state_history</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">passive</span><span class="o">=</span><span class="n">PASSIVE_OFF</span><span class="p">):</span>
1554 <span class="k">return</span> <span class="n">state</span><span class="o">.</span><span class="n">get_history</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">passive</span><span class="p">)</span>
1555
1556
1557 <span class="k">def</span> <span class="nf">has_parent</span><span class="p">(</span><span class="n">cls</span><span class="p">,</span> <span class="n">obj</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">optimistic</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
1558 <span class="sd">&quot;&quot;&quot;TODO&quot;&quot;&quot;</span>
1559 <span class="n">manager</span> <span class="o">=</span> <span class="n">manager_of_class</span><span class="p">(</span><span class="n">cls</span><span class="p">)</span>
1560 <span class="n">state</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
1561 <span class="k">return</span> <span class="n">manager</span><span class="o">.</span><span class="n">has_parent</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">optimistic</span><span class="p">)</span>
1562
1563
1564 <span class="k">def</span> <span class="nf">register_attribute</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
1565 <span class="n">comparator</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;comparator&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1566 <span class="n">parententity</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;parententity&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1567 <span class="n">doc</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;doc&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1568 <span class="n">desc</span> <span class="o">=</span> <span class="n">register_descriptor</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span>
1569 <span class="n">comparator</span><span class="p">,</span> <span class="n">parententity</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="n">doc</span><span class="p">)</span>
1570 <span class="n">register_attribute_impl</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
1571 <span class="k">return</span> <span class="n">desc</span>
1572
1573
1574 <span class="k">def</span> <span class="nf">register_attribute_impl</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span>
1575 <span class="n">uselist</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">callable_</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1576 <span class="n">useobject</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
1577 <span class="n">impl_class</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">backref</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
1578
1579 <span class="n">manager</span> <span class="o">=</span> <span class="n">manager_of_class</span><span class="p">(</span><span class="n">class_</span><span class="p">)</span>
1580 <span class="k">if</span> <span class="n">uselist</span><span class="p">:</span>
1581 <span class="n">factory</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;typecallable&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1582 <span class="n">typecallable</span> <span class="o">=</span> <span class="n">manager</span><span class="o">.</span><span class="n">instrument_collection_class</span><span class="p">(</span>
1583 <span class="n">key</span><span class="p">,</span> <span class="n">factory</span> <span class="ow">or</span> <span class="nb">list</span><span class="p">)</span>
1584 <span class="k">else</span><span class="p">:</span>
1585 <span class="n">typecallable</span> <span class="o">=</span> <span class="n">kw</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;typecallable&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1586
1587 <span class="n">dispatch</span> <span class="o">=</span> <span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">dispatch</span>
1588
1589 <span class="k">if</span> <span class="n">impl_class</span><span class="p">:</span>
1590 <span class="n">impl</span> <span class="o">=</span> <span class="n">impl_class</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">typecallable</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
1591 <span class="k">elif</span> <span class="n">uselist</span><span class="p">:</span>
1592 <span class="n">impl</span> <span class="o">=</span> <span class="n">CollectionAttributeImpl</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">callable_</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span>
1593 <span class="n">typecallable</span><span class="o">=</span><span class="n">typecallable</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
1594 <span class="k">elif</span> <span class="n">useobject</span><span class="p">:</span>
1595 <span class="n">impl</span> <span class="o">=</span> <span class="n">ScalarObjectAttributeImpl</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">callable_</span><span class="p">,</span>
1596 <span class="n">dispatch</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
1597 <span class="k">else</span><span class="p">:</span>
1598 <span class="n">impl</span> <span class="o">=</span> <span class="n">ScalarAttributeImpl</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">callable_</span><span class="p">,</span> <span class="n">dispatch</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">)</span>
1599
1600 <span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span> <span class="o">=</span> <span class="n">impl</span>
1601
1602 <span class="k">if</span> <span class="n">backref</span><span class="p">:</span>
1603 <span class="n">backref_listeners</span><span class="p">(</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">],</span> <span class="n">backref</span><span class="p">,</span> <span class="n">uselist</span><span class="p">)</span>
1604
1605 <span class="n">manager</span><span class="o">.</span><span class="n">post_configure_attribute</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
1606 <span class="k">return</span> <span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span>
1607
1608
1609 <span class="k">def</span> <span class="nf">register_descriptor</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">comparator</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
1610 <span class="n">parententity</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
1611 <span class="n">manager</span> <span class="o">=</span> <span class="n">manager_of_class</span><span class="p">(</span><span class="n">class_</span><span class="p">)</span>
1612
1613 <span class="n">descriptor</span> <span class="o">=</span> <span class="n">InstrumentedAttribute</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">comparator</span><span class="o">=</span><span class="n">comparator</span><span class="p">,</span>
1614 <span class="n">parententity</span><span class="o">=</span><span class="n">parententity</span><span class="p">)</span>
1615
1616 <span class="n">descriptor</span><span class="o">.</span><span class="n">__doc__</span> <span class="o">=</span> <span class="n">doc</span>
1617
1618 <span class="n">manager</span><span class="o">.</span><span class="n">instrument_attribute</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">descriptor</span><span class="p">)</span>
1619 <span class="k">return</span> <span class="n">descriptor</span>
1620
1621
1622 <span class="k">def</span> <span class="nf">unregister_attribute</span><span class="p">(</span><span class="n">class_</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1623 <span class="n">manager_of_class</span><span class="p">(</span><span class="n">class_</span><span class="p">)</span><span class="o">.</span><span class="n">uninstrument_attribute</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
1624
1625
1626 <span class="k">def</span> <span class="nf">init_collection</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1627 <span class="sd">&quot;&quot;&quot;Initialize a collection attribute and return the collection adapter.</span>
1628
1629 <span class="sd"> This function is used to provide direct access to collection internals</span>
1630 <span class="sd"> for a previously unloaded attribute. e.g.::</span>
1631
1632 <span class="sd"> collection_adapter = init_collection(someobject, &#39;elements&#39;)</span>
1633 <span class="sd"> for elem in values:</span>
1634 <span class="sd"> collection_adapter.append_without_event(elem)</span>
1635
1636 <span class="sd"> For an easier way to do the above, see</span>
1637 <span class="sd"> :func:`~sqlalchemy.orm.attributes.set_committed_value`.</span>
1638
1639 <span class="sd"> obj is an instrumented object instance. An InstanceState</span>
1640 <span class="sd"> is accepted directly for backwards compatibility but</span>
1641 <span class="sd"> this usage is deprecated.</span>
1642
1643 <span class="sd"> &quot;&quot;&quot;</span>
1644 <span class="n">state</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
1645 <span class="n">dict_</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">dict</span>
1646 <span class="k">return</span> <span class="n">init_state_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">key</span><span class="p">)</span>
1647
1648
1649 <span class="k">def</span> <span class="nf">init_state_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1650 <span class="sd">&quot;&quot;&quot;Initialize a collection attribute and return the collection adapter.&quot;&quot;&quot;</span>
1651
1652 <span class="n">attr</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1653 <span class="n">user_data</span> <span class="o">=</span> <span class="n">attr</span><span class="o">.</span><span class="n">initialize</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
1654 <span class="k">return</span> <span class="n">attr</span><span class="o">.</span><span class="n">get_collection</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">user_data</span><span class="p">)</span>
1655
1656
1657 <span class="k">def</span> <span class="nf">set_committed_value</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
1658 <span class="sd">&quot;&quot;&quot;Set the value of an attribute with no history events.</span>
1659
1660 <span class="sd"> Cancels any previous history present. The value should be</span>
1661 <span class="sd"> a scalar value for scalar-holding attributes, or</span>
1662 <span class="sd"> an iterable for any collection-holding attribute.</span>
1663
1664 <span class="sd"> This is the same underlying method used when a lazy loader</span>
1665 <span class="sd"> fires off and loads additional data from the database.</span>
1666 <span class="sd"> In particular, this method can be used by application code</span>
1667 <span class="sd"> which has loaded additional attributes or collections through</span>
1668 <span class="sd"> separate queries, which can then be attached to an instance</span>
1669 <span class="sd"> as though it were part of its original loaded state.</span>
1670
1671 <span class="sd"> &quot;&quot;&quot;</span>
1672 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
1673 <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">set_committed_value</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
1674
1675
1676 <span class="k">def</span> <span class="nf">set_attribute</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
1677 <span class="sd">&quot;&quot;&quot;Set the value of an attribute, firing history events.</span>
1678
1679 <span class="sd"> This function may be used regardless of instrumentation</span>
1680 <span class="sd"> applied directly to the class, i.e. no descriptors are required.</span>
1681 <span class="sd"> Custom attribute management schemes will need to make usage</span>
1682 <span class="sd"> of this method to establish attribute state as understood</span>
1683 <span class="sd"> by SQLAlchemy.</span>
1684
1685 <span class="sd"> &quot;&quot;&quot;</span>
1686 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
1687 <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
1688
1689
1690 <span class="k">def</span> <span class="nf">get_attribute</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1691 <span class="sd">&quot;&quot;&quot;Get the value of an attribute, firing any callables required.</span>
1692
1693 <span class="sd"> This function may be used regardless of instrumentation</span>
1694 <span class="sd"> applied directly to the class, i.e. no descriptors are required.</span>
1695 <span class="sd"> Custom attribute management schemes will need to make usage</span>
1696 <span class="sd"> of this method to make usage of attribute state as understood</span>
1697 <span class="sd"> by SQLAlchemy.</span>
1698
1699 <span class="sd"> &quot;&quot;&quot;</span>
1700 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
1701 <span class="k">return</span> <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
1702
1703
1704 <span class="k">def</span> <span class="nf">del_attribute</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1705 <span class="sd">&quot;&quot;&quot;Delete the value of an attribute, firing history events.</span>
1706
1707 <span class="sd"> This function may be used regardless of instrumentation</span>
1708 <span class="sd"> applied directly to the class, i.e. no descriptors are required.</span>
1709 <span class="sd"> Custom attribute management schemes will need to make usage</span>
1710 <span class="sd"> of this method to establish attribute state as understood</span>
1711 <span class="sd"> by SQLAlchemy.</span>
1712
1713 <span class="sd"> &quot;&quot;&quot;</span>
1714 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
1715 <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span><span class="o">.</span><span class="n">delete</span><span class="p">(</span><span class="n">state</span><span class="p">,</span> <span class="n">dict_</span><span class="p">)</span>
1716
1717
1718 <span class="k">def</span> <span class="nf">flag_modified</span><span class="p">(</span><span class="n">instance</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
1719 <span class="sd">&quot;&quot;&quot;Mark an attribute on an instance as &#39;modified&#39;.</span>
1720
1721 <span class="sd"> This sets the &#39;modified&#39; flag on the instance and</span>
1722 <span class="sd"> establishes an unconditional change event for the given attribute.</span>
1723
1724 <span class="sd"> &quot;&quot;&quot;</span>
1725 <span class="n">state</span><span class="p">,</span> <span class="n">dict_</span> <span class="o">=</span> <span class="n">instance_state</span><span class="p">(</span><span class="n">instance</span><span class="p">),</span> <span class="n">instance_dict</span><span class="p">(</span><span class="n">instance</span><span class="p">)</span>
1726 <span class="n">impl</span> <span class="o">=</span> <span class="n">state</span><span class="o">.</span><span class="n">manager</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span>
1727 <span class="n">state</span><span class="o">.</span><span class="n">_modified_event</span><span class="p">(</span><span class="n">dict_</span><span class="p">,</span> <span class="n">impl</span><span class="p">,</span> <span class="n">NO_VALUE</span><span class="p">,</span> <span class="n">force</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
1728 </pre></div>
1729
1730 </div>
1731 </div>
1732 <footer>
1733
1734
1735 <hr/>
1736
1737 <div role="contentinfo">
1738 <p>
1739 &copy; Copyright 2016, Infobyte.
1740
1741 </p>
1742 </div>
1743 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
1744
1745 </footer>
1746
1747 </div>
1748 </div>
1749
1750 </section>
1751
1752 </div>
1753
1754
1755
1756
1757
1758 <script type="text/javascript">
1759 var DOCUMENTATION_OPTIONS = {
1760 URL_ROOT:'../../../',
1761 VERSION:'0.1',
1762 COLLAPSE_INDEX:false,
1763 FILE_SUFFIX:'.html',
1764 HAS_SOURCE: true
1765 };
1766 </script>
1767 <script type="text/javascript" src="../../../_static/jquery.js"></script>
1768 <script type="text/javascript" src="../../../_static/underscore.js"></script>
1769 <script type="text/javascript" src="../../../_static/doctools.js"></script>
1770
1771
1772
1773
1774
1775 <script type="text/javascript" src="../../../_static/js/theme.js"></script>
1776
1777
1778
1779
1780 <script type="text/javascript">
1781 jQuery(function () {
1782 SphinxRtdTheme.StickyNav.enable();
1783 });
1784 </script>
1785
1786
1787 </body>
1788 </html>
0 .. Faraday documentation master file, created by
1 sphinx-quickstart on Fri Dec 9 14:53:21 2016.
2 You can adapt this file completely to your liking, but it should at least
3 contain the root `toctree` directive.
4
5 Welcome to Faraday's documentation!
6 ===================================
7
8 Contents:
9
10 .. toctree::
11 :maxdepth: 2
12
13
14
15 Indices and tables
16 ==================
17
18 * :ref:`genindex`
19 * :ref:`modindex`
20 * :ref:`search`
21
0 .. Faraday documentation master file, created by
1 sphinx-quickstart on Fri Dec 9 14:53:21 2016.
2 You can adapt this file completely to your liking, but it should at least
3 contain the root `toctree` directive.
4
5 Welcome to Faraday's documentation!
6 ===================================
7
8 Contents:
9
10 .. toctree::
11 :maxdepth: 2
12
13
14
15 Indices and tables
16 ==================
17
18 * :ref:`genindex`
19 * :ref:`modindex`
20 * :ref:`search`
21
0 server
1 ======
2
3 .. toctree::
4 :maxdepth: 4
5
6 server
0 server
1 ======
2
3 .. toctree::
4 :maxdepth: 4
5
6 server
0 server package
1 ==============
2
3 Submodules
4 ----------
5
6 server.utils module
7 -------------------
8
9 .. automodule:: persistence.server.server
10 :members:
11 :undoc-members:
12 :show-inheritance:
0 server package
1 ==============
2
3 Submodules
4 ----------
5
6 server.changes_stream module
7 ----------------------------
8
9 .. automodule:: server.changes_stream
10 :members:
11 :undoc-members:
12 :show-inheritance:
13
14 server.conf module
15 ------------------
16
17 .. automodule:: server.conf
18 :members:
19 :undoc-members:
20 :show-inheritance:
21
22 server.models module
23 --------------------
24
25 .. automodule:: server.models
26 :members:
27 :undoc-members:
28 :show-inheritance:
29
30 server.server module
31 --------------------
32
33 .. automodule:: server.server
34 :members:
35 :undoc-members:
36 :show-inheritance:
37
38 server.server_io_exceptions module
39 ----------------------------------
40
41 .. automodule:: server.server_io_exceptions
42 :members:
43 :undoc-members:
44 :show-inheritance:
45
46 server.utils module
47 -------------------
48
49 .. automodule:: server.utils
50 :members:
51 :undoc-members:
52 :show-inheritance:
53
54
55 Module contents
56 ---------------
57
58 .. automodule:: server
59 :members:
60 :undoc-members:
61 :show-inheritance:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 @import url("basic.css");
53
54 /* -- page layout ----------------------------------------------------------- */
55
56 body {
57 font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
58 font-size: 17px;
59 background-color: #fff;
60 color: #000;
61 margin: 0;
62 padding: 0;
63 }
64
65
66 div.document {
67 width: 940px;
68 margin: 30px auto 0 auto;
69 }
70
71 div.documentwrapper {
72 float: left;
73 width: 100%;
74 }
75
76 div.bodywrapper {
77 margin: 0 0 0 220px;
78 }
79
80 div.sphinxsidebar {
81 width: 220px;
82 font-size: 14px;
83 line-height: 1.5;
84 }
85
86 hr {
87 border: 1px solid #B1B4B6;
88 }
89
90 div.body {
91 background-color: #fff;
92 color: #3E4349;
93 padding: 0 30px 0 30px;
94 }
95
96 div.body > .section {
97 text-align: left;
98 }
99
100 div.footer {
101 width: 940px;
102 margin: 20px auto 30px auto;
103 font-size: 14px;
104 color: #888;
105 text-align: right;
106 }
107
108 div.footer a {
109 color: #888;
110 }
111
112 p.caption {
113 font-family: inherit;
114 font-size: inherit;
115 }
116
117
118 div.relations {
119 display: none;
120 }
121
122
123 div.sphinxsidebar a {
124 color: #444;
125 text-decoration: none;
126 border-bottom: 1px dotted #999;
127 }
128
129 div.sphinxsidebar a:hover {
130 border-bottom: 1px solid #999;
131 }
132
133 div.sphinxsidebarwrapper {
134 padding: 18px 10px;
135 }
136
137 div.sphinxsidebarwrapper p.logo {
138 padding: 0;
139 margin: -10px 0 0 0px;
140 text-align: center;
141 }
142
143 div.sphinxsidebarwrapper h1.logo {
144 margin-top: -10px;
145 text-align: center;
146 margin-bottom: 5px;
147 text-align: left;
148 }
149
150 div.sphinxsidebarwrapper h1.logo-name {
151 margin-top: 0px;
152 }
153
154 div.sphinxsidebarwrapper p.blurb {
155 margin-top: 0;
156 font-style: normal;
157 }
158
159 div.sphinxsidebar h3,
160 div.sphinxsidebar h4 {
161 font-family: 'Garamond', 'Georgia', serif;
162 color: #444;
163 font-size: 24px;
164 font-weight: normal;
165 margin: 0 0 5px 0;
166 padding: 0;
167 }
168
169 div.sphinxsidebar h4 {
170 font-size: 20px;
171 }
172
173 div.sphinxsidebar h3 a {
174 color: #444;
175 }
176
177 div.sphinxsidebar p.logo a,
178 div.sphinxsidebar h3 a,
179 div.sphinxsidebar p.logo a:hover,
180 div.sphinxsidebar h3 a:hover {
181 border: none;
182 }
183
184 div.sphinxsidebar p {
185 color: #555;
186 margin: 10px 0;
187 }
188
189 div.sphinxsidebar ul {
190 margin: 10px 0;
191 padding: 0;
192 color: #000;
193 }
194
195 div.sphinxsidebar ul li.toctree-l1 > a {
196 font-size: 120%;
197 }
198
199 div.sphinxsidebar ul li.toctree-l2 > a {
200 font-size: 110%;
201 }
202
203 div.sphinxsidebar input {
204 border: 1px solid #CCC;
205 font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro', serif;
206 font-size: 1em;
207 }
208
209 div.sphinxsidebar hr {
210 border: none;
211 height: 1px;
212 color: #AAA;
213 background: #AAA;
214
215 text-align: left;
216 margin-left: 0;
217 width: 50%;
218 }
219
220 /* -- body styles ----------------------------------------------------------- */
221
222 a {
223 color: #004B6B;
224 text-decoration: underline;
225 }
226
227 a:hover {
228 color: #6D4100;
229 text-decoration: underline;
230 }
231
232 div.body h1,
233 div.body h2,
234 div.body h3,
235 div.body h4,
236 div.body h5,
237 div.body h6 {
238 font-family: 'Garamond', 'Georgia', serif;
239 font-weight: normal;
240 margin: 30px 0px 10px 0px;
241 padding: 0;
242 }
243
244 div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }
245 div.body h2 { font-size: 180%; }
246 div.body h3 { font-size: 150%; }
247 div.body h4 { font-size: 130%; }
248 div.body h5 { font-size: 100%; }
249 div.body h6 { font-size: 100%; }
250
251 a.headerlink {
252 color: #DDD;
253 padding: 0 4px;
254 text-decoration: none;
255 }
256
257 a.headerlink:hover {
258 color: #444;
259 background: #EAEAEA;
260 }
261
262 div.body p, div.body dd, div.body li {
263 line-height: 1.4em;
264 }
265
266 div.admonition {
267 margin: 20px 0px;
268 padding: 10px 30px;
269 background-color: #EEE;
270 border: 1px solid #CCC;
271 }
272
273 div.admonition tt.xref, div.admonition code.xref, div.admonition a tt {
274 background-color: ;
275 border-bottom: 1px solid #fafafa;
276 }
277
278 dd div.admonition {
279 margin-left: -60px;
280 padding-left: 60px;
281 }
282
283 div.admonition p.admonition-title {
284 font-family: 'Garamond', 'Georgia', serif;
285 font-weight: normal;
286 font-size: 24px;
287 margin: 0 0 10px 0;
288 padding: 0;
289 line-height: 1;
290 }
291
292 div.admonition p.last {
293 margin-bottom: 0;
294 }
295
296 div.highlight {
297 background-color: #fff;
298 }
299
300 dt:target, .highlight {
301 background: #FAF3E8;
302 }
303
304 div.warning {
305 background-color: #FCC;
306 border: 1px solid #FAA;
307 }
308
309 div.danger {
310 background-color: #FCC;
311 border: 1px solid #FAA;
312 -moz-box-shadow: 2px 2px 4px #D52C2C;
313 -webkit-box-shadow: 2px 2px 4px #D52C2C;
314 box-shadow: 2px 2px 4px #D52C2C;
315 }
316
317 div.error {
318 background-color: #FCC;
319 border: 1px solid #FAA;
320 -moz-box-shadow: 2px 2px 4px #D52C2C;
321 -webkit-box-shadow: 2px 2px 4px #D52C2C;
322 box-shadow: 2px 2px 4px #D52C2C;
323 }
324
325 div.caution {
326 background-color: #FCC;
327 border: 1px solid #FAA;
328 }
329
330 div.attention {
331 background-color: #FCC;
332 border: 1px solid #FAA;
333 }
334
335 div.important {
336 background-color: #EEE;
337 border: 1px solid #CCC;
338 }
339
340 div.note {
341 background-color: #EEE;
342 border: 1px solid #CCC;
343 }
344
345 div.tip {
346 background-color: #EEE;
347 border: 1px solid #CCC;
348 }
349
350 div.hint {
351 background-color: #EEE;
352 border: 1px solid #CCC;
353 }
354
355 div.seealso {
356 background-color: #EEE;
357 border: 1px solid #CCC;
358 }
359
360 div.topic {
361 background-color: #EEE;
362 }
363
364 p.admonition-title {
365 display: inline;
366 }
367
368 p.admonition-title:after {
369 content: ":";
370 }
371
372 pre, tt, code {
373 font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
374 font-size: 0.9em;
375 }
376
377 .hll {
378 background-color: #FFC;
379 margin: 0 -12px;
380 padding: 0 12px;
381 display: block;
382 }
383
384 img.screenshot {
385 }
386
387 tt.descname, tt.descclassname, code.descname, code.descclassname {
388 font-size: 0.95em;
389 }
390
391 tt.descname, code.descname {
392 padding-right: 0.08em;
393 }
394
395 img.screenshot {
396 -moz-box-shadow: 2px 2px 4px #EEE;
397 -webkit-box-shadow: 2px 2px 4px #EEE;
398 box-shadow: 2px 2px 4px #EEE;
399 }
400
401 table.docutils {
402 border: 1px solid #888;
403 -moz-box-shadow: 2px 2px 4px #EEE;
404 -webkit-box-shadow: 2px 2px 4px #EEE;
405 box-shadow: 2px 2px 4px #EEE;
406 }
407
408 table.docutils td, table.docutils th {
409 border: 1px solid #888;
410 padding: 0.25em 0.7em;
411 }
412
413 table.field-list, table.footnote {
414 border: none;
415 -moz-box-shadow: none;
416 -webkit-box-shadow: none;
417 box-shadow: none;
418 }
419
420 table.footnote {
421 margin: 15px 0;
422 width: 100%;
423 border: 1px solid #EEE;
424 background: #FDFDFD;
425 font-size: 0.9em;
426 }
427
428 table.footnote + table.footnote {
429 margin-top: -15px;
430 border-top: none;
431 }
432
433 table.field-list th {
434 padding: 0 0.8em 0 0;
435 }
436
437 table.field-list td {
438 padding: 0;
439 }
440
441 table.field-list p {
442 margin-bottom: 0.8em;
443 }
444
445 table.footnote td.label {
446 width: .1px;
447 padding: 0.3em 0 0.3em 0.5em;
448 }
449
450 table.footnote td {
451 padding: 0.3em 0.5em;
452 }
453
454 dl {
455 margin: 0;
456 padding: 0;
457 }
458
459 dl dd {
460 margin-left: 30px;
461 }
462
463 blockquote {
464 margin: 0 0 0 30px;
465 padding: 0;
466 }
467
468 ul, ol {
469 /* Matches the 30px from the narrow-screen "li > ul" selector below */
470 margin: 10px 0 10px 30px;
471 padding: 0;
472 }
473
474 pre {
475 background: #EEE;
476 padding: 7px 30px;
477 margin: 15px 0px;
478 line-height: 1.3em;
479 }
480
481 div.viewcode-block:target {
482 background: #ffd;
483 }
484
485 dl pre, blockquote pre, li pre {
486 margin-left: 0;
487 padding-left: 30px;
488 }
489
490 dl dl pre {
491 margin-left: -90px;
492 padding-left: 90px;
493 }
494
495 tt, code {
496 background-color: #ecf0f3;
497 color: #222;
498 /* padding: 1px 2px; */
499 }
500
501 tt.xref, code.xref, a tt {
502 background-color: #FBFBFB;
503 border-bottom: 1px solid #fff;
504 }
505
506 a.reference {
507 text-decoration: none;
508 border-bottom: 1px dotted #004B6B;
509 }
510
511 /* Don't put an underline on images */
512 a.image-reference, a.image-reference:hover {
513 border-bottom: none;
514 }
515
516 a.reference:hover {
517 border-bottom: 1px solid #6D4100;
518 }
519
520 a.footnote-reference {
521 text-decoration: none;
522 font-size: 0.7em;
523 vertical-align: top;
524 border-bottom: 1px dotted #004B6B;
525 }
526
527 a.footnote-reference:hover {
528 border-bottom: 1px solid #6D4100;
529 }
530
531 a:hover tt, a:hover code {
532 background: #EEE;
533 }
534
535
536 @media screen and (max-width: 870px) {
537
538 div.sphinxsidebar {
539 display: none;
540 }
541
542 div.document {
543 width: 100%;
544
545 }
546
547 div.documentwrapper {
548 margin-left: 0;
549 margin-top: 0;
550 margin-right: 0;
551 margin-bottom: 0;
552 }
553
554 div.bodywrapper {
555 margin-top: 0;
556 margin-right: 0;
557 margin-bottom: 0;
558 margin-left: 0;
559 }
560
561 ul {
562 margin-left: 0;
563 }
564
565 li > ul {
566 /* Matches the 30px from the "ul, ol" selector above */
567 margin-left: 30px;
568 }
569
570 .document {
571 width: auto;
572 }
573
574 .footer {
575 width: auto;
576 }
577
578 .bodywrapper {
579 margin: 0;
580 }
581
582 .footer {
583 width: auto;
584 }
585
586 .github {
587 display: none;
588 }
589
590
591
592 }
593
594
595
596 @media screen and (max-width: 875px) {
597
598 body {
599 margin: 0;
600 padding: 20px 30px;
601 }
602
603 div.documentwrapper {
604 float: none;
605 background: #fff;
606 }
607
608 div.sphinxsidebar {
609 display: block;
610 float: none;
611 width: 102.5%;
612 margin: 50px -30px -20px -30px;
613 padding: 10px 20px;
614 background: #333;
615 color: #FFF;
616 }
617
618 div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,
619 div.sphinxsidebar h3 a {
620 color: #fff;
621 }
622
623 div.sphinxsidebar a {
624 color: #AAA;
625 }
626
627 div.sphinxsidebar p.logo {
628 display: none;
629 }
630
631 div.document {
632 width: 100%;
633 margin: 0;
634 }
635
636 div.footer {
637 display: none;
638 }
639
640 div.bodywrapper {
641 margin: 0;
642 }
643
644 div.body {
645 min-height: 0;
646 padding: 0;
647 }
648
649 .rtd_doc_footer {
650 display: none;
651 }
652
653 .document {
654 width: auto;
655 }
656
657 .footer {
658 width: auto;
659 }
660
661 .footer {
662 width: auto;
663 }
664
665 .github {
666 display: none;
667 }
668 }
669
670
671 /* misc. */
672
673 .revsys-inline {
674 display: none!important;
675 }
676
677 /* Make nested-list/multi-paragraph items look better in Releases changelog
678 * pages. Without this, docutils' magical list fuckery causes inconsistent
679 * formatting between different release sub-lists.
680 */
681 div#changelog > div.section > ul > li > p:only-child {
682 margin-bottom: 0;
683 }
684
685 /* Hide fugly table cell borders in ..bibliography:: directive output */
686 table.docutils.citation, table.docutils.citation td, table.docutils.citation th {
687 border: none;
688 /* Below needed in some edge cases; if not applied, bottom shadows appear */
689 -moz-box-shadow: none;
690 -webkit-box-shadow: none;
691 box-shadow: none;
692 }
0 /*
1 * basic.css
2 * ~~~~~~~~~
3 *
4 * Sphinx stylesheet -- basic theme.
5 *
6 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 /* -- main layout ----------------------------------------------------------- */
12
13 div.clearer {
14 clear: both;
15 }
16
17 /* -- relbar ---------------------------------------------------------------- */
18
19 div.related {
20 width: 100%;
21 font-size: 90%;
22 }
23
24 div.related h3 {
25 display: none;
26 }
27
28 div.related ul {
29 margin: 0;
30 padding: 0 0 0 10px;
31 list-style: none;
32 }
33
34 div.related li {
35 display: inline;
36 }
37
38 div.related li.right {
39 float: right;
40 margin-right: 5px;
41 }
42
43 /* -- sidebar --------------------------------------------------------------- */
44
45 div.sphinxsidebarwrapper {
46 padding: 10px 5px 0 10px;
47 }
48
49 div.sphinxsidebar {
50 float: left;
51 width: 230px;
52 margin-left: -100%;
53 font-size: 90%;
54 word-wrap: break-word;
55 overflow-wrap : break-word;
56 }
57
58 div.sphinxsidebar ul {
59 list-style: none;
60 }
61
62 div.sphinxsidebar ul ul,
63 div.sphinxsidebar ul.want-points {
64 margin-left: 20px;
65 list-style: square;
66 }
67
68 div.sphinxsidebar ul ul {
69 margin-top: 0;
70 margin-bottom: 0;
71 }
72
73 div.sphinxsidebar form {
74 margin-top: 10px;
75 }
76
77 div.sphinxsidebar input {
78 border: 1px solid #98dbcc;
79 font-family: sans-serif;
80 font-size: 1em;
81 }
82
83 div.sphinxsidebar #searchbox input[type="text"] {
84 width: 170px;
85 }
86
87 img {
88 border: 0;
89 max-width: 100%;
90 }
91
92 /* -- search page ----------------------------------------------------------- */
93
94 ul.search {
95 margin: 10px 0 0 20px;
96 padding: 0;
97 }
98
99 ul.search li {
100 padding: 5px 0 5px 20px;
101 background-image: url(file.png);
102 background-repeat: no-repeat;
103 background-position: 0 7px;
104 }
105
106 ul.search li a {
107 font-weight: bold;
108 }
109
110 ul.search li div.context {
111 color: #888;
112 margin: 2px 0 0 30px;
113 text-align: left;
114 }
115
116 ul.keywordmatches li.goodmatch a {
117 font-weight: bold;
118 }
119
120 /* -- index page ------------------------------------------------------------ */
121
122 table.contentstable {
123 width: 90%;
124 margin-left: auto;
125 margin-right: auto;
126 }
127
128 table.contentstable p.biglink {
129 line-height: 150%;
130 }
131
132 a.biglink {
133 font-size: 1.3em;
134 }
135
136 span.linkdescr {
137 font-style: italic;
138 padding-top: 5px;
139 font-size: 90%;
140 }
141
142 /* -- general index --------------------------------------------------------- */
143
144 table.indextable {
145 width: 100%;
146 }
147
148 table.indextable td {
149 text-align: left;
150 vertical-align: top;
151 }
152
153 table.indextable ul {
154 margin-top: 0;
155 margin-bottom: 0;
156 list-style-type: none;
157 }
158
159 table.indextable > tbody > tr > td > ul {
160 padding-left: 0em;
161 }
162
163 table.indextable tr.pcap {
164 height: 10px;
165 }
166
167 table.indextable tr.cap {
168 margin-top: 10px;
169 background-color: #f2f2f2;
170 }
171
172 img.toggler {
173 margin-right: 3px;
174 margin-top: 3px;
175 cursor: pointer;
176 }
177
178 div.modindex-jumpbox {
179 border-top: 1px solid #ddd;
180 border-bottom: 1px solid #ddd;
181 margin: 1em 0 1em 0;
182 padding: 0.4em;
183 }
184
185 div.genindex-jumpbox {
186 border-top: 1px solid #ddd;
187 border-bottom: 1px solid #ddd;
188 margin: 1em 0 1em 0;
189 padding: 0.4em;
190 }
191
192 /* -- domain module index --------------------------------------------------- */
193
194 table.modindextable td {
195 padding: 2px;
196 border-collapse: collapse;
197 }
198
199 /* -- general body styles --------------------------------------------------- */
200
201 div.body p, div.body dd, div.body li, div.body blockquote {
202 -moz-hyphens: auto;
203 -ms-hyphens: auto;
204 -webkit-hyphens: auto;
205 hyphens: auto;
206 }
207
208 a.headerlink {
209 visibility: hidden;
210 }
211
212 h1:hover > a.headerlink,
213 h2:hover > a.headerlink,
214 h3:hover > a.headerlink,
215 h4:hover > a.headerlink,
216 h5:hover > a.headerlink,
217 h6:hover > a.headerlink,
218 dt:hover > a.headerlink,
219 caption:hover > a.headerlink,
220 p.caption:hover > a.headerlink,
221 div.code-block-caption:hover > a.headerlink {
222 visibility: visible;
223 }
224
225 div.body p.caption {
226 text-align: inherit;
227 }
228
229 div.body td {
230 text-align: left;
231 }
232
233 .first {
234 margin-top: 0 !important;
235 }
236
237 p.rubric {
238 margin-top: 30px;
239 font-weight: bold;
240 }
241
242 img.align-left, .figure.align-left, object.align-left {
243 clear: left;
244 float: left;
245 margin-right: 1em;
246 }
247
248 img.align-right, .figure.align-right, object.align-right {
249 clear: right;
250 float: right;
251 margin-left: 1em;
252 }
253
254 img.align-center, .figure.align-center, object.align-center {
255 display: block;
256 margin-left: auto;
257 margin-right: auto;
258 }
259
260 .align-left {
261 text-align: left;
262 }
263
264 .align-center {
265 text-align: center;
266 }
267
268 .align-right {
269 text-align: right;
270 }
271
272 /* -- sidebars -------------------------------------------------------------- */
273
274 div.sidebar {
275 margin: 0 0 0.5em 1em;
276 border: 1px solid #ddb;
277 padding: 7px 7px 0 7px;
278 background-color: #ffe;
279 width: 40%;
280 float: right;
281 }
282
283 p.sidebar-title {
284 font-weight: bold;
285 }
286
287 /* -- topics ---------------------------------------------------------------- */
288
289 div.topic {
290 border: 1px solid #ccc;
291 padding: 7px 7px 0 7px;
292 margin: 10px 0 10px 0;
293 }
294
295 p.topic-title {
296 font-size: 1.1em;
297 font-weight: bold;
298 margin-top: 10px;
299 }
300
301 /* -- admonitions ----------------------------------------------------------- */
302
303 div.admonition {
304 margin-top: 10px;
305 margin-bottom: 10px;
306 padding: 7px;
307 }
308
309 div.admonition dt {
310 font-weight: bold;
311 }
312
313 div.admonition dl {
314 margin-bottom: 0;
315 }
316
317 p.admonition-title {
318 margin: 0px 10px 5px 0px;
319 font-weight: bold;
320 }
321
322 div.body p.centered {
323 text-align: center;
324 margin-top: 25px;
325 }
326
327 /* -- tables ---------------------------------------------------------------- */
328
329 table.docutils {
330 border: 0;
331 border-collapse: collapse;
332 }
333
334 table caption span.caption-number {
335 font-style: italic;
336 }
337
338 table caption span.caption-text {
339 }
340
341 table.docutils td, table.docutils th {
342 padding: 1px 8px 1px 5px;
343 border-top: 0;
344 border-left: 0;
345 border-right: 0;
346 border-bottom: 1px solid #aaa;
347 }
348
349 table.footnote td, table.footnote th {
350 border: 0 !important;
351 }
352
353 th {
354 text-align: left;
355 padding-right: 5px;
356 }
357
358 table.citation {
359 border-left: solid 1px gray;
360 margin-left: 1px;
361 }
362
363 table.citation td {
364 border-bottom: none;
365 }
366
367 /* -- figures --------------------------------------------------------------- */
368
369 div.figure {
370 margin: 0.5em;
371 padding: 0.5em;
372 }
373
374 div.figure p.caption {
375 padding: 0.3em;
376 }
377
378 div.figure p.caption span.caption-number {
379 font-style: italic;
380 }
381
382 div.figure p.caption span.caption-text {
383 }
384
385 /* -- field list styles ----------------------------------------------------- */
386
387 table.field-list td, table.field-list th {
388 border: 0 !important;
389 }
390
391 .field-list ul {
392 margin: 0;
393 padding-left: 1em;
394 }
395
396 .field-list p {
397 margin: 0;
398 }
399
400 /* -- other body styles ----------------------------------------------------- */
401
402 ol.arabic {
403 list-style: decimal;
404 }
405
406 ol.loweralpha {
407 list-style: lower-alpha;
408 }
409
410 ol.upperalpha {
411 list-style: upper-alpha;
412 }
413
414 ol.lowerroman {
415 list-style: lower-roman;
416 }
417
418 ol.upperroman {
419 list-style: upper-roman;
420 }
421
422 dl {
423 margin-bottom: 15px;
424 }
425
426 dd p {
427 margin-top: 0px;
428 }
429
430 dd ul, dd table {
431 margin-bottom: 10px;
432 }
433
434 dd {
435 margin-top: 3px;
436 margin-bottom: 10px;
437 margin-left: 30px;
438 }
439
440 dt:target, .highlighted {
441 background-color: #fbe54e;
442 }
443
444 dl.glossary dt {
445 font-weight: bold;
446 font-size: 1.1em;
447 }
448
449 .optional {
450 font-size: 1.3em;
451 }
452
453 .sig-paren {
454 font-size: larger;
455 }
456
457 .versionmodified {
458 font-style: italic;
459 }
460
461 .system-message {
462 background-color: #fda;
463 padding: 5px;
464 border: 3px solid red;
465 }
466
467 .footnote:target {
468 background-color: #ffa;
469 }
470
471 .line-block {
472 display: block;
473 margin-top: 1em;
474 margin-bottom: 1em;
475 }
476
477 .line-block .line-block {
478 margin-top: 0;
479 margin-bottom: 0;
480 margin-left: 1.5em;
481 }
482
483 .guilabel, .menuselection {
484 font-family: sans-serif;
485 }
486
487 .accelerator {
488 text-decoration: underline;
489 }
490
491 .classifier {
492 font-style: oblique;
493 }
494
495 abbr, acronym {
496 border-bottom: dotted 1px;
497 cursor: help;
498 }
499
500 /* -- code displays --------------------------------------------------------- */
501
502 pre {
503 overflow: auto;
504 overflow-y: hidden; /* fixes display issues on Chrome browsers */
505 }
506
507 span.pre {
508 -moz-hyphens: none;
509 -ms-hyphens: none;
510 -webkit-hyphens: none;
511 hyphens: none;
512 }
513
514 td.linenos pre {
515 padding: 5px 0px;
516 border: 0;
517 background-color: transparent;
518 color: #aaa;
519 }
520
521 table.highlighttable {
522 margin-left: 0.5em;
523 }
524
525 table.highlighttable td {
526 padding: 0 0.5em 0 0.5em;
527 }
528
529 div.code-block-caption {
530 padding: 2px 5px;
531 font-size: small;
532 }
533
534 div.code-block-caption code {
535 background-color: transparent;
536 }
537
538 div.code-block-caption + div > div.highlight > pre {
539 margin-top: 0;
540 }
541
542 div.code-block-caption span.caption-number {
543 padding: 0.1em 0.3em;
544 font-style: italic;
545 }
546
547 div.code-block-caption span.caption-text {
548 }
549
550 div.literal-block-wrapper {
551 padding: 1em 1em 0;
552 }
553
554 div.literal-block-wrapper div.highlight {
555 margin: 0;
556 }
557
558 code.descname {
559 background-color: transparent;
560 font-weight: bold;
561 font-size: 1.2em;
562 }
563
564 code.descclassname {
565 background-color: transparent;
566 }
567
568 code.xref, a code {
569 background-color: transparent;
570 font-weight: bold;
571 }
572
573 h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
574 background-color: transparent;
575 }
576
577 .viewcode-link {
578 float: right;
579 }
580
581 .viewcode-back {
582 float: right;
583 font-family: sans-serif;
584 }
585
586 div.viewcode-block:target {
587 margin: -1px -10px;
588 padding: 0 10px;
589 }
590
591 /* -- math display ---------------------------------------------------------- */
592
593 img.math {
594 vertical-align: middle;
595 }
596
597 div.body div.math p {
598 text-align: center;
599 }
600
601 span.eqno {
602 float: right;
603 }
604
605 span.eqno a.headerlink {
606 position: relative;
607 left: 0px;
608 z-index: 1;
609 }
610
611 div.math:hover a.headerlink {
612 visibility: visible;
613 }
614
615 /* -- printout stylesheet --------------------------------------------------- */
616
617 @media print {
618 div.document,
619 div.documentwrapper,
620 div.bodywrapper {
621 margin: 0 !important;
622 width: 100%;
623 }
624
625 div.sphinxsidebar,
626 div.related,
627 div.footer,
628 #top-link {
629 display: none;
630 }
631 }
0 .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}
1 /*# sourceMappingURL=badge_only.css.map */
0 *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}[hidden]{display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:hover,a:active{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;color:#000;text-decoration:none}mark{background:#ff0;color:#000;font-style:italic;font-weight:bold}pre,code,.rst-content tt,.rst-content code,kbd,samp{font-family:monospace,serif;_font-family:"courier new",monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:before,q:after{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}ul,ol,dl{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:0;margin:0;padding:0}label{cursor:pointer}legend{border:0;*margin-left:-7px;padding:0;white-space:normal}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*width:13px;*height:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top;resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:0.2em 0;background:#ccc;color:#000;padding:0.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none !important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{html,body,section{background:none !important}*{box-shadow:none !important;text-shadow:none !important;filter:none !important;-ms-filter:none !important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,.rst-content .toctree-wrapper p.caption,h3{orphans:3;widows:3}h2,.rst-content .toctree-wrapper p.caption,h3{page-break-after:avoid}}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo,.btn,input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"],select,textarea,.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a,.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a,.wy-nav-top a{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}/*!
1 * Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome
2 * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
3 */@font-face{font-family:'FontAwesome';src:url("../fonts/fontawesome-webfont.eot?v=4.2.0");src:url("../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff?v=4.2.0") format("woff"),url("../fonts/fontawesome-webfont.ttf?v=4.2.0") format("truetype"),url("../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular") format("svg");font-weight:normal;font-style:normal}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:0.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:solid 0.08em #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.wy-menu-vertical li span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.rst-content .pull-left.admonition-title,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content dl dt .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.rst-content code.download span.pull-left:first-child,.pull-left.icon{margin-right:.3em}.fa.pull-right,.wy-menu-vertical li span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.rst-content .pull-right.admonition-title,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content dl dt .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.rst-content code.download span.pull-right:first-child,.pull-right.icon{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0);-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-remove:before,.fa-close:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-gear:before,.fa-cog:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-rotate-right:before,.fa-repeat:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.rst-content .admonition-title:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-warning:before,.fa-exclamation-triangle:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-gears:before,.fa-cogs:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-save:before,.fa-floppy-o:before{content:""}.fa-square:before{content:""}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.wy-dropdown .caret:before,.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-unsorted:before,.fa-sort:before{content:""}.fa-sort-down:before,.fa-sort-desc:before{content:""}.fa-sort-up:before,.fa-sort-asc:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-legal:before,.fa-gavel:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-flash:before,.fa-bolt:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-paste:before,.fa-clipboard:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-unlink:before,.fa-chain-broken:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:""}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:""}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:""}.fa-euro:before,.fa-eur:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-rupee:before,.fa-inr:before{content:""}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:""}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:""}.fa-won:before,.fa-krw:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-turkish-lira:before,.fa-try:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-institution:before,.fa-bank:before,.fa-university:before{content:""}.fa-mortar-board:before,.fa-graduation-cap:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:""}.fa-file-zip-o:before,.fa-file-archive-o:before{content:""}.fa-file-sound-o:before,.fa-file-audio-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before{content:""}.fa-ge:before,.fa-empire:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-send:before,.fa-paper-plane:before{content:""}.fa-send-o:before,.fa-paper-plane-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:""}.fa-meanpath:before{content:""}.fa,.wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,.rst-content .admonition-title,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink,.rst-content tt.download span:first-child,.rst-content code.download span:first-child,.icon,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context{font-family:inherit}.fa:before,.wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.rst-content .admonition-title:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content dl dt .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before,.icon:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before{font-family:"FontAwesome";display:inline-block;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa,a .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand,a .rst-content .admonition-title,.rst-content a .admonition-title,a .rst-content h1 .headerlink,.rst-content h1 a .headerlink,a .rst-content h2 .headerlink,.rst-content h2 a .headerlink,a .rst-content h3 .headerlink,.rst-content h3 a .headerlink,a .rst-content h4 .headerlink,.rst-content h4 a .headerlink,a .rst-content h5 .headerlink,.rst-content h5 a .headerlink,a .rst-content h6 .headerlink,.rst-content h6 a .headerlink,a .rst-content dl dt .headerlink,.rst-content dl dt a .headerlink,a .rst-content p.caption .headerlink,.rst-content p.caption a .headerlink,a .rst-content tt.download span:first-child,.rst-content tt.download a span:first-child,a .rst-content code.download span:first-child,.rst-content code.download a span:first-child,a .icon{display:inline-block;text-decoration:inherit}.btn .fa,.btn .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .btn span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.btn .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.btn .rst-content .admonition-title,.rst-content .btn .admonition-title,.btn .rst-content h1 .headerlink,.rst-content h1 .btn .headerlink,.btn .rst-content h2 .headerlink,.rst-content h2 .btn .headerlink,.btn .rst-content h3 .headerlink,.rst-content h3 .btn .headerlink,.btn .rst-content h4 .headerlink,.rst-content h4 .btn .headerlink,.btn .rst-content h5 .headerlink,.rst-content h5 .btn .headerlink,.btn .rst-content h6 .headerlink,.rst-content h6 .btn .headerlink,.btn .rst-content dl dt .headerlink,.rst-content dl dt .btn .headerlink,.btn .rst-content p.caption .headerlink,.rst-content p.caption .btn .headerlink,.btn .rst-content tt.download span:first-child,.rst-content tt.download .btn span:first-child,.btn .rst-content code.download span:first-child,.rst-content code.download .btn span:first-child,.btn .icon,.nav .fa,.nav .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand,.nav .wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.nav .rst-content .admonition-title,.rst-content .nav .admonition-title,.nav .rst-content h1 .headerlink,.rst-content h1 .nav .headerlink,.nav .rst-content h2 .headerlink,.rst-content h2 .nav .headerlink,.nav .rst-content h3 .headerlink,.rst-content h3 .nav .headerlink,.nav .rst-content h4 .headerlink,.rst-content h4 .nav .headerlink,.nav .rst-content h5 .headerlink,.rst-content h5 .nav .headerlink,.nav .rst-content h6 .headerlink,.rst-content h6 .nav .headerlink,.nav .rst-content dl dt .headerlink,.rst-content dl dt .nav .headerlink,.nav .rst-content p.caption .headerlink,.rst-content p.caption .nav .headerlink,.nav .rst-content tt.download span:first-child,.rst-content tt.download .nav span:first-child,.nav .rst-content code.download span:first-child,.rst-content code.download .nav span:first-child,.nav .icon{display:inline}.btn .fa.fa-large,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.btn .rst-content .fa-large.admonition-title,.rst-content .btn .fa-large.admonition-title,.btn .rst-content h1 .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.btn .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .btn .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .btn span.fa-large:first-child,.btn .rst-content code.download span.fa-large:first-child,.rst-content code.download .btn span.fa-large:first-child,.btn .fa-large.icon,.nav .fa.fa-large,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand,.nav .rst-content .fa-large.admonition-title,.rst-content .nav .fa-large.admonition-title,.nav .rst-content h1 .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.nav .rst-content dl dt .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.nav .rst-content code.download span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.nav .fa-large.icon{line-height:0.9em}.btn .fa.fa-spin,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.btn .rst-content .fa-spin.admonition-title,.rst-content .btn .fa-spin.admonition-title,.btn .rst-content h1 .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.btn .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .btn .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .btn span.fa-spin:first-child,.btn .rst-content code.download span.fa-spin:first-child,.rst-content code.download .btn span.fa-spin:first-child,.btn .fa-spin.icon,.nav .fa.fa-spin,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand,.nav .rst-content .fa-spin.admonition-title,.rst-content .nav .fa-spin.admonition-title,.nav .rst-content h1 .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.nav .rst-content dl dt .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.nav .rst-content code.download span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.nav .fa-spin.icon{display:inline-block}.btn.fa:before,.wy-menu-vertical li span.btn.toctree-expand:before,.rst-content .btn.admonition-title:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content dl dt .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.rst-content code.download span.btn:first-child:before,.btn.icon:before{opacity:0.5;-webkit-transition:opacity 0.05s ease-in;-moz-transition:opacity 0.05s ease-in;transition:opacity 0.05s ease-in}.btn.fa:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.rst-content code.download span.btn:first-child:hover:before,.btn.icon:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before,.btn-mini .rst-content .admonition-title:before,.rst-content .btn-mini .admonition-title:before,.btn-mini .rst-content h1 .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.btn-mini .rst-content dl dt .headerlink:before,.rst-content dl dt .btn-mini .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.rst-content tt.download .btn-mini span:first-child:before,.btn-mini .rst-content code.download span:first-child:before,.rst-content code.download .btn-mini span:first-child:before,.btn-mini .icon:before{font-size:14px;vertical-align:-15%}.wy-alert,.rst-content .note,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .warning,.rst-content .seealso,.rst-content .admonition-todo{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.wy-alert-title,.rst-content .admonition-title{color:#fff;font-weight:bold;display:block;color:#fff;background:#6ab0de;margin:-12px;padding:6px 12px;margin-bottom:12px}.wy-alert.wy-alert-danger,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.admonition-todo{background:#fdf3f2}.wy-alert.wy-alert-danger .wy-alert-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .danger .wy-alert-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .danger .admonition-title,.rst-content .error .admonition-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title{background:#f29f97}.wy-alert.wy-alert-warning,.rst-content .wy-alert-warning.note,.rst-content .attention,.rst-content .caution,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.tip,.rst-content .warning,.rst-content .wy-alert-warning.seealso,.rst-content .admonition-todo{background:#ffedcc}.wy-alert.wy-alert-warning .wy-alert-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .attention .wy-alert-title,.rst-content .caution .wy-alert-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .admonition-todo .wy-alert-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .attention .admonition-title,.rst-content .caution .admonition-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .warning .admonition-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .admonition-todo .admonition-title{background:#f0b37e}.wy-alert.wy-alert-info,.rst-content .note,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.rst-content .seealso,.rst-content .wy-alert-info.admonition-todo{background:#e7f2fa}.wy-alert.wy-alert-info .wy-alert-title,.rst-content .note .wy-alert-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.rst-content .note .admonition-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .seealso .admonition-title,.rst-content .wy-alert-info.admonition-todo .admonition-title{background:#6ab0de}.wy-alert.wy-alert-success,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.warning,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.admonition-todo{background:#dbfaf4}.wy-alert.wy-alert-success .wy-alert-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .hint .wy-alert-title,.rst-content .important .wy-alert-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .hint .admonition-title,.rst-content .important .admonition-title,.rst-content .tip .admonition-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.admonition-todo .admonition-title{background:#1abc9c}.wy-alert.wy-alert-neutral,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.admonition-todo{background:#f3f6f6}.wy-alert.wy-alert-neutral .wy-alert-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .admonition-title{color:#404040;background:#e1e4e5}.wy-alert.wy-alert-neutral a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.admonition-todo a{color:#2980B9}.wy-alert p:last-child,.rst-content .note p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.rst-content .seealso p:last-child,.rst-content .admonition-todo p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0px;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,0.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all 0.3s ease-in;-moz-transition:all 0.3s ease-in;transition:all 0.3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27AE60}.wy-tray-container li.wy-tray-item-info{background:#2980B9}.wy-tray-container li.wy-tray-item-warning{background:#E67E22}.wy-tray-container li.wy-tray-item-danger{background:#E74C3C}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width: 768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px 12px;color:#fff;border:1px solid rgba(0,0,0,0.1);background-color:#27AE60;text-decoration:none;font-weight:normal;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:0px 1px 2px -1px rgba(255,255,255,0.5) inset,0px -2px 0px 0px rgba(0,0,0,0.1) inset;outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all 0.1s linear;-moz-transition:all 0.1s linear;transition:all 0.1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:0px -1px 0px 0px rgba(0,0,0,0.05) inset,0px 2px 0px 0px rgba(0,0,0,0.1) inset;padding:8px 12px 6px 12px}.btn:visited{color:#fff}.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn-disabled:hover,.btn-disabled:focus,.btn-disabled:active{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:0.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980B9 !important}.btn-info:hover{background-color:#2e8ece !important}.btn-neutral{background-color:#f3f6f6 !important;color:#404040 !important}.btn-neutral:hover{background-color:#e5ebeb !important;color:#404040}.btn-neutral:visited{color:#404040 !important}.btn-success{background-color:#27AE60 !important}.btn-success:hover{background-color:#295 !important}.btn-danger{background-color:#E74C3C !important}.btn-danger:hover{background-color:#ea6153 !important}.btn-warning{background-color:#E67E22 !important}.btn-warning:hover{background-color:#e98b39 !important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f !important}.btn-link{background-color:transparent !important;color:#2980B9;box-shadow:none;border-color:transparent !important}.btn-link:hover{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:active{background-color:transparent !important;color:#409ad5 !important;box-shadow:none}.btn-link:visited{color:#9B59B6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:before,.wy-btn-group:after{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:solid 1px #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,0.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980B9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:solid 1px #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type="search"]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980B9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned input,.wy-form-aligned textarea,.wy-form-aligned select,.wy-form-aligned .wy-help-inline,.wy-form-aligned label{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{border:0;margin:0;padding:0}legend{display:block;width:100%;border:0;padding:0;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label{display:block;margin:0 0 0.3125em 0;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;*zoom:1;max-width:68em;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group:before,.wy-control-group:after{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#E74C3C}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full input[type="text"],.wy-control-group .wy-form-full input[type="password"],.wy-control-group .wy-form-full input[type="email"],.wy-control-group .wy-form-full input[type="url"],.wy-control-group .wy-form-full input[type="date"],.wy-control-group .wy-form-full input[type="month"],.wy-control-group .wy-form-full input[type="time"],.wy-control-group .wy-form-full input[type="datetime"],.wy-control-group .wy-form-full input[type="datetime-local"],.wy-control-group .wy-form-full input[type="week"],.wy-control-group .wy-form-full input[type="number"],.wy-control-group .wy-form-full input[type="search"],.wy-control-group .wy-form-full input[type="tel"],.wy-control-group .wy-form-full input[type="color"],.wy-control-group .wy-form-halves input[type="text"],.wy-control-group .wy-form-halves input[type="password"],.wy-control-group .wy-form-halves input[type="email"],.wy-control-group .wy-form-halves input[type="url"],.wy-control-group .wy-form-halves input[type="date"],.wy-control-group .wy-form-halves input[type="month"],.wy-control-group .wy-form-halves input[type="time"],.wy-control-group .wy-form-halves input[type="datetime"],.wy-control-group .wy-form-halves input[type="datetime-local"],.wy-control-group .wy-form-halves input[type="week"],.wy-control-group .wy-form-halves input[type="number"],.wy-control-group .wy-form-halves input[type="search"],.wy-control-group .wy-form-halves input[type="tel"],.wy-control-group .wy-form-halves input[type="color"],.wy-control-group .wy-form-thirds input[type="text"],.wy-control-group .wy-form-thirds input[type="password"],.wy-control-group .wy-form-thirds input[type="email"],.wy-control-group .wy-form-thirds input[type="url"],.wy-control-group .wy-form-thirds input[type="date"],.wy-control-group .wy-form-thirds input[type="month"],.wy-control-group .wy-form-thirds input[type="time"],.wy-control-group .wy-form-thirds input[type="datetime"],.wy-control-group .wy-form-thirds input[type="datetime-local"],.wy-control-group .wy-form-thirds input[type="week"],.wy-control-group .wy-form-thirds input[type="number"],.wy-control-group .wy-form-thirds input[type="search"],.wy-control-group .wy-form-thirds input[type="tel"],.wy-control-group .wy-form-thirds input[type="color"]{width:100%}.wy-control-group .wy-form-full{float:left;display:block;margin-right:2.35765%;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child{margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(2n+1){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child{margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control{margin:6px 0 0 0;font-size:90%}.wy-control-no-input{display:inline-block;margin:6px 0 0 0;font-size:90%}.wy-control-group.fluid-input input[type="text"],.wy-control-group.fluid-input input[type="password"],.wy-control-group.fluid-input input[type="email"],.wy-control-group.fluid-input input[type="url"],.wy-control-group.fluid-input input[type="date"],.wy-control-group.fluid-input input[type="month"],.wy-control-group.fluid-input input[type="time"],.wy-control-group.fluid-input input[type="datetime"],.wy-control-group.fluid-input input[type="datetime-local"],.wy-control-group.fluid-input input[type="week"],.wy-control-group.fluid-input input[type="number"],.wy-control-group.fluid-input input[type="search"],.wy-control-group.fluid-input input[type="tel"],.wy-control-group.fluid-input input[type="color"]{width:100%}.wy-form-message-inline{display:inline-block;padding-left:0.3em;color:#666;vertical-align:middle;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:0.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;*overflow:visible}input[type="text"],input[type="password"],input[type="email"],input[type="url"],input[type="date"],input[type="month"],input[type="time"],input[type="datetime"],input[type="datetime-local"],input[type="week"],input[type="number"],input[type="search"],input[type="tel"],input[type="color"]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}input[type="datetime-local"]{padding:0.34375em 0.625em}input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0;margin-right:0.3125em;*height:13px;*width:13px}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}input[type="text"]:focus,input[type="password"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus{outline:0;outline:thin dotted \9;border-color:#333}input.no-focus:focus{border-color:#ccc !important}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:1px auto #129FEA}input[type="text"][disabled],input[type="password"][disabled],input[type="email"][disabled],input[type="url"][disabled],input[type="date"][disabled],input[type="month"][disabled],input[type="time"][disabled],input[type="datetime"][disabled],input[type="datetime-local"][disabled],input[type="week"][disabled],input[type="number"][disabled],input[type="search"][disabled],input[type="tel"][disabled],input[type="color"][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#E74C3C;border:1px solid #E74C3C}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#E74C3C}input[type="file"]:focus:invalid:focus,input[type="radio"]:focus:invalid:focus,input[type="checkbox"]:focus:invalid:focus{outline-color:#E74C3C}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif}select,textarea{padding:0.5em 0.625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border 0.3s linear;-moz-transition:border 0.3s linear;transition:border 0.3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type="radio"][disabled],input[type="checkbox"][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:solid 1px #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{width:36px;height:12px;margin:12px 0;position:relative;border-radius:4px;background:#ccc;cursor:pointer;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:before{position:absolute;content:"";display:block;width:18px;height:18px;border-radius:4px;background:#999;left:-3px;top:-3px;-webkit-transition:all 0.2s ease-in-out;-moz-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.wy-switch:after{content:"false";position:absolute;left:48px;display:block;font-size:12px;color:#ccc}.wy-switch.active{background:#1e8449}.wy-switch.active:before{left:24px;background:#27AE60}.wy-switch.active:after{content:"true"}.wy-switch.disabled,.wy-switch.active.disabled{cursor:not-allowed}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#E74C3C}.wy-control-group.wy-control-group-error input[type="text"],.wy-control-group.wy-control-group-error input[type="password"],.wy-control-group.wy-control-group-error input[type="email"],.wy-control-group.wy-control-group-error input[type="url"],.wy-control-group.wy-control-group-error input[type="date"],.wy-control-group.wy-control-group-error input[type="month"],.wy-control-group.wy-control-group-error input[type="time"],.wy-control-group.wy-control-group-error input[type="datetime"],.wy-control-group.wy-control-group-error input[type="datetime-local"],.wy-control-group.wy-control-group-error input[type="week"],.wy-control-group.wy-control-group-error input[type="number"],.wy-control-group.wy-control-group-error input[type="search"],.wy-control-group.wy-control-group-error input[type="tel"],.wy-control-group.wy-control-group-error input[type="color"]{border:solid 1px #E74C3C}.wy-control-group.wy-control-group-error textarea{border:solid 1px #E74C3C}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:0.5em 0.625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27AE60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#E74C3C}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#E67E22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980B9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width: 480px){.wy-form button[type="submit"]{margin:0.7em 0 0}.wy-form input[type="text"],.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0.3em;display:block}.wy-form label{margin-bottom:0.3em;display:block}.wy-form input[type="password"],.wy-form input[type="email"],.wy-form input[type="url"],.wy-form input[type="date"],.wy-form input[type="month"],.wy-form input[type="time"],.wy-form input[type="datetime"],.wy-form input[type="datetime-local"],.wy-form input[type="week"],.wy-form input[type="number"],.wy-form input[type="search"],.wy-form input[type="tel"],.wy-form input[type="color"]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:0.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0 0}.wy-form .wy-help-inline,.wy-form-message-inline,.wy-form-message{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width: 768px){.tablet-hide{display:none}}@media screen and (max-width: 480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.wy-table,.rst-content table.docutils,.rst-content table.field-list{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.wy-table caption,.rst-content table.docutils caption,.rst-content table.field-list caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td,.wy-table th,.rst-content table.docutils th,.rst-content table.field-list th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.wy-table td:first-child,.rst-content table.docutils td:first-child,.rst-content table.field-list td:first-child,.wy-table th:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list th:first-child{border-left-width:0}.wy-table thead,.rst-content table.docutils thead,.rst-content table.field-list thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.wy-table thead th,.rst-content table.docutils thead th,.rst-content table.field-list thead th{font-weight:bold;border-bottom:solid 2px #e1e4e5}.wy-table td,.rst-content table.docutils td,.rst-content table.field-list td{background-color:transparent;vertical-align:middle}.wy-table td p,.rst-content table.docutils td p,.rst-content table.field-list td p{line-height:18px}.wy-table td p:last-child,.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child{margin-bottom:0}.wy-table .wy-table-cell-min,.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min{width:1%;padding-right:0}.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox],.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:gray;font-size:90%}.wy-table-tertiary{color:gray;font-size:80%}.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td,.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td{background-color:#f3f6f6}.wy-table-backed{background-color:#f3f6f6}.wy-table-bordered-all,.rst-content table.docutils{border:1px solid #e1e4e5}.wy-table-bordered-all td,.rst-content table.docutils td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.wy-table-bordered-all tbody>tr:last-child td,.rst-content table.docutils tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px 0;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0 !important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980B9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9B59B6}html{height:100%;overflow-x:hidden}body{font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;font-weight:normal;color:#404040;min-height:100%;overflow-x:hidden;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#E67E22 !important}a.wy-text-warning:hover{color:#eb9950 !important}.wy-text-info{color:#2980B9 !important}a.wy-text-info:hover{color:#409ad5 !important}.wy-text-success{color:#27AE60 !important}a.wy-text-success:hover{color:#36d278 !important}.wy-text-danger{color:#E74C3C !important}a.wy-text-danger:hover{color:#ed7669 !important}.wy-text-neutral{color:#404040 !important}a.wy-text-neutral:hover{color:#595959 !important}h1,h2,.rst-content .toctree-wrapper p.caption,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif}p{line-height:24px;margin:0;font-size:16px;margin-bottom:24px}h1{font-size:175%}h2,.rst-content .toctree-wrapper p.caption{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}code,.rst-content tt,.rst-content code{white-space:nowrap;max-width:100%;background:#fff;border:solid 1px #e1e4e5;font-size:75%;padding:0 5px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;color:#E74C3C;overflow-x:auto}code.code-large,.rst-content tt.code-large{font-size:90%}.wy-plain-list-disc,.rst-content .section ul,.rst-content .toctree-wrapper ul,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.wy-plain-list-disc li,.rst-content .section ul li,.rst-content .toctree-wrapper ul li,article ul li{list-style:disc;margin-left:24px}.wy-plain-list-disc li p:last-child,.rst-content .section ul li p:last-child,.rst-content .toctree-wrapper ul li p:last-child,article ul li p:last-child{margin-bottom:0}.wy-plain-list-disc li ul,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li ul,article ul li ul{margin-bottom:0}.wy-plain-list-disc li li,.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,article ul li li{list-style:circle}.wy-plain-list-disc li li li,.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,article ul li li li{list-style:square}.wy-plain-list-disc li ol li,.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,article ul li ol li{list-style:decimal}.wy-plain-list-decimal,.rst-content .section ol,.rst-content ol.arabic,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.wy-plain-list-decimal li,.rst-content .section ol li,.rst-content ol.arabic li,article ol li{list-style:decimal;margin-left:24px}.wy-plain-list-decimal li p:last-child,.rst-content .section ol li p:last-child,.rst-content ol.arabic li p:last-child,article ol li p:last-child{margin-bottom:0}.wy-plain-list-decimal li ul,.rst-content .section ol li ul,.rst-content ol.arabic li ul,article ol li ul{margin-bottom:0}.wy-plain-list-decimal li ul li,.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,article ol li ul li{list-style:disc}.codeblock-example{border:1px solid #e1e4e5;border-bottom:none;padding:24px;padding-top:48px;font-weight:500;background:#fff;position:relative}.codeblock-example:after{content:"Example";position:absolute;top:0px;left:0px;background:#9B59B6;color:#fff;padding:6px 12px}.codeblock-example.prettyprint-example-only{border:1px solid #e1e4e5;margin-bottom:24px}.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight']{border:1px solid #e1e4e5;padding:0px;overflow-x:auto;background:#fff;margin:1px 0 24px 0}.codeblock div[class^='highlight'],pre.literal-block div[class^='highlight'],.rst-content .literal-block div[class^='highlight'],div[class^='highlight'] div[class^='highlight']{border:none;background:none;margin:0}div[class^='highlight'] td.code{width:100%}.linenodiv pre{border-right:solid 1px #e6e9ea;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;color:#d9d9d9}div[class^='highlight'] pre{white-space:pre;margin:0;padding:12px 12px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:12px;line-height:1.5;display:block;overflow:auto;color:#404040}@media print{.codeblock,pre.literal-block,.rst-content .literal-block,.rst-content pre.literal-block,div[class^='highlight'],div[class^='highlight'] pre{white-space:pre-wrap}}.hll{background-color:#ffc;margin:0 -12px;padding:0 12px;display:block}.c{color:#998;font-style:italic}.err{color:#a61717;background-color:#e3d2d2}.k{font-weight:bold}.o{font-weight:bold}.cm{color:#998;font-style:italic}.cp{color:#999;font-weight:bold}.c1{color:#998;font-style:italic}.cs{color:#999;font-weight:bold;font-style:italic}.gd{color:#000;background-color:#fdd}.gd .x{color:#000;background-color:#faa}.ge{font-style:italic}.gr{color:#a00}.gh{color:#999}.gi{color:#000;background-color:#dfd}.gi .x{color:#000;background-color:#afa}.go{color:#888}.gp{color:#555}.gs{font-weight:bold}.gu{color:purple;font-weight:bold}.gt{color:#a00}.kc{font-weight:bold}.kd{font-weight:bold}.kn{font-weight:bold}.kp{font-weight:bold}.kr{font-weight:bold}.kt{color:#458;font-weight:bold}.m{color:#099}.s{color:#d14}.n{color:#333}.na{color:teal}.nb{color:#0086b3}.nc{color:#458;font-weight:bold}.no{color:teal}.ni{color:purple}.ne{color:#900;font-weight:bold}.nf{color:#900;font-weight:bold}.nn{color:#555}.nt{color:navy}.nv{color:teal}.ow{font-weight:bold}.w{color:#bbb}.mf{color:#099}.mh{color:#099}.mi{color:#099}.mo{color:#099}.sb{color:#d14}.sc{color:#d14}.sd{color:#d14}.s2{color:#d14}.se{color:#d14}.sh{color:#d14}.si{color:#d14}.sx{color:#d14}.sr{color:#009926}.s1{color:#d14}.ss{color:#990073}.bp{color:#999}.vc{color:teal}.vg{color:teal}.vi{color:teal}.il{color:#099}.gc{color:#999;background-color:#EAF2F5}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.wy-breadcrumbs li code,.wy-breadcrumbs li .rst-content tt,.rst-content .wy-breadcrumbs li tt{padding:5px;border:none;background:none}.wy-breadcrumbs li code.literal,.wy-breadcrumbs li .rst-content tt.literal,.rst-content .wy-breadcrumbs li tt.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width: 480px){.wy-breadcrumbs-extra{display:none}.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:before,.wy-menu-horiz:after{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz ul,.wy-menu-horiz li{display:inline-block}.wy-menu-horiz li:hover{background:rgba(255,255,255,0.1)}.wy-menu-horiz li.divide-left{border-left:solid 1px #404040}.wy-menu-horiz li.divide-right{border-right:solid 1px #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{height:32px;display:inline-block;line-height:32px;padding:0 1.618em;margin-bottom:0;display:block;font-weight:bold;text-transform:uppercase;font-size:80%;color:#555;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:solid 1px #404040}.wy-menu-vertical li.divide-bottom{border-bottom:solid 1px #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:gray;border-right:solid 1px #c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.wy-menu-vertical li code,.wy-menu-vertical li .rst-content tt,.rst-content .wy-menu-vertical li tt{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:0.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.on a,.wy-menu-vertical li.current>a{color:#404040;padding:0.4045em 1.618em;font-weight:bold;position:relative;background:#fcfcfc;border:none;border-bottom:solid 1px #c9c9c9;border-top:solid 1px #c9c9c9;padding-left:1.618em -4px}.wy-menu-vertical li.on a:hover,.wy-menu-vertical li.current>a:hover{background:#fcfcfc}.wy-menu-vertical li.on a:hover span.toctree-expand,.wy-menu-vertical li.current>a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li.current>a span.toctree-expand{display:block;font-size:0.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current li.toctree-l2>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>ul{display:none}.wy-menu-vertical li.toctree-l1.current li.toctree-l2.current>ul,.wy-menu-vertical li.toctree-l2.current li.toctree-l3.current>ul{display:block}.wy-menu-vertical li.toctree-l2.current>a{background:#c9c9c9;padding:0.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{display:block;background:#c9c9c9;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3{font-size:0.9em}.wy-menu-vertical li.toctree-l3.current>a{background:#bdbdbd;padding:0.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{display:block;background:#bdbdbd;padding:0.4045em 5.663em;border-top:none;border-bottom:none}.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand{color:gray}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.toctree-l4{font-size:0.9em}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical .local-toc li ul{display:block}.wy-menu-vertical li ul li a{margin-bottom:0;color:#b3b3b3;font-weight:normal}.wy-menu-vertical a{display:inline-block;line-height:18px;padding:0.4045em 1.618em;display:block;position:relative;font-size:90%;color:#b3b3b3}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#b3b3b3}.wy-menu-vertical a:active{background-color:#2980B9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:0.809em;margin-bottom:0.809em;z-index:200;background-color:#2980B9;text-align:center;padding:0.809em;display:block;color:#fcfcfc;margin-bottom:0.809em}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto 0.809em auto;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-side-nav-search>a,.wy-side-nav-search .wy-dropdown>a{color:#fcfcfc;font-size:100%;font-weight:bold;display:inline-block;padding:4px 6px;margin-bottom:0.809em}.wy-side-nav-search>a:hover,.wy-side-nav-search .wy-dropdown>a:hover{background:rgba(255,255,255,0.1)}.wy-side-nav-search>a img.logo,.wy-side-nav-search .wy-dropdown>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search>a.icon img.logo,.wy-side-nav-search .wy-dropdown>a.icon img.logo{margin-top:0.85em}.wy-side-nav-search>div.version{margin-top:-0.4045em;margin-bottom:0.809em;font-weight:normal;color:rgba(255,255,255,0.3)}.wy-nav .wy-menu-vertical header{color:#2980B9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980B9;color:#fff}[data-menu-wrap]{-webkit-transition:all 0.2s ease-in;-moz-transition:all 0.2s ease-in;transition:all 0.2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:left repeat-y #fcfcfc;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxOERBMTRGRDBFMUUxMUUzODUwMkJCOThDMEVFNURFMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxOERBMTRGRTBFMUUxMUUzODUwMkJCOThDMEVFNURFMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjE4REExNEZCMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjE4REExNEZDMEUxRTExRTM4NTAyQkI5OEMwRUU1REUwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EwrlwAAAAA5JREFUeNpiMDU0BAgwAAE2AJgB9BnaAAAAAElFTkSuQmCC);background-size:300px 1px}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980B9;color:#fff;padding:0.4045em 0.809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:before,.wy-nav-top:after{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:bold}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980B9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,0.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:#999}footer p{margin-bottom:12px}footer span.commit code,footer span.commit .rst-content tt,.rst-content footer span.commit tt{padding:0px;font-family:Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;font-size:1em;background:none;border:none;color:#999}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:before,.rst-footer-buttons:after{display:table;content:""}.rst-footer-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:solid 1px #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:solid 1px #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:gray;font-size:90%}@media screen and (max-width: 768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-side-scroll{width:auto}.wy-side-nav-search{width:auto}.wy-menu.wy-menu-vertical{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width: 1400px){.wy-nav-content-wrap{background:rgba(0,0,0,0.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,footer,.wy-nav-side{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .icon{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}.rst-content img{max-width:100%;height:auto !important}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure.align-center{text-align:center}.rst-content .section>img,.rst-content .section>a>img{margin-bottom:24px}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content .note .last,.rst-content .attention .last,.rst-content .caution .last,.rst-content .danger .last,.rst-content .error .last,.rst-content .hint .last,.rst-content .important .last,.rst-content .tip .last,.rst-content .warning .last,.rst-content .seealso .last,.rst-content .admonition-todo .last{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,0.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent !important;border-color:rgba(0,0,0,0.1) !important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha li{list-style:upper-alpha}.rst-content .section ol p,.rst-content .section ul p{margin-bottom:12px}.rst-content .line-block{margin-left:24px}.rst-content .topic-title{font-weight:bold;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0px 0px 24px 24px}.rst-content .align-left{float:left;margin:0px 24px 24px 0px}.rst-content .align-center{margin:auto;display:block}.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content .toctree-wrapper p.caption .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content dl dt .headerlink,.rst-content p.caption .headerlink{display:none;visibility:hidden;font-size:14px}.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content .toctree-wrapper p.caption .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content p.caption .headerlink:after{visibility:visible;content:"";font-family:FontAwesome;display:inline-block}.rst-content h1:hover .headerlink,.rst-content h2:hover .headerlink,.rst-content .toctree-wrapper p.caption:hover .headerlink,.rst-content h3:hover .headerlink,.rst-content h4:hover .headerlink,.rst-content h5:hover .headerlink,.rst-content h6:hover .headerlink,.rst-content dl dt:hover .headerlink,.rst-content p.caption:hover .headerlink{display:inline-block}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:solid 1px #e1e4e5}.rst-content .sidebar p,.rst-content .sidebar ul,.rst-content .sidebar dl{font-size:90%}.rst-content .sidebar .last{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:"Roboto Slab","ff-tisa-web-pro","Georgia",Arial,sans-serif;font-weight:bold;background:#e1e4e5;padding:6px 12px;margin:-24px;margin-bottom:24px;font-size:100%}.rst-content .highlighted{background:#F1C40F;display:inline-block;font-weight:bold;padding:0 6px}.rst-content .footnote-reference,.rst-content .citation-reference{vertical-align:super;font-size:90%}.rst-content table.docutils.citation,.rst-content table.docutils.footnote{background:none;border:none;color:#999}.rst-content table.docutils.citation td,.rst-content table.docutils.citation tr,.rst-content table.docutils.footnote td,.rst-content table.docutils.footnote tr{border:none;background-color:transparent !important;white-space:normal}.rst-content table.docutils.citation td.label,.rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}.rst-content table.docutils.citation tt,.rst-content table.docutils.citation code,.rst-content table.docutils.footnote tt,.rst-content table.docutils.footnote code{color:#555}.rst-content table.field-list{border:none}.rst-content table.field-list td{border:none;padding-top:5px}.rst-content table.field-list td>strong{display:inline-block;margin-top:3px}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left;padding-left:0}.rst-content tt,.rst-content tt,.rst-content code{color:#000;padding:2px 5px}.rst-content tt big,.rst-content tt em,.rst-content tt big,.rst-content code big,.rst-content tt em,.rst-content code em{font-size:100% !important;line-height:normal}.rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal{color:#E74C3C}.rst-content tt.xref,a .rst-content tt,.rst-content tt.xref,.rst-content code.xref,a .rst-content tt,a .rst-content code{font-weight:bold;color:#404040}.rst-content a tt,.rst-content a tt,.rst-content a code{color:#2980B9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:bold}.rst-content dl p,.rst-content dl table,.rst-content dl ul,.rst-content dl ol{margin-bottom:12px !important}.rst-content dl dd{margin:0 0 12px 24px}.rst-content dl:not(.docutils){margin-bottom:24px}.rst-content dl:not(.docutils) dt{display:inline-block;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980B9;border-top:solid 3px #6ab0de;padding:6px;position:relative}.rst-content dl:not(.docutils) dt:before{color:#6ab0de}.rst-content dl:not(.docutils) dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dl dt{margin-bottom:6px;border:none;border-left:solid 3px #ccc;background:#f0f0f0;color:#555}.rst-content dl:not(.docutils) dl dt .headerlink{color:#404040;font-size:100% !important}.rst-content dl:not(.docutils) dt:first-child{margin-top:0}.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) tt,.rst-content dl:not(.docutils) code{font-weight:bold}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname,.rst-content dl:not(.docutils) tt.descclassname,.rst-content dl:not(.docutils) code.descclassname{background-color:transparent;border:none;padding:0;font-size:100% !important}.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) tt.descname,.rst-content dl:not(.docutils) code.descname{font-weight:bold}.rst-content dl:not(.docutils) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:bold}.rst-content dl:not(.docutils) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-link,.rst-content .viewcode-back{display:inline-block;color:#27AE60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:bold}.rst-content tt.download,.rst-content code.download{background:inherit;padding:inherit;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content tt.download span:first-child:before,.rst-content code.download span:first-child:before{margin-right:4px}@media screen and (max-width: 480px){.rst-content .sidebar{width:100%}}span[id*='MathJax-Span']{color:#404040}.math{text-align:center}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:400;src:local("Inconsolata"),local("Inconsolata-Regular"),url(../fonts/Inconsolata-Regular.ttf) format("truetype")}@font-face{font-family:"Inconsolata";font-style:normal;font-weight:700;src:local("Inconsolata Bold"),local("Inconsolata-Bold"),url(../fonts/Inconsolata-Bold.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:400;src:local("Lato Regular"),local("Lato-Regular"),url(../fonts/Lato-Regular.ttf) format("truetype")}@font-face{font-family:"Lato";font-style:normal;font-weight:700;src:local("Lato Bold"),local("Lato-Bold"),url(../fonts/Lato-Bold.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:400;src:local("Roboto Slab Regular"),local("RobotoSlab-Regular"),url(../fonts/RobotoSlab-Regular.ttf) format("truetype")}@font-face{font-family:"Roboto Slab";font-style:normal;font-weight:700;src:local("Roboto Slab Bold"),local("RobotoSlab-Bold"),url(../fonts/RobotoSlab-Bold.ttf) format("truetype")}
4 /*# sourceMappingURL=theme.css.map */
0 /* This file intentionally left blank. */
0 /*
1 * doctools.js
2 * ~~~~~~~~~~~
3 *
4 * Sphinx JavaScript utilities for all documentation.
5 *
6 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 /**
12 * select a different prefix for underscore
13 */
14 $u = _.noConflict();
15
16 /**
17 * make the code below compatible with browsers without
18 * an installed firebug like debugger
19 if (!window.console || !console.firebug) {
20 var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
21 "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
22 "profile", "profileEnd"];
23 window.console = {};
24 for (var i = 0; i < names.length; ++i)
25 window.console[names[i]] = function() {};
26 }
27 */
28
29 /**
30 * small helper function to urldecode strings
31 */
32 jQuery.urldecode = function(x) {
33 return decodeURIComponent(x).replace(/\+/g, ' ');
34 };
35
36 /**
37 * small helper function to urlencode strings
38 */
39 jQuery.urlencode = encodeURIComponent;
40
41 /**
42 * This function returns the parsed url parameters of the
43 * current request. Multiple values per key are supported,
44 * it will always return arrays of strings for the value parts.
45 */
46 jQuery.getQueryParameters = function(s) {
47 if (typeof s == 'undefined')
48 s = document.location.search;
49 var parts = s.substr(s.indexOf('?') + 1).split('&');
50 var result = {};
51 for (var i = 0; i < parts.length; i++) {
52 var tmp = parts[i].split('=', 2);
53 var key = jQuery.urldecode(tmp[0]);
54 var value = jQuery.urldecode(tmp[1]);
55 if (key in result)
56 result[key].push(value);
57 else
58 result[key] = [value];
59 }
60 return result;
61 };
62
63 /**
64 * highlight a given string on a jquery object by wrapping it in
65 * span elements with the given class name.
66 */
67 jQuery.fn.highlightText = function(text, className) {
68 function highlight(node) {
69 if (node.nodeType == 3) {
70 var val = node.nodeValue;
71 var pos = val.toLowerCase().indexOf(text);
72 if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
73 var span = document.createElement("span");
74 span.className = className;
75 span.appendChild(document.createTextNode(val.substr(pos, text.length)));
76 node.parentNode.insertBefore(span, node.parentNode.insertBefore(
77 document.createTextNode(val.substr(pos + text.length)),
78 node.nextSibling));
79 node.nodeValue = val.substr(0, pos);
80 }
81 }
82 else if (!jQuery(node).is("button, select, textarea")) {
83 jQuery.each(node.childNodes, function() {
84 highlight(this);
85 });
86 }
87 }
88 return this.each(function() {
89 highlight(this);
90 });
91 };
92
93 /*
94 * backward compatibility for jQuery.browser
95 * This will be supported until firefox bug is fixed.
96 */
97 if (!jQuery.browser) {
98 jQuery.uaMatch = function(ua) {
99 ua = ua.toLowerCase();
100
101 var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
102 /(webkit)[ \/]([\w.]+)/.exec(ua) ||
103 /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
104 /(msie) ([\w.]+)/.exec(ua) ||
105 ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
106 [];
107
108 return {
109 browser: match[ 1 ] || "",
110 version: match[ 2 ] || "0"
111 };
112 };
113 jQuery.browser = {};
114 jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
115 }
116
117 /**
118 * Small JavaScript module for the documentation.
119 */
120 var Documentation = {
121
122 init : function() {
123 this.fixFirefoxAnchorBug();
124 this.highlightSearchWords();
125 this.initIndexTable();
126
127 },
128
129 /**
130 * i18n support
131 */
132 TRANSLATIONS : {},
133 PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
134 LOCALE : 'unknown',
135
136 // gettext and ngettext don't access this so that the functions
137 // can safely bound to a different name (_ = Documentation.gettext)
138 gettext : function(string) {
139 var translated = Documentation.TRANSLATIONS[string];
140 if (typeof translated == 'undefined')
141 return string;
142 return (typeof translated == 'string') ? translated : translated[0];
143 },
144
145 ngettext : function(singular, plural, n) {
146 var translated = Documentation.TRANSLATIONS[singular];
147 if (typeof translated == 'undefined')
148 return (n == 1) ? singular : plural;
149 return translated[Documentation.PLURALEXPR(n)];
150 },
151
152 addTranslations : function(catalog) {
153 for (var key in catalog.messages)
154 this.TRANSLATIONS[key] = catalog.messages[key];
155 this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
156 this.LOCALE = catalog.locale;
157 },
158
159 /**
160 * add context elements like header anchor links
161 */
162 addContextElements : function() {
163 $('div[id] > :header:first').each(function() {
164 $('<a class="headerlink">\u00B6</a>').
165 attr('href', '#' + this.id).
166 attr('title', _('Permalink to this headline')).
167 appendTo(this);
168 });
169 $('dt[id]').each(function() {
170 $('<a class="headerlink">\u00B6</a>').
171 attr('href', '#' + this.id).
172 attr('title', _('Permalink to this definition')).
173 appendTo(this);
174 });
175 },
176
177 /**
178 * workaround a firefox stupidity
179 * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
180 */
181 fixFirefoxAnchorBug : function() {
182 if (document.location.hash)
183 window.setTimeout(function() {
184 document.location.href += '';
185 }, 10);
186 },
187
188 /**
189 * highlight the search words provided in the url in the text
190 */
191 highlightSearchWords : function() {
192 var params = $.getQueryParameters();
193 var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
194 if (terms.length) {
195 var body = $('div.body');
196 if (!body.length) {
197 body = $('body');
198 }
199 window.setTimeout(function() {
200 $.each(terms, function() {
201 body.highlightText(this.toLowerCase(), 'highlighted');
202 });
203 }, 10);
204 $('<p class="highlight-link"><a href="javascript:Documentation.' +
205 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
206 .appendTo($('#searchbox'));
207 }
208 },
209
210 /**
211 * init the domain index toggle buttons
212 */
213 initIndexTable : function() {
214 var togglers = $('img.toggler').click(function() {
215 var src = $(this).attr('src');
216 var idnum = $(this).attr('id').substr(7);
217 $('tr.cg-' + idnum).toggle();
218 if (src.substr(-9) == 'minus.png')
219 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
220 else
221 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
222 }).css('display', '');
223 if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
224 togglers.click();
225 }
226 },
227
228 /**
229 * helper function to hide the search marks again
230 */
231 hideSearchWords : function() {
232 $('#searchbox .highlight-link').fadeOut(300);
233 $('span.highlighted').removeClass('highlighted');
234 },
235
236 /**
237 * make the url absolute
238 */
239 makeURL : function(relativeURL) {
240 return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
241 },
242
243 /**
244 * get the current relative url
245 */
246 getCurrentURL : function() {
247 var path = document.location.pathname;
248 var parts = path.split(/\//);
249 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
250 if (this == '..')
251 parts.pop();
252 });
253 var url = parts.join('/');
254 return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
255 },
256
257 initOnKeyListeners: function() {
258 $(document).keyup(function(event) {
259 var activeElementType = document.activeElement.tagName;
260 // don't navigate when in search box or textarea
261 if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
262 switch (event.keyCode) {
263 case 37: // left
264 var prevHref = $('link[rel="prev"]').prop('href');
265 if (prevHref) {
266 window.location.href = prevHref;
267 return false;
268 }
269 case 39: // right
270 var nextHref = $('link[rel="next"]').prop('href');
271 if (nextHref) {
272 window.location.href = nextHref;
273 return false;
274 }
275 }
276 }
277 });
278 }
279 };
280
281 // quick alias for translations
282 _ = Documentation.gettext;
283
284 $(document).ready(function() {
285 Documentation.init();
286 });
0 <?xml version="1.0" standalone="no"?>
1 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
2 <svg xmlns="http://www.w3.org/2000/svg">
3 <metadata></metadata>
4 <defs>
5 <font id="fontawesomeregular" horiz-adv-x="1536" >
6 <font-face units-per-em="1792" ascent="1536" descent="-256" />
7 <missing-glyph horiz-adv-x="448" />
8 <glyph unicode=" " horiz-adv-x="448" />
9 <glyph unicode="&#x09;" horiz-adv-x="448" />
10 <glyph unicode="&#xa0;" horiz-adv-x="448" />
11 <glyph unicode="&#xa8;" horiz-adv-x="1792" />
12 <glyph unicode="&#xa9;" horiz-adv-x="1792" />
13 <glyph unicode="&#xae;" horiz-adv-x="1792" />
14 <glyph unicode="&#xb4;" horiz-adv-x="1792" />
15 <glyph unicode="&#xc6;" horiz-adv-x="1792" />
16 <glyph unicode="&#xd8;" horiz-adv-x="1792" />
17 <glyph unicode="&#x2000;" horiz-adv-x="768" />
18 <glyph unicode="&#x2001;" horiz-adv-x="1537" />
19 <glyph unicode="&#x2002;" horiz-adv-x="768" />
20 <glyph unicode="&#x2003;" horiz-adv-x="1537" />
21 <glyph unicode="&#x2004;" horiz-adv-x="512" />
22 <glyph unicode="&#x2005;" horiz-adv-x="384" />
23 <glyph unicode="&#x2006;" horiz-adv-x="256" />
24 <glyph unicode="&#x2007;" horiz-adv-x="256" />
25 <glyph unicode="&#x2008;" horiz-adv-x="192" />
26 <glyph unicode="&#x2009;" horiz-adv-x="307" />
27 <glyph unicode="&#x200a;" horiz-adv-x="85" />
28 <glyph unicode="&#x202f;" horiz-adv-x="307" />
29 <glyph unicode="&#x205f;" horiz-adv-x="384" />
30 <glyph unicode="&#x2122;" horiz-adv-x="1792" />
31 <glyph unicode="&#x221e;" horiz-adv-x="1792" />
32 <glyph unicode="&#x2260;" horiz-adv-x="1792" />
33 <glyph unicode="&#x25fc;" horiz-adv-x="500" d="M0 0z" />
34 <glyph unicode="&#xf000;" horiz-adv-x="1792" d="M1699 1350q0 -35 -43 -78l-632 -632v-768h320q26 0 45 -19t19 -45t-19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45t45 19h320v768l-632 632q-43 43 -43 78q0 23 18 36.5t38 17.5t43 4h1408q23 0 43 -4t38 -17.5t18 -36.5z" />
35 <glyph unicode="&#xf001;" d="M1536 1312v-1120q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v537l-768 -237v-709q0 -50 -34 -89t-86 -60.5t-103.5 -32t-96.5 -10.5t-96.5 10.5t-103.5 32t-86 60.5t-34 89 t34 89t86 60.5t103.5 32t96.5 10.5q105 0 192 -39v967q0 31 19 56.5t49 35.5l832 256q12 4 28 4q40 0 68 -28t28 -68z" />
36 <glyph unicode="&#xf002;" horiz-adv-x="1664" d="M1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -52 -38 -90t-90 -38q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5 t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
37 <glyph unicode="&#xf003;" horiz-adv-x="1792" d="M1664 32v768q-32 -36 -69 -66q-268 -206 -426 -338q-51 -43 -83 -67t-86.5 -48.5t-102.5 -24.5h-1h-1q-48 0 -102.5 24.5t-86.5 48.5t-83 67q-158 132 -426 338q-37 30 -69 66v-768q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1664 1083v11v13.5t-0.5 13 t-3 12.5t-5.5 9t-9 7.5t-14 2.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5q0 -168 147 -284q193 -152 401 -317q6 -5 35 -29.5t46 -37.5t44.5 -31.5t50.5 -27.5t43 -9h1h1q20 0 43 9t50.5 27.5t44.5 31.5t46 37.5t35 29.5q208 165 401 317q54 43 100.5 115.5t46.5 131.5z M1792 1120v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47t47 -113z" />
38 <glyph unicode="&#xf004;" horiz-adv-x="1792" d="M896 -128q-26 0 -44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5q224 0 351 -124t127 -344q0 -221 -229 -450l-623 -600 q-18 -18 -44 -18z" />
39 <glyph unicode="&#xf005;" horiz-adv-x="1664" d="M1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -21 -10.5 -35.5t-30.5 -14.5q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455 l502 -73q56 -9 56 -46z" />
40 <glyph unicode="&#xf006;" horiz-adv-x="1664" d="M1137 532l306 297l-422 62l-189 382l-189 -382l-422 -62l306 -297l-73 -421l378 199l377 -199zM1664 889q0 -22 -26 -48l-363 -354l86 -500q1 -7 1 -20q0 -50 -41 -50q-19 0 -40 12l-449 236l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500 l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41t49 -41l225 -455l502 -73q56 -9 56 -46z" />
41 <glyph unicode="&#xf007;" horiz-adv-x="1408" d="M1408 131q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5t43 97.5t62 81t85.5 53.5t111.5 20q9 0 42 -21.5t74.5 -48t108 -48t133.5 -21.5t133.5 21.5t108 48t74.5 48t42 21.5q61 0 111.5 -20t85.5 -53.5t62 -81 t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5z" />
42 <glyph unicode="&#xf008;" horiz-adv-x="1920" d="M384 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 320v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM384 704v128q0 26 -19 45t-45 19h-128 q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 -64v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM384 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45 t45 -19h128q26 0 45 19t19 45zM1792 -64v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1408 704v512q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-512q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1792 320v128 q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 704v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1792 1088v128q0 26 -19 45t-45 19h-128q-26 0 -45 -19 t-19 -45v-128q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1920 1248v-1344q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1344q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
43 <glyph unicode="&#xf009;" horiz-adv-x="1664" d="M768 512v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM768 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 512v-384q0 -52 -38 -90t-90 -38 h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90zM1664 1280v-384q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
44 <glyph unicode="&#xf00a;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 288v-192q0 -40 -28 -68t-68 -28h-320 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1152 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68z" />
45 <glyph unicode="&#xf00b;" horiz-adv-x="1792" d="M512 288v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM512 800v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 288v-192q0 -40 -28 -68t-68 -28h-960 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68zM512 1312v-192q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h320q40 0 68 -28t28 -68zM1792 800v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28 h960q40 0 68 -28t28 -68zM1792 1312v-192q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h960q40 0 68 -28t28 -68z" />
46 <glyph unicode="&#xf00c;" horiz-adv-x="1792" d="M1671 970q0 -40 -28 -68l-724 -724l-136 -136q-28 -28 -68 -28t-68 28l-136 136l-362 362q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -295l656 657q28 28 68 28t68 -28l136 -136q28 -28 28 -68z" />
47 <glyph unicode="&#xf00d;" horiz-adv-x="1408" d="M1298 214q0 -40 -28 -68l-136 -136q-28 -28 -68 -28t-68 28l-294 294l-294 -294q-28 -28 -68 -28t-68 28l-136 136q-28 28 -28 68t28 68l294 294l-294 294q-28 28 -28 68t28 68l136 136q28 28 68 28t68 -28l294 -294l294 294q28 28 68 28t68 -28l136 -136q28 -28 28 -68 t-28 -68l-294 -294l294 -294q28 -28 28 -68z" />
48 <glyph unicode="&#xf00e;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-224q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v224h-224q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h224v224q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5v-224h224 q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5zM1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5 t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z" />
49 <glyph unicode="&#xf010;" horiz-adv-x="1664" d="M1024 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-576q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h576q13 0 22.5 -9.5t9.5 -22.5zM1152 704q0 185 -131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5t316.5 131.5t131.5 316.5z M1664 -128q0 -53 -37.5 -90.5t-90.5 -37.5q-54 0 -90 38l-343 342q-179 -124 -399 -124q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -220 -124 -399l343 -343q37 -37 37 -90z " />
50 <glyph unicode="&#xf011;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61t-298 61t-245 164t-164 245t-61 298q0 182 80.5 343t226.5 270q43 32 95.5 25t83.5 -50q32 -42 24.5 -94.5t-49.5 -84.5q-98 -74 -151.5 -181t-53.5 -228q0 -104 40.5 -198.5t109.5 -163.5t163.5 -109.5 t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5q0 121 -53.5 228t-151.5 181q-42 32 -49.5 84.5t24.5 94.5q31 43 84 50t95 -25q146 -109 226.5 -270t80.5 -343zM896 1408v-640q0 -52 -38 -90t-90 -38t-90 38t-38 90v640q0 52 38 90t90 38t90 -38t38 -90z" />
51 <glyph unicode="&#xf012;" horiz-adv-x="1792" d="M256 96v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 224v-320q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 480v-576q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v576q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1408 864v-960q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1376v-1472q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1472q0 14 9 23t23 9h192q14 0 23 -9t9 -23z" />
52 <glyph unicode="&#xf013;" d="M1024 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1536 749v-222q0 -12 -8 -23t-20 -13l-185 -28q-19 -54 -39 -91q35 -50 107 -138q10 -12 10 -25t-9 -23q-27 -37 -99 -108t-94 -71q-12 0 -26 9l-138 108q-44 -23 -91 -38 q-16 -136 -29 -186q-7 -28 -36 -28h-222q-14 0 -24.5 8.5t-11.5 21.5l-28 184q-49 16 -90 37l-141 -107q-10 -9 -25 -9q-14 0 -25 11q-126 114 -165 168q-7 10 -7 23q0 12 8 23q15 21 51 66.5t54 70.5q-27 50 -41 99l-183 27q-13 2 -21 12.5t-8 23.5v222q0 12 8 23t19 13 l186 28q14 46 39 92q-40 57 -107 138q-10 12 -10 24q0 10 9 23q26 36 98.5 107.5t94.5 71.5q13 0 26 -10l138 -107q44 23 91 38q16 136 29 186q7 28 36 28h222q14 0 24.5 -8.5t11.5 -21.5l28 -184q49 -16 90 -37l142 107q9 9 24 9q13 0 25 -10q129 -119 165 -170q7 -8 7 -22 q0 -12 -8 -23q-15 -21 -51 -66.5t-54 -70.5q26 -50 41 -98l183 -28q13 -2 21 -12.5t8 -23.5z" />
53 <glyph unicode="&#xf014;" horiz-adv-x="1408" d="M512 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM768 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1024 800v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1152 76v948h-896v-948q0 -22 7 -40.5t14.5 -27t10.5 -8.5h832q3 0 10.5 8.5t14.5 27t7 40.5zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832 q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
54 <glyph unicode="&#xf015;" horiz-adv-x="1664" d="M1408 544v-480q0 -26 -19 -45t-45 -19h-384v384h-256v-384h-384q-26 0 -45 19t-19 45v480q0 1 0.5 3t0.5 3l575 474l575 -474q1 -2 1 -6zM1631 613l-62 -74q-8 -9 -21 -11h-3q-13 0 -21 7l-692 577l-692 -577q-12 -8 -24 -7q-13 2 -21 11l-62 74q-8 10 -7 23.5t11 21.5 l719 599q32 26 76 26t76 -26l244 -204v195q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-408l219 -182q10 -8 11 -21.5t-7 -23.5z" />
55 <glyph unicode="&#xf016;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z " />
56 <glyph unicode="&#xf017;" d="M896 992v-448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
57 <glyph unicode="&#xf018;" horiz-adv-x="1920" d="M1111 540v4l-24 320q-1 13 -11 22.5t-23 9.5h-186q-13 0 -23 -9.5t-11 -22.5l-24 -320v-4q-1 -12 8 -20t21 -8h244q12 0 21 8t8 20zM1870 73q0 -73 -46 -73h-704q13 0 22 9.5t8 22.5l-20 256q-1 13 -11 22.5t-23 9.5h-272q-13 0 -23 -9.5t-11 -22.5l-20 -256 q-1 -13 8 -22.5t22 -9.5h-704q-46 0 -46 73q0 54 26 116l417 1044q8 19 26 33t38 14h339q-13 0 -23 -9.5t-11 -22.5l-15 -192q-1 -14 8 -23t22 -9h166q13 0 22 9t8 23l-15 192q-1 13 -11 22.5t-23 9.5h339q20 0 38 -14t26 -33l417 -1044q26 -62 26 -116z" />
58 <glyph unicode="&#xf019;" horiz-adv-x="1664" d="M1280 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 416v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h465l135 -136 q58 -56 136 -56t136 56l136 136h464q40 0 68 -28t28 -68zM1339 985q17 -41 -14 -70l-448 -448q-18 -19 -45 -19t-45 19l-448 448q-31 29 -14 70q17 39 59 39h256v448q0 26 19 45t45 19h256q26 0 45 -19t19 -45v-448h256q42 0 59 -39z" />
59 <glyph unicode="&#xf01a;" d="M1120 608q0 -12 -10 -24l-319 -319q-11 -9 -23 -9t-23 9l-320 320q-15 16 -7 35q8 20 30 20h192v352q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-352h192q14 0 23 -9t9 -23zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273 t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
60 <glyph unicode="&#xf01b;" d="M1118 660q-8 -20 -30 -20h-192v-352q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v352h-192q-14 0 -23 9t-9 23q0 12 10 24l319 319q11 9 23 9t23 -9l320 -320q15 -16 7 -35zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198 t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
61 <glyph unicode="&#xf01c;" d="M1023 576h316q-1 3 -2.5 8t-2.5 8l-212 496h-708l-212 -496q-1 -2 -2.5 -8t-2.5 -8h316l95 -192h320zM1536 546v-482q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v482q0 62 25 123l238 552q10 25 36.5 42t52.5 17h832q26 0 52.5 -17t36.5 -42l238 -552 q25 -61 25 -123z" />
62 <glyph unicode="&#xf01d;" d="M1184 640q0 -37 -32 -55l-544 -320q-15 -9 -32 -9q-16 0 -32 8q-32 19 -32 56v640q0 37 32 56q33 18 64 -1l544 -320q32 -18 32 -55zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
63 <glyph unicode="&#xf01e;" d="M1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l138 138q-148 137 -349 137q-104 0 -198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5q119 0 225 52t179 147q7 10 23 12q14 0 25 -9 l137 -138q9 -8 9.5 -20.5t-7.5 -22.5q-109 -132 -264 -204.5t-327 -72.5q-156 0 -298 61t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q147 0 284.5 -55.5t244.5 -156.5l130 129q29 31 70 14q39 -17 39 -59z" />
64 <glyph unicode="&#xf021;" d="M1511 480q0 -5 -1 -7q-64 -268 -268 -434.5t-478 -166.5q-146 0 -282.5 55t-243.5 157l-129 -129q-19 -19 -45 -19t-45 19t-19 45v448q0 26 19 45t45 19h448q26 0 45 -19t19 -45t-19 -45l-137 -137q71 -66 161 -102t187 -36q134 0 250 65t186 179q11 17 53 117 q8 23 30 23h192q13 0 22.5 -9.5t9.5 -22.5zM1536 1280v-448q0 -26 -19 -45t-45 -19h-448q-26 0 -45 19t-19 45t19 45l138 138q-148 137 -349 137q-134 0 -250 -65t-186 -179q-11 -17 -53 -117q-8 -23 -30 -23h-199q-13 0 -22.5 9.5t-9.5 22.5v7q65 268 270 434.5t480 166.5 q146 0 284 -55.5t245 -156.5l130 129q19 19 45 19t45 -19t19 -45z" />
65 <glyph unicode="&#xf022;" horiz-adv-x="1792" d="M384 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M384 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1536 352v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5z M1536 608v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5t9.5 -22.5zM1536 864v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h960q13 0 22.5 -9.5 t9.5 -22.5zM1664 160v832q0 13 -9.5 22.5t-22.5 9.5h-1472q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1472q13 0 22.5 9.5t9.5 22.5zM1792 1248v-1088q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1472q66 0 113 -47 t47 -113z" />
66 <glyph unicode="&#xf023;" horiz-adv-x="1152" d="M320 768h512v192q0 106 -75 181t-181 75t-181 -75t-75 -181v-192zM1152 672v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v192q0 184 132 316t316 132t316 -132t132 -316v-192h32q40 0 68 -28t28 -68z" />
67 <glyph unicode="&#xf024;" horiz-adv-x="1792" d="M320 1280q0 -72 -64 -110v-1266q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v1266q-64 38 -64 110q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -25 -12.5 -38.5t-39.5 -27.5q-215 -116 -369 -116q-61 0 -123.5 22t-108.5 48 t-115.5 48t-142.5 22q-192 0 -464 -146q-17 -9 -33 -9q-26 0 -45 19t-19 45v742q0 32 31 55q21 14 79 43q236 120 421 120q107 0 200 -29t219 -88q38 -19 88 -19q54 0 117.5 21t110 47t88 47t54.5 21q26 0 45 -19t19 -45z" />
68 <glyph unicode="&#xf025;" horiz-adv-x="1664" d="M1664 650q0 -166 -60 -314l-20 -49l-185 -33q-22 -83 -90.5 -136.5t-156.5 -53.5v-32q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v576q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-32q71 0 130 -35.5t93 -95.5l68 12q29 95 29 193q0 148 -88 279t-236.5 209t-315.5 78 t-315.5 -78t-236.5 -209t-88 -279q0 -98 29 -193l68 -12q34 60 93 95.5t130 35.5v32q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-576q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v32q-88 0 -156.5 53.5t-90.5 136.5l-185 33l-20 49q-60 148 -60 314q0 151 67 291t179 242.5 t266 163.5t320 61t320 -61t266 -163.5t179 -242.5t67 -291z" />
69 <glyph unicode="&#xf026;" horiz-adv-x="768" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45z" />
70 <glyph unicode="&#xf027;" horiz-adv-x="1152" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142z" />
71 <glyph unicode="&#xf028;" horiz-adv-x="1664" d="M768 1184v-1088q0 -26 -19 -45t-45 -19t-45 19l-333 333h-262q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h262l333 333q19 19 45 19t45 -19t19 -45zM1152 640q0 -76 -42.5 -141.5t-112.5 -93.5q-10 -5 -25 -5q-26 0 -45 18.5t-19 45.5q0 21 12 35.5t29 25t34 23t29 35.5 t12 57t-12 57t-29 35.5t-34 23t-29 25t-12 35.5q0 27 19 45.5t45 18.5q15 0 25 -5q70 -27 112.5 -93t42.5 -142zM1408 640q0 -153 -85 -282.5t-225 -188.5q-13 -5 -25 -5q-27 0 -46 19t-19 45q0 39 39 59q56 29 76 44q74 54 115.5 135.5t41.5 173.5t-41.5 173.5 t-115.5 135.5q-20 15 -76 44q-39 20 -39 59q0 26 19 45t45 19q13 0 26 -5q140 -59 225 -188.5t85 -282.5zM1664 640q0 -230 -127 -422.5t-338 -283.5q-13 -5 -26 -5q-26 0 -45 19t-19 45q0 36 39 59q7 4 22.5 10.5t22.5 10.5q46 25 82 51q123 91 192 227t69 289t-69 289 t-192 227q-36 26 -82 51q-7 4 -22.5 10.5t-22.5 10.5q-39 23 -39 59q0 26 19 45t45 19q13 0 26 -5q211 -91 338 -283.5t127 -422.5z" />
72 <glyph unicode="&#xf029;" horiz-adv-x="1408" d="M384 384v-128h-128v128h128zM384 1152v-128h-128v128h128zM1152 1152v-128h-128v128h128zM128 129h384v383h-384v-383zM128 896h384v384h-384v-384zM896 896h384v384h-384v-384zM640 640v-640h-640v640h640zM1152 128v-128h-128v128h128zM1408 128v-128h-128v128h128z M1408 640v-384h-384v128h-128v-384h-128v640h384v-128h128v128h128zM640 1408v-640h-640v640h640zM1408 1408v-640h-640v640h640z" />
73 <glyph unicode="&#xf02a;" horiz-adv-x="1792" d="M63 0h-63v1408h63v-1408zM126 1h-32v1407h32v-1407zM220 1h-31v1407h31v-1407zM377 1h-31v1407h31v-1407zM534 1h-62v1407h62v-1407zM660 1h-31v1407h31v-1407zM723 1h-31v1407h31v-1407zM786 1h-31v1407h31v-1407zM943 1h-63v1407h63v-1407zM1100 1h-63v1407h63v-1407z M1226 1h-63v1407h63v-1407zM1352 1h-63v1407h63v-1407zM1446 1h-63v1407h63v-1407zM1635 1h-94v1407h94v-1407zM1698 1h-32v1407h32v-1407zM1792 0h-63v1408h63v-1408z" />
74 <glyph unicode="&#xf02b;" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91z" />
75 <glyph unicode="&#xf02c;" horiz-adv-x="1920" d="M448 1088q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1515 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-53 0 -90 37l-715 716q-38 37 -64.5 101t-26.5 117v416q0 52 38 90t90 38h416q53 0 117 -26.5t102 -64.5 l715 -714q37 -39 37 -91zM1899 512q0 -53 -37 -90l-491 -492q-39 -37 -91 -37q-36 0 -59 14t-53 45l470 470q37 37 37 90q0 52 -37 91l-715 714q-38 38 -102 64.5t-117 26.5h224q53 0 117 -26.5t102 -64.5l715 -714q37 -39 37 -91z" />
76 <glyph unicode="&#xf02d;" horiz-adv-x="1664" d="M1639 1058q40 -57 18 -129l-275 -906q-19 -64 -76.5 -107.5t-122.5 -43.5h-923q-77 0 -148.5 53.5t-99.5 131.5q-24 67 -2 127q0 4 3 27t4 37q1 8 -3 21.5t-3 19.5q2 11 8 21t16.5 23.5t16.5 23.5q23 38 45 91.5t30 91.5q3 10 0.5 30t-0.5 28q3 11 17 28t17 23 q21 36 42 92t25 90q1 9 -2.5 32t0.5 28q4 13 22 30.5t22 22.5q19 26 42.5 84.5t27.5 96.5q1 8 -3 25.5t-2 26.5q2 8 9 18t18 23t17 21q8 12 16.5 30.5t15 35t16 36t19.5 32t26.5 23.5t36 11.5t47.5 -5.5l-1 -3q38 9 51 9h761q74 0 114 -56t18 -130l-274 -906 q-36 -119 -71.5 -153.5t-128.5 -34.5h-869q-27 0 -38 -15q-11 -16 -1 -43q24 -70 144 -70h923q29 0 56 15.5t35 41.5l300 987q7 22 5 57q38 -15 59 -43zM575 1056q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5 t-16.5 -22.5zM492 800q-4 -13 2 -22.5t20 -9.5h608q13 0 25.5 9.5t16.5 22.5l21 64q4 13 -2 22.5t-20 9.5h-608q-13 0 -25.5 -9.5t-16.5 -22.5z" />
77 <glyph unicode="&#xf02e;" horiz-adv-x="1280" d="M1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
78 <glyph unicode="&#xf02f;" horiz-adv-x="1664" d="M384 0h896v256h-896v-256zM384 640h896v384h-160q-40 0 -68 28t-28 68v160h-640v-640zM1536 576q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 576v-416q0 -13 -9.5 -22.5t-22.5 -9.5h-224v-160q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68 v160h-224q-13 0 -22.5 9.5t-9.5 22.5v416q0 79 56.5 135.5t135.5 56.5h64v544q0 40 28 68t68 28h672q40 0 88 -20t76 -48l152 -152q28 -28 48 -76t20 -88v-256h64q79 0 135.5 -56.5t56.5 -135.5z" />
79 <glyph unicode="&#xf030;" horiz-adv-x="1920" d="M960 864q119 0 203.5 -84.5t84.5 -203.5t-84.5 -203.5t-203.5 -84.5t-203.5 84.5t-84.5 203.5t84.5 203.5t203.5 84.5zM1664 1280q106 0 181 -75t75 -181v-896q0 -106 -75 -181t-181 -75h-1408q-106 0 -181 75t-75 181v896q0 106 75 181t181 75h224l51 136 q19 49 69.5 84.5t103.5 35.5h512q53 0 103.5 -35.5t69.5 -84.5l51 -136h224zM960 128q185 0 316.5 131.5t131.5 316.5t-131.5 316.5t-316.5 131.5t-316.5 -131.5t-131.5 -316.5t131.5 -316.5t316.5 -131.5z" />
80 <glyph unicode="&#xf031;" horiz-adv-x="1664" d="M725 977l-170 -450q33 0 136.5 -2t160.5 -2q19 0 57 2q-87 253 -184 452zM0 -128l2 79q23 7 56 12.5t57 10.5t49.5 14.5t44.5 29t31 50.5l237 616l280 724h75h53q8 -14 11 -21l205 -480q33 -78 106 -257.5t114 -274.5q15 -34 58 -144.5t72 -168.5q20 -45 35 -57 q19 -15 88 -29.5t84 -20.5q6 -38 6 -57q0 -4 -0.5 -13t-0.5 -13q-63 0 -190 8t-191 8q-76 0 -215 -7t-178 -8q0 43 4 78l131 28q1 0 12.5 2.5t15.5 3.5t14.5 4.5t15 6.5t11 8t9 11t2.5 14q0 16 -31 96.5t-72 177.5t-42 100l-450 2q-26 -58 -76.5 -195.5t-50.5 -162.5 q0 -22 14 -37.5t43.5 -24.5t48.5 -13.5t57 -8.5t41 -4q1 -19 1 -58q0 -9 -2 -27q-58 0 -174.5 10t-174.5 10q-8 0 -26.5 -4t-21.5 -4q-80 -14 -188 -14z" />
81 <glyph unicode="&#xf032;" horiz-adv-x="1408" d="M555 15q74 -32 140 -32q376 0 376 335q0 114 -41 180q-27 44 -61.5 74t-67.5 46.5t-80.5 25t-84 10.5t-94.5 2q-73 0 -101 -10q0 -53 -0.5 -159t-0.5 -158q0 -8 -1 -67.5t-0.5 -96.5t4.5 -83.5t12 -66.5zM541 761q42 -7 109 -7q82 0 143 13t110 44.5t74.5 89.5t25.5 142 q0 70 -29 122.5t-79 82t-108 43.5t-124 14q-50 0 -130 -13q0 -50 4 -151t4 -152q0 -27 -0.5 -80t-0.5 -79q0 -46 1 -69zM0 -128l2 94q15 4 85 16t106 27q7 12 12.5 27t8.5 33.5t5.5 32.5t3 37.5t0.5 34v35.5v30q0 982 -22 1025q-4 8 -22 14.5t-44.5 11t-49.5 7t-48.5 4.5 t-30.5 3l-4 83q98 2 340 11.5t373 9.5q23 0 68.5 -0.5t67.5 -0.5q70 0 136.5 -13t128.5 -42t108 -71t74 -104.5t28 -137.5q0 -52 -16.5 -95.5t-39 -72t-64.5 -57.5t-73 -45t-84 -40q154 -35 256.5 -134t102.5 -248q0 -100 -35 -179.5t-93.5 -130.5t-138 -85.5t-163.5 -48.5 t-176 -14q-44 0 -132 3t-132 3q-106 0 -307 -11t-231 -12z" />
82 <glyph unicode="&#xf033;" horiz-adv-x="1024" d="M0 -126l17 85q6 2 81.5 21.5t111.5 37.5q28 35 41 101q1 7 62 289t114 543.5t52 296.5v25q-24 13 -54.5 18.5t-69.5 8t-58 5.5l19 103q33 -2 120 -6.5t149.5 -7t120.5 -2.5q48 0 98.5 2.5t121 7t98.5 6.5q-5 -39 -19 -89q-30 -10 -101.5 -28.5t-108.5 -33.5 q-8 -19 -14 -42.5t-9 -40t-7.5 -45.5t-6.5 -42q-27 -148 -87.5 -419.5t-77.5 -355.5q-2 -9 -13 -58t-20 -90t-16 -83.5t-6 -57.5l1 -18q17 -4 185 -31q-3 -44 -16 -99q-11 0 -32.5 -1.5t-32.5 -1.5q-29 0 -87 10t-86 10q-138 2 -206 2q-51 0 -143 -9t-121 -11z" />
83 <glyph unicode="&#xf034;" horiz-adv-x="1792" d="M1744 128q33 0 42 -18.5t-11 -44.5l-126 -162q-20 -26 -49 -26t-49 26l-126 162q-20 26 -11 44.5t42 18.5h80v1024h-80q-33 0 -42 18.5t11 44.5l126 162q20 26 49 26t49 -26l126 -162q20 -26 11 -44.5t-42 -18.5h-80v-1024h80zM81 1407l54 -27q12 -5 211 -5q44 0 132 2 t132 2q36 0 107.5 -0.5t107.5 -0.5h293q6 0 21 -0.5t20.5 0t16 3t17.5 9t15 17.5l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 48t-14.5 73.5t-7.5 35.5q-6 8 -12 12.5t-15.5 6t-13 2.5t-18 0.5t-16.5 -0.5 q-17 0 -66.5 0.5t-74.5 0.5t-64 -2t-71 -6q-9 -81 -8 -136q0 -94 2 -388t2 -455q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q19 42 19 383q0 101 -3 303t-3 303v117q0 2 0.5 15.5t0.5 25t-1 25.5t-3 24t-5 14q-11 12 -162 12q-33 0 -93 -12t-80 -26q-19 -13 -34 -72.5t-31.5 -111t-42.5 -53.5q-42 26 -56 44v383z" />
84 <glyph unicode="&#xf035;" d="M81 1407l54 -27q12 -5 211 -5q44 0 132 2t132 2q70 0 246.5 1t304.5 0.5t247 -4.5q33 -1 56 31l42 1q4 0 14 -0.5t14 -0.5q2 -112 2 -336q0 -80 -5 -109q-39 -14 -68 -18q-25 44 -54 128q-3 9 -11 47.5t-15 73.5t-7 36q-10 13 -27 19q-5 2 -66 2q-30 0 -93 1t-103 1 t-94 -2t-96 -7q-9 -81 -8 -136l1 -152v52q0 -55 1 -154t1.5 -180t0.5 -153q0 -16 -2.5 -71.5t0 -91.5t12.5 -69q40 -21 124 -42.5t120 -37.5q5 -40 5 -50q0 -14 -3 -29l-34 -1q-76 -2 -218 8t-207 10q-50 0 -151 -9t-152 -9q-3 51 -3 52v9q17 27 61.5 43t98.5 29t78 27 q7 16 11.5 74t6 145.5t1.5 155t-0.5 153.5t-0.5 89q0 7 -2.5 21.5t-2.5 22.5q0 7 0.5 44t1 73t0 76.5t-3 67.5t-6.5 32q-11 12 -162 12q-41 0 -163 -13.5t-138 -24.5q-19 -12 -34 -71.5t-31.5 -111.5t-42.5 -54q-42 26 -56 44v383zM1310 125q12 0 42 -19.5t57.5 -41.5 t59.5 -49t36 -30q26 -21 26 -49t-26 -49q-4 -3 -36 -30t-59.5 -49t-57.5 -41.5t-42 -19.5q-13 0 -20.5 10.5t-10 28.5t-2.5 33.5t1.5 33t1.5 19.5h-1024q0 -2 1.5 -19.5t1.5 -33t-2.5 -33.5t-10 -28.5t-20.5 -10.5q-12 0 -42 19.5t-57.5 41.5t-59.5 49t-36 30q-26 21 -26 49 t26 49q4 3 36 30t59.5 49t57.5 41.5t42 19.5q13 0 20.5 -10.5t10 -28.5t2.5 -33.5t-1.5 -33t-1.5 -19.5h1024q0 2 -1.5 19.5t-1.5 33t2.5 33.5t10 28.5t20.5 10.5z" />
85 <glyph unicode="&#xf036;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
86 <glyph unicode="&#xf037;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1408 576v-128q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45 -19t19 -45zM1664 960v-128q0 -26 -19 -45t-45 -19 h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1280 1344v-128q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h640q26 0 45 -19t19 -45z" />
87 <glyph unicode="&#xf038;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1280q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1536q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1536q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1152q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
88 <glyph unicode="&#xf039;" horiz-adv-x="1792" d="M1792 192v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 576v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 960v-128q0 -26 -19 -45 t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-128q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
89 <glyph unicode="&#xf03a;" horiz-adv-x="1792" d="M256 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM256 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5 t9.5 -22.5zM256 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344 q13 0 22.5 -9.5t9.5 -22.5zM256 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-192q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h192q13 0 22.5 -9.5t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v192 q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5z" />
90 <glyph unicode="&#xf03b;" horiz-adv-x="1792" d="M384 992v-576q0 -13 -9.5 -22.5t-22.5 -9.5q-14 0 -23 9l-288 288q-9 9 -9 23t9 23l288 288q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
91 <glyph unicode="&#xf03c;" horiz-adv-x="1792" d="M352 704q0 -14 -9 -23l-288 -288q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v576q0 13 9.5 22.5t22.5 9.5q14 0 23 -9l288 -288q9 -9 9 -23zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5 t9.5 -22.5zM1792 608v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088q13 0 22.5 -9.5t9.5 -22.5zM1792 992v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1088q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1088 q13 0 22.5 -9.5t9.5 -22.5zM1792 1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1728q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1728q13 0 22.5 -9.5t9.5 -22.5z" />
92 <glyph unicode="&#xf03d;" horiz-adv-x="1792" d="M1792 1184v-1088q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-403 403v-166q0 -119 -84.5 -203.5t-203.5 -84.5h-704q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h704q119 0 203.5 -84.5t84.5 -203.5v-165l403 402q18 19 45 19q12 0 25 -5 q39 -17 39 -59z" />
93 <glyph unicode="&#xf03e;" horiz-adv-x="1920" d="M640 960q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1664 576v-448h-1408v192l320 320l160 -160l512 512zM1760 1280h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-1216q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5v1216 q0 13 -9.5 22.5t-22.5 9.5zM1920 1248v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
94 <glyph unicode="&#xf040;" d="M363 0l91 91l-235 235l-91 -91v-107h128v-128h107zM886 928q0 22 -22 22q-10 0 -17 -7l-542 -542q-7 -7 -7 -17q0 -22 22 -22q10 0 17 7l542 542q7 7 7 17zM832 1120l416 -416l-832 -832h-416v416zM1515 1024q0 -53 -37 -90l-166 -166l-416 416l166 165q36 38 90 38 q53 0 91 -38l235 -234q37 -39 37 -91z" />
95 <glyph unicode="&#xf041;" horiz-adv-x="1024" d="M768 896q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1024 896q0 -109 -33 -179l-364 -774q-16 -33 -47.5 -52t-67.5 -19t-67.5 19t-46.5 52l-365 774q-33 70 -33 179q0 212 150 362t362 150t362 -150t150 -362z" />
96 <glyph unicode="&#xf042;" d="M768 96v1088q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
97 <glyph unicode="&#xf043;" horiz-adv-x="1024" d="M512 384q0 36 -20 69q-1 1 -15.5 22.5t-25.5 38t-25 44t-21 50.5q-4 16 -21 16t-21 -16q-7 -23 -21 -50.5t-25 -44t-25.5 -38t-15.5 -22.5q-20 -33 -20 -69q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 512q0 -212 -150 -362t-362 -150t-362 150t-150 362 q0 145 81 275q6 9 62.5 90.5t101 151t99.5 178t83 201.5q9 30 34 47t51 17t51.5 -17t33.5 -47q28 -93 83 -201.5t99.5 -178t101 -151t62.5 -90.5q81 -127 81 -275z" />
98 <glyph unicode="&#xf044;" horiz-adv-x="1792" d="M888 352l116 116l-152 152l-116 -116v-56h96v-96h56zM1328 1072q-16 16 -33 -1l-350 -350q-17 -17 -1 -33t33 1l350 350q17 17 1 33zM1408 478v-190q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-14 -14 -32 -8q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v126q0 13 9 22l64 64q15 15 35 7t20 -29zM1312 1216l288 -288l-672 -672h-288v288zM1756 1084l-92 -92 l-288 288l92 92q28 28 68 28t68 -28l152 -152q28 -28 28 -68t-28 -68z" />
99 <glyph unicode="&#xf045;" horiz-adv-x="1664" d="M1408 547v-259q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h255v0q13 0 22.5 -9.5t9.5 -22.5q0 -27 -26 -32q-77 -26 -133 -60q-10 -4 -16 -4h-112q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832 q66 0 113 47t47 113v214q0 19 18 29q28 13 54 37q16 16 35 8q21 -9 21 -29zM1645 1043l-384 -384q-18 -19 -45 -19q-12 0 -25 5q-39 17 -39 59v192h-160q-323 0 -438 -131q-119 -137 -74 -473q3 -23 -20 -34q-8 -2 -12 -2q-16 0 -26 13q-10 14 -21 31t-39.5 68.5t-49.5 99.5 t-38.5 114t-17.5 122q0 49 3.5 91t14 90t28 88t47 81.5t68.5 74t94.5 61.5t124.5 48.5t159.5 30.5t196.5 11h160v192q0 42 39 59q13 5 25 5q26 0 45 -19l384 -384q19 -19 19 -45t-19 -45z" />
100 <glyph unicode="&#xf046;" horiz-adv-x="1664" d="M1408 606v-318q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q63 0 117 -25q15 -7 18 -23q3 -17 -9 -29l-49 -49q-10 -10 -23 -10q-3 0 -9 2q-23 6 -45 6h-832q-66 0 -113 -47t-47 -113v-832 q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v254q0 13 9 22l64 64q10 10 23 10q6 0 12 -3q20 -8 20 -29zM1639 1095l-814 -814q-24 -24 -57 -24t-57 24l-430 430q-24 24 -24 57t24 57l110 110q24 24 57 24t57 -24l263 -263l647 647q24 24 57 24t57 -24l110 -110 q24 -24 24 -57t-24 -57z" />
101 <glyph unicode="&#xf047;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-384v-384h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v384h-384v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45 t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h384v384h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45t-19 -45t-45 -19h-128v-384h384v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
102 <glyph unicode="&#xf048;" horiz-adv-x="1024" d="M979 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19z" />
103 <glyph unicode="&#xf049;" horiz-adv-x="1792" d="M1747 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-9 9 -13 19v-678q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-678q4 11 13 19l710 710 q19 19 32 13t13 -32v-710q4 11 13 19z" />
104 <glyph unicode="&#xf04a;" horiz-adv-x="1664" d="M1619 1395q19 19 32 13t13 -32v-1472q0 -26 -13 -32t-32 13l-710 710q-8 9 -13 19v-710q0 -26 -13 -32t-32 13l-710 710q-19 19 -19 45t19 45l710 710q19 19 32 13t13 -32v-710q5 11 13 19z" />
105 <glyph unicode="&#xf04b;" horiz-adv-x="1408" d="M1384 609l-1328 -738q-23 -13 -39.5 -3t-16.5 36v1472q0 26 16.5 36t39.5 -3l1328 -738q23 -13 23 -31t-23 -31z" />
106 <glyph unicode="&#xf04c;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45zM640 1344v-1408q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h512q26 0 45 -19t19 -45z" />
107 <glyph unicode="&#xf04d;" d="M1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
108 <glyph unicode="&#xf04e;" horiz-adv-x="1664" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q19 -19 19 -45t-19 -45l-710 -710q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
109 <glyph unicode="&#xf050;" horiz-adv-x="1792" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v710q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19l-710 -710 q-19 -19 -32 -13t-13 32v710q-5 -10 -13 -19z" />
110 <glyph unicode="&#xf051;" horiz-adv-x="1024" d="M45 -115q-19 -19 -32 -13t-13 32v1472q0 26 13 32t32 -13l710 -710q8 -8 13 -19v678q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-1408q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v678q-5 -10 -13 -19z" />
111 <glyph unicode="&#xf052;" horiz-adv-x="1538" d="M14 557l710 710q19 19 45 19t45 -19l710 -710q19 -19 13 -32t-32 -13h-1472q-26 0 -32 13t13 32zM1473 0h-1408q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1408q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19z" />
112 <glyph unicode="&#xf053;" horiz-adv-x="1280" d="M1171 1235l-531 -531l531 -531q19 -19 19 -45t-19 -45l-166 -166q-19 -19 -45 -19t-45 19l-742 742q-19 19 -19 45t19 45l742 742q19 19 45 19t45 -19l166 -166q19 -19 19 -45t-19 -45z" />
113 <glyph unicode="&#xf054;" horiz-adv-x="1280" d="M1107 659l-742 -742q-19 -19 -45 -19t-45 19l-166 166q-19 19 -19 45t19 45l531 531l-531 531q-19 19 -19 45t19 45l166 166q19 19 45 19t45 -19l742 -742q19 -19 19 -45t-19 -45z" />
114 <glyph unicode="&#xf055;" d="M1216 576v128q0 26 -19 45t-45 19h-256v256q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-256h-256q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h256v-256q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v256h256q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5 t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
115 <glyph unicode="&#xf056;" d="M1216 576v128q0 26 -19 45t-45 19h-768q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h768q26 0 45 19t19 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5 t103 -385.5z" />
116 <glyph unicode="&#xf057;" d="M1149 414q0 26 -19 45l-181 181l181 181q19 19 19 45q0 27 -19 46l-90 90q-19 19 -46 19q-26 0 -45 -19l-181 -181l-181 181q-19 19 -45 19q-27 0 -46 -19l-90 -90q-19 -19 -19 -46q0 -26 19 -45l181 -181l-181 -181q-19 -19 -19 -45q0 -27 19 -46l90 -90q19 -19 46 -19 q26 0 45 19l181 181l181 -181q19 -19 45 -19q27 0 46 19l90 90q19 19 19 46zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
117 <glyph unicode="&#xf058;" d="M1284 802q0 28 -18 46l-91 90q-19 19 -45 19t-45 -19l-408 -407l-226 226q-19 19 -45 19t-45 -19l-91 -90q-18 -18 -18 -46q0 -27 18 -45l362 -362q19 -19 45 -19q27 0 46 19l543 543q18 18 18 45zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
118 <glyph unicode="&#xf059;" d="M896 160v192q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h192q14 0 23 9t9 23zM1152 832q0 88 -55.5 163t-138.5 116t-170 41q-243 0 -371 -213q-15 -24 8 -42l132 -100q7 -6 19 -6q16 0 25 12q53 68 86 92q34 24 86 24q48 0 85.5 -26t37.5 -59 q0 -38 -20 -61t-68 -45q-63 -28 -115.5 -86.5t-52.5 -125.5v-36q0 -14 9 -23t23 -9h192q14 0 23 9t9 23q0 19 21.5 49.5t54.5 49.5q32 18 49 28.5t46 35t44.5 48t28 60.5t12.5 81zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
119 <glyph unicode="&#xf05a;" d="M1024 160v160q0 14 -9 23t-23 9h-96v512q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h96v-320h-96q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23t23 -9h448q14 0 23 9t9 23zM896 1056v160q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-160q0 -14 9 -23 t23 -9h192q14 0 23 9t9 23zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
120 <glyph unicode="&#xf05b;" d="M1197 512h-109q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h109q-32 108 -112.5 188.5t-188.5 112.5v-109q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v109q-108 -32 -188.5 -112.5t-112.5 -188.5h109q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-109 q32 -108 112.5 -188.5t188.5 -112.5v109q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-109q108 32 188.5 112.5t112.5 188.5zM1536 704v-128q0 -26 -19 -45t-45 -19h-143q-37 -161 -154.5 -278.5t-278.5 -154.5v-143q0 -26 -19 -45t-45 -19h-128q-26 0 -45 19t-19 45v143 q-161 37 -278.5 154.5t-154.5 278.5h-143q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h143q37 161 154.5 278.5t278.5 154.5v143q0 26 19 45t45 19h128q26 0 45 -19t19 -45v-143q161 -37 278.5 -154.5t154.5 -278.5h143q26 0 45 -19t19 -45z" />
121 <glyph unicode="&#xf05c;" d="M1097 457l-146 -146q-10 -10 -23 -10t-23 10l-137 137l-137 -137q-10 -10 -23 -10t-23 10l-146 146q-10 10 -10 23t10 23l137 137l-137 137q-10 10 -10 23t10 23l146 146q10 10 23 10t23 -10l137 -137l137 137q10 10 23 10t23 -10l146 -146q10 -10 10 -23t-10 -23 l-137 -137l137 -137q10 -10 10 -23t-10 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5 t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
122 <glyph unicode="&#xf05d;" d="M1171 723l-422 -422q-19 -19 -45 -19t-45 19l-294 294q-19 19 -19 45t19 45l102 102q19 19 45 19t45 -19l147 -147l275 275q19 19 45 19t45 -19l102 -102q19 -19 19 -45t-19 -45zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198 t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
123 <glyph unicode="&#xf05e;" d="M1312 643q0 161 -87 295l-754 -753q137 -89 297 -89q111 0 211.5 43.5t173.5 116.5t116 174.5t43 212.5zM313 344l755 754q-135 91 -300 91q-148 0 -273 -73t-198 -199t-73 -274q0 -162 89 -299zM1536 643q0 -157 -61 -300t-163.5 -246t-245 -164t-298.5 -61t-298.5 61 t-245 164t-163.5 246t-61 300t61 299.5t163.5 245.5t245 164t298.5 61t298.5 -61t245 -164t163.5 -245.5t61 -299.5z" />
124 <glyph unicode="&#xf060;" d="M1536 640v-128q0 -53 -32.5 -90.5t-84.5 -37.5h-704l293 -294q38 -36 38 -90t-38 -90l-75 -76q-37 -37 -90 -37q-52 0 -91 37l-651 652q-37 37 -37 90q0 52 37 91l651 650q38 38 91 38q52 0 90 -38l75 -74q38 -38 38 -91t-38 -91l-293 -293h704q52 0 84.5 -37.5 t32.5 -90.5z" />
125 <glyph unicode="&#xf061;" d="M1472 576q0 -54 -37 -91l-651 -651q-39 -37 -91 -37q-51 0 -90 37l-75 75q-38 38 -38 91t38 91l293 293h-704q-52 0 -84.5 37.5t-32.5 90.5v128q0 53 32.5 90.5t84.5 37.5h704l-293 294q-38 36 -38 90t38 90l75 75q38 38 90 38q53 0 91 -38l651 -651q37 -35 37 -90z" />
126 <glyph unicode="&#xf062;" horiz-adv-x="1664" d="M1611 565q0 -51 -37 -90l-75 -75q-38 -38 -91 -38q-54 0 -90 38l-294 293v-704q0 -52 -37.5 -84.5t-90.5 -32.5h-128q-53 0 -90.5 32.5t-37.5 84.5v704l-294 -293q-36 -38 -90 -38t-90 38l-75 75q-38 38 -38 90q0 53 38 91l651 651q35 37 90 37q54 0 91 -37l651 -651 q37 -39 37 -91z" />
127 <glyph unicode="&#xf063;" horiz-adv-x="1664" d="M1611 704q0 -53 -37 -90l-651 -652q-39 -37 -91 -37q-53 0 -90 37l-651 652q-38 36 -38 90q0 53 38 91l74 75q39 37 91 37q53 0 90 -37l294 -294v704q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-704l294 294q37 37 90 37q52 0 91 -37l75 -75q37 -39 37 -91z" />
128 <glyph unicode="&#xf064;" horiz-adv-x="1792" d="M1792 896q0 -26 -19 -45l-512 -512q-19 -19 -45 -19t-45 19t-19 45v256h-224q-98 0 -175.5 -6t-154 -21.5t-133 -42.5t-105.5 -69.5t-80 -101t-48.5 -138.5t-17.5 -181q0 -55 5 -123q0 -6 2.5 -23.5t2.5 -26.5q0 -15 -8.5 -25t-23.5 -10q-16 0 -28 17q-7 9 -13 22 t-13.5 30t-10.5 24q-127 285 -127 451q0 199 53 333q162 403 875 403h224v256q0 26 19 45t45 19t45 -19l512 -512q19 -19 19 -45z" />
129 <glyph unicode="&#xf065;" d="M755 480q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23zM1536 1344v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332 q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45z" />
130 <glyph unicode="&#xf066;" d="M768 576v-448q0 -26 -19 -45t-45 -19t-45 19l-144 144l-332 -332q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l332 332l-144 144q-19 19 -19 45t19 45t45 19h448q26 0 45 -19t19 -45zM1523 1248q0 -13 -10 -23l-332 -332l144 -144q19 -19 19 -45t-19 -45 t-45 -19h-448q-26 0 -45 19t-19 45v448q0 26 19 45t45 19t45 -19l144 -144l332 332q10 10 23 10t23 -10l114 -114q10 -10 10 -23z" />
131 <glyph unicode="&#xf067;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-416v-416q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v416h-416q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h416v416q0 40 28 68t68 28h192q40 0 68 -28t28 -68v-416h416q40 0 68 -28t28 -68z" />
132 <glyph unicode="&#xf068;" horiz-adv-x="1408" d="M1408 800v-192q0 -40 -28 -68t-68 -28h-1216q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h1216q40 0 68 -28t28 -68z" />
133 <glyph unicode="&#xf069;" horiz-adv-x="1664" d="M1482 486q46 -26 59.5 -77.5t-12.5 -97.5l-64 -110q-26 -46 -77.5 -59.5t-97.5 12.5l-266 153v-307q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v307l-266 -153q-46 -26 -97.5 -12.5t-77.5 59.5l-64 110q-26 46 -12.5 97.5t59.5 77.5l266 154l-266 154 q-46 26 -59.5 77.5t12.5 97.5l64 110q26 46 77.5 59.5t97.5 -12.5l266 -153v307q0 52 38 90t90 38h128q52 0 90 -38t38 -90v-307l266 153q46 26 97.5 12.5t77.5 -59.5l64 -110q26 -46 12.5 -97.5t-59.5 -77.5l-266 -154z" />
134 <glyph unicode="&#xf06a;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM896 161v190q0 14 -9 23.5t-22 9.5h-192q-13 0 -23 -10t-10 -23v-190q0 -13 10 -23t23 -10h192 q13 0 22 9.5t9 23.5zM894 505l18 621q0 12 -10 18q-10 8 -24 8h-220q-14 0 -24 -8q-10 -6 -10 -18l17 -621q0 -10 10 -17.5t24 -7.5h185q14 0 23.5 7.5t10.5 17.5z" />
135 <glyph unicode="&#xf06b;" d="M928 180v56v468v192h-320v-192v-468v-56q0 -25 18 -38.5t46 -13.5h192q28 0 46 13.5t18 38.5zM472 1024h195l-126 161q-26 31 -69 31q-40 0 -68 -28t-28 -68t28 -68t68 -28zM1160 1120q0 40 -28 68t-68 28q-43 0 -69 -31l-125 -161h194q40 0 68 28t28 68zM1536 864v-320 q0 -14 -9 -23t-23 -9h-96v-416q0 -40 -28 -68t-68 -28h-1088q-40 0 -68 28t-28 68v416h-96q-14 0 -23 9t-9 23v320q0 14 9 23t23 9h440q-93 0 -158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5q107 0 168 -77l128 -165l128 165q61 77 168 77q93 0 158.5 -65.5t65.5 -158.5 t-65.5 -158.5t-158.5 -65.5h440q14 0 23 -9t9 -23z" />
136 <glyph unicode="&#xf06c;" horiz-adv-x="1792" d="M1280 832q0 26 -19 45t-45 19q-172 0 -318 -49.5t-259.5 -134t-235.5 -219.5q-19 -21 -19 -45q0 -26 19 -45t45 -19q24 0 45 19q27 24 74 71t67 66q137 124 268.5 176t313.5 52q26 0 45 19t19 45zM1792 1030q0 -95 -20 -193q-46 -224 -184.5 -383t-357.5 -268 q-214 -108 -438 -108q-148 0 -286 47q-15 5 -88 42t-96 37q-16 0 -39.5 -32t-45 -70t-52.5 -70t-60 -32q-30 0 -51 11t-31 24t-27 42q-2 4 -6 11t-5.5 10t-3 9.5t-1.5 13.5q0 35 31 73.5t68 65.5t68 56t31 48q0 4 -14 38t-16 44q-9 51 -9 104q0 115 43.5 220t119 184.5 t170.5 139t204 95.5q55 18 145 25.5t179.5 9t178.5 6t163.5 24t113.5 56.5l29.5 29.5t29.5 28t27 20t36.5 16t43.5 4.5q39 0 70.5 -46t47.5 -112t24 -124t8 -96z" />
137 <glyph unicode="&#xf06d;" horiz-adv-x="1408" d="M1408 -160v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-1344q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h1344q13 0 22.5 -9.5t9.5 -22.5zM1152 896q0 -78 -24.5 -144t-64 -112.5t-87.5 -88t-96 -77.5t-87.5 -72t-64 -81.5t-24.5 -96.5q0 -96 67 -224l-4 1l1 -1 q-90 41 -160 83t-138.5 100t-113.5 122.5t-72.5 150.5t-27.5 184q0 78 24.5 144t64 112.5t87.5 88t96 77.5t87.5 72t64 81.5t24.5 96.5q0 94 -66 224l3 -1l-1 1q90 -41 160 -83t138.5 -100t113.5 -122.5t72.5 -150.5t27.5 -184z" />
138 <glyph unicode="&#xf06e;" horiz-adv-x="1792" d="M1664 576q-152 236 -381 353q61 -104 61 -225q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 121 61 225q-229 -117 -381 -353q133 -205 333.5 -326.5t434.5 -121.5t434.5 121.5t333.5 326.5zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5 t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1792 576q0 -34 -20 -69q-140 -230 -376.5 -368.5t-499.5 -138.5t-499.5 139t-376.5 368q-20 35 -20 69t20 69q140 229 376.5 368t499.5 139t499.5 -139t376.5 -368q20 -35 20 -69z" />
139 <glyph unicode="&#xf070;" horiz-adv-x="1792" d="M555 201l78 141q-87 63 -136 159t-49 203q0 121 61 225q-229 -117 -381 -353q167 -258 427 -375zM944 960q0 20 -14 34t-34 14q-125 0 -214.5 -89.5t-89.5 -214.5q0 -20 14 -34t34 -14t34 14t14 34q0 86 61 147t147 61q20 0 34 14t14 34zM1307 1151q0 -7 -1 -9 q-105 -188 -315 -566t-316 -567l-49 -89q-10 -16 -28 -16q-12 0 -134 70q-16 10 -16 28q0 12 44 87q-143 65 -263.5 173t-208.5 245q-20 31 -20 69t20 69q153 235 380 371t496 136q89 0 180 -17l54 97q10 16 28 16q5 0 18 -6t31 -15.5t33 -18.5t31.5 -18.5t19.5 -11.5 q16 -10 16 -27zM1344 704q0 -139 -79 -253.5t-209 -164.5l280 502q8 -45 8 -84zM1792 576q0 -35 -20 -69q-39 -64 -109 -145q-150 -172 -347.5 -267t-419.5 -95l74 132q212 18 392.5 137t301.5 307q-115 179 -282 294l63 112q95 -64 182.5 -153t144.5 -184q20 -34 20 -69z " />
140 <glyph unicode="&#xf071;" horiz-adv-x="1792" d="M1024 161v190q0 14 -9.5 23.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -23.5v-190q0 -14 9.5 -23.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 23.5zM1022 535l18 459q0 12 -10 19q-13 11 -24 11h-220q-11 0 -24 -11q-10 -7 -10 -21l17 -457q0 -10 10 -16.5t24 -6.5h185 q14 0 23.5 6.5t10.5 16.5zM1008 1469l768 -1408q35 -63 -2 -126q-17 -29 -46.5 -46t-63.5 -17h-1536q-34 0 -63.5 17t-46.5 46q-37 63 -2 126l768 1408q17 31 47 49t65 18t65 -18t47 -49z" />
141 <glyph unicode="&#xf072;" horiz-adv-x="1408" d="M1376 1376q44 -52 12 -148t-108 -172l-161 -161l160 -696q5 -19 -12 -33l-128 -96q-7 -6 -19 -6q-4 0 -7 1q-15 3 -21 16l-279 508l-259 -259l53 -194q5 -17 -8 -31l-96 -96q-9 -9 -23 -9h-2q-15 2 -24 13l-189 252l-252 189q-11 7 -13 23q-1 13 9 25l96 97q9 9 23 9 q6 0 8 -1l194 -53l259 259l-508 279q-14 8 -17 24q-2 16 9 27l128 128q14 13 30 8l665 -159l160 160q76 76 172 108t148 -12z" />
142 <glyph unicode="&#xf073;" horiz-adv-x="1664" d="M128 -128h288v288h-288v-288zM480 -128h320v288h-320v-288zM128 224h288v320h-288v-320zM480 224h320v320h-320v-320zM128 608h288v288h-288v-288zM864 -128h320v288h-320v-288zM480 608h320v288h-320v-288zM1248 -128h288v288h-288v-288zM864 224h320v320h-320v-320z M512 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1248 224h288v320h-288v-320zM864 608h320v288h-320v-288zM1248 608h288v288h-288v-288zM1280 1088v288q0 13 -9.5 22.5t-22.5 9.5h-64 q-13 0 -22.5 -9.5t-9.5 -22.5v-288q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1664 1152v-1280q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47 h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
143 <glyph unicode="&#xf074;" horiz-adv-x="1792" d="M666 1055q-60 -92 -137 -273q-22 45 -37 72.5t-40.5 63.5t-51 56.5t-63 35t-81.5 14.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q250 0 410 -225zM1792 256q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192q-32 0 -85 -0.5t-81 -1t-73 1 t-71 5t-64 10.5t-63 18.5t-58 28.5t-59 40t-55 53.5t-56 69.5q59 93 136 273q22 -45 37 -72.5t40.5 -63.5t51 -56.5t63 -35t81.5 -14.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1792 1152q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5 v192h-256q-48 0 -87 -15t-69 -45t-51 -61.5t-45 -77.5q-32 -62 -78 -171q-29 -66 -49.5 -111t-54 -105t-64 -100t-74 -83t-90 -68.5t-106.5 -42t-128 -16.5h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224q48 0 87 15t69 45t51 61.5t45 77.5q32 62 78 171q29 66 49.5 111 t54 105t64 100t74 83t90 68.5t106.5 42t128 16.5h256v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
144 <glyph unicode="&#xf075;" horiz-adv-x="1792" d="M1792 640q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22q-17 -2 -30.5 9t-17.5 29v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281 q0 130 71 248.5t191 204.5t286 136.5t348 50.5q244 0 450 -85.5t326 -233t120 -321.5z" />
145 <glyph unicode="&#xf076;" d="M1536 704v-128q0 -201 -98.5 -362t-274 -251.5t-395.5 -90.5t-395.5 90.5t-274 251.5t-98.5 362v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-128q0 -52 23.5 -90t53.5 -57t71 -30t64 -13t44 -2t44 2t64 13t71 30t53.5 57t23.5 90v128q0 26 19 45t45 19h384 q26 0 45 -19t19 -45zM512 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45zM1536 1344v-384q0 -26 -19 -45t-45 -19h-384q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h384q26 0 45 -19t19 -45z" />
146 <glyph unicode="&#xf077;" horiz-adv-x="1792" d="M1683 205l-166 -165q-19 -19 -45 -19t-45 19l-531 531l-531 -531q-19 -19 -45 -19t-45 19l-166 165q-19 19 -19 45.5t19 45.5l742 741q19 19 45 19t45 -19l742 -741q19 -19 19 -45.5t-19 -45.5z" />
147 <glyph unicode="&#xf078;" horiz-adv-x="1792" d="M1683 728l-742 -741q-19 -19 -45 -19t-45 19l-742 741q-19 19 -19 45.5t19 45.5l166 165q19 19 45 19t45 -19l531 -531l531 531q19 19 45 19t45 -19l166 -165q19 -19 19 -45.5t-19 -45.5z" />
148 <glyph unicode="&#xf079;" horiz-adv-x="1920" d="M1280 32q0 -13 -9.5 -22.5t-22.5 -9.5h-960q-8 0 -13.5 2t-9 7t-5.5 8t-3 11.5t-1 11.5v13v11v160v416h-192q-26 0 -45 19t-19 45q0 24 15 41l320 384q19 22 49 22t49 -22l320 -384q15 -17 15 -41q0 -26 -19 -45t-45 -19h-192v-384h576q16 0 25 -11l160 -192q7 -11 7 -21 zM1920 448q0 -24 -15 -41l-320 -384q-20 -23 -49 -23t-49 23l-320 384q-15 17 -15 41q0 26 19 45t45 19h192v384h-576q-16 0 -25 12l-160 192q-7 9 -7 20q0 13 9.5 22.5t22.5 9.5h960q8 0 13.5 -2t9 -7t5.5 -8t3 -11.5t1 -11.5v-13v-11v-160v-416h192q26 0 45 -19t19 -45z " />
149 <glyph unicode="&#xf07a;" horiz-adv-x="1664" d="M640 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1536 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1664 1088v-512q0 -24 -16 -42.5t-41 -21.5 l-1044 -122q1 -7 4.5 -21.5t6 -26.5t2.5 -22q0 -16 -24 -64h920q26 0 45 -19t19 -45t-19 -45t-45 -19h-1024q-26 0 -45 19t-19 45q0 14 11 39.5t29.5 59.5t20.5 38l-177 823h-204q-26 0 -45 19t-19 45t19 45t45 19h256q16 0 28.5 -6.5t20 -15.5t13 -24.5t7.5 -26.5 t5.5 -29.5t4.5 -25.5h1201q26 0 45 -19t19 -45z" />
150 <glyph unicode="&#xf07b;" horiz-adv-x="1664" d="M1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
151 <glyph unicode="&#xf07c;" horiz-adv-x="1920" d="M1879 584q0 -31 -31 -66l-336 -396q-43 -51 -120.5 -86.5t-143.5 -35.5h-1088q-34 0 -60.5 13t-26.5 43q0 31 31 66l336 396q43 51 120.5 86.5t143.5 35.5h1088q34 0 60.5 -13t26.5 -43zM1536 928v-160h-832q-94 0 -197 -47.5t-164 -119.5l-337 -396l-5 -6q0 4 -0.5 12.5 t-0.5 12.5v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158z" />
152 <glyph unicode="&#xf07d;" horiz-adv-x="768" d="M704 1216q0 -26 -19 -45t-45 -19h-128v-1024h128q26 0 45 -19t19 -45t-19 -45l-256 -256q-19 -19 -45 -19t-45 19l-256 256q-19 19 -19 45t19 45t45 19h128v1024h-128q-26 0 -45 19t-19 45t19 45l256 256q19 19 45 19t45 -19l256 -256q19 -19 19 -45z" />
153 <glyph unicode="&#xf07e;" horiz-adv-x="1792" d="M1792 640q0 -26 -19 -45l-256 -256q-19 -19 -45 -19t-45 19t-19 45v128h-1024v-128q0 -26 -19 -45t-45 -19t-45 19l-256 256q-19 19 -19 45t19 45l256 256q19 19 45 19t45 -19t19 -45v-128h1024v128q0 26 19 45t45 19t45 -19l256 -256q19 -19 19 -45z" />
154 <glyph unicode="&#xf080;" horiz-adv-x="2048" d="M640 640v-512h-256v512h256zM1024 1152v-1024h-256v1024h256zM2048 0v-128h-2048v1536h128v-1408h1920zM1408 896v-768h-256v768h256zM1792 1280v-1152h-256v1152h256z" />
155 <glyph unicode="&#xf081;" d="M1280 926q-56 -25 -121 -34q68 40 93 117q-65 -38 -134 -51q-61 66 -153 66q-87 0 -148.5 -61.5t-61.5 -148.5q0 -29 5 -48q-129 7 -242 65t-192 155q-29 -50 -29 -106q0 -114 91 -175q-47 1 -100 26v-2q0 -75 50 -133.5t123 -72.5q-29 -8 -51 -8q-13 0 -39 4 q21 -63 74.5 -104t121.5 -42q-116 -90 -261 -90q-26 0 -50 3q148 -94 322 -94q112 0 210 35.5t168 95t120.5 137t75 162t24.5 168.5q0 18 -1 27q63 45 105 109zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5 t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
156 <glyph unicode="&#xf082;" d="M1536 160q0 -119 -84.5 -203.5t-203.5 -84.5h-192v608h203l30 224h-233v143q0 54 28 83t96 29l132 1v207q-96 9 -180 9q-136 0 -218 -80.5t-82 -225.5v-166h-224v-224h224v-608h-544q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960 q119 0 203.5 -84.5t84.5 -203.5v-960z" />
157 <glyph unicode="&#xf083;" horiz-adv-x="1792" d="M928 704q0 14 -9 23t-23 9q-66 0 -113 -47t-47 -113q0 -14 9 -23t23 -9t23 9t9 23q0 40 28 68t68 28q14 0 23 9t9 23zM1152 574q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM128 0h1536v128h-1536v-128zM1280 574q0 159 -112.5 271.5 t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM256 1216h384v128h-384v-128zM128 1024h1536v118v138h-828l-64 -128h-644v-128zM1792 1280v-1280q0 -53 -37.5 -90.5t-90.5 -37.5h-1536q-53 0 -90.5 37.5t-37.5 90.5v1280 q0 53 37.5 90.5t90.5 37.5h1536q53 0 90.5 -37.5t37.5 -90.5z" />
158 <glyph unicode="&#xf084;" horiz-adv-x="1792" d="M832 1024q0 80 -56 136t-136 56t-136 -56t-56 -136q0 -42 19 -83q-41 19 -83 19q-80 0 -136 -56t-56 -136t56 -136t136 -56t136 56t56 136q0 42 -19 83q41 -19 83 -19q80 0 136 56t56 136zM1683 320q0 -17 -49 -66t-66 -49q-9 0 -28.5 16t-36.5 33t-38.5 40t-24.5 26 l-96 -96l220 -220q28 -28 28 -68q0 -42 -39 -81t-81 -39q-40 0 -68 28l-671 671q-176 -131 -365 -131q-163 0 -265.5 102.5t-102.5 265.5q0 160 95 313t248 248t313 95q163 0 265.5 -102.5t102.5 -265.5q0 -189 -131 -365l355 -355l96 96q-3 3 -26 24.5t-40 38.5t-33 36.5 t-16 28.5q0 17 49 66t66 49q13 0 23 -10q6 -6 46 -44.5t82 -79.5t86.5 -86t73 -78t28.5 -41z" />
159 <glyph unicode="&#xf085;" horiz-adv-x="1920" d="M896 640q0 106 -75 181t-181 75t-181 -75t-75 -181t75 -181t181 -75t181 75t75 181zM1664 128q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1152q0 52 -38 90t-90 38t-90 -38t-38 -90q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1280 731v-185q0 -10 -7 -19.5t-16 -10.5l-155 -24q-11 -35 -32 -76q34 -48 90 -115q7 -10 7 -20q0 -12 -7 -19q-23 -30 -82.5 -89.5t-78.5 -59.5q-11 0 -21 7l-115 90q-37 -19 -77 -31q-11 -108 -23 -155q-7 -24 -30 -24h-186q-11 0 -20 7.5t-10 17.5 l-23 153q-34 10 -75 31l-118 -89q-7 -7 -20 -7q-11 0 -21 8q-144 133 -144 160q0 9 7 19q10 14 41 53t47 61q-23 44 -35 82l-152 24q-10 1 -17 9.5t-7 19.5v185q0 10 7 19.5t16 10.5l155 24q11 35 32 76q-34 48 -90 115q-7 11 -7 20q0 12 7 20q22 30 82 89t79 59q11 0 21 -7 l115 -90q34 18 77 32q11 108 23 154q7 24 30 24h186q11 0 20 -7.5t10 -17.5l23 -153q34 -10 75 -31l118 89q8 7 20 7q11 0 21 -8q144 -133 144 -160q0 -9 -7 -19q-12 -16 -42 -54t-45 -60q23 -48 34 -82l152 -23q10 -2 17 -10.5t7 -19.5zM1920 198v-140q0 -16 -149 -31 q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20 t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31zM1920 1222v-140q0 -16 -149 -31q-12 -27 -30 -52q51 -113 51 -138q0 -4 -4 -7q-122 -71 -124 -71q-8 0 -46 47t-52 68 q-20 -2 -30 -2t-30 2q-14 -21 -52 -68t-46 -47q-2 0 -124 71q-4 3 -4 7q0 25 51 138q-18 25 -30 52q-149 15 -149 31v140q0 16 149 31q13 29 30 52q-51 113 -51 138q0 4 4 7q4 2 35 20t59 34t30 16q8 0 46 -46.5t52 -67.5q20 2 30 2t30 -2q51 71 92 112l6 2q4 0 124 -70 q4 -3 4 -7q0 -25 -51 -138q17 -23 30 -52q149 -15 149 -31z" />
160 <glyph unicode="&#xf086;" horiz-adv-x="1792" d="M1408 768q0 -139 -94 -257t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224 q0 139 94 257t256.5 186.5t353.5 68.5t353.5 -68.5t256.5 -186.5t94 -257zM1792 512q0 -120 -71 -224.5t-195 -176.5q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7 q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230z" />
161 <glyph unicode="&#xf087;" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 768q0 51 -39 89.5t-89 38.5h-352q0 58 48 159.5t48 160.5q0 98 -32 145t-128 47q-26 -26 -38 -85t-30.5 -125.5t-59.5 -109.5q-22 -23 -77 -91q-4 -5 -23 -30t-31.5 -41t-34.5 -42.5 t-40 -44t-38.5 -35.5t-40 -27t-35.5 -9h-32v-640h32q13 0 31.5 -3t33 -6.5t38 -11t35 -11.5t35.5 -12.5t29 -10.5q211 -73 342 -73h121q192 0 192 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5q32 1 53.5 47t21.5 81zM1536 769 q0 -89 -49 -163q9 -33 9 -69q0 -77 -38 -144q3 -21 3 -43q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5h-36h-93q-96 0 -189.5 22.5t-216.5 65.5q-116 40 -138 40h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h274q36 24 137 155q58 75 107 128 q24 25 35.5 85.5t30.5 126.5t62 108q39 37 90 37q84 0 151 -32.5t102 -101.5t35 -186q0 -93 -48 -192h176q104 0 180 -76t76 -179z" />
162 <glyph unicode="&#xf088;" d="M256 1088q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 512q0 35 -21.5 81t-53.5 47q15 17 25 47.5t10 55.5q0 69 -53 119q18 32 18 69t-17.5 73.5t-47.5 52.5q5 30 5 56q0 85 -49 126t-136 41h-128q-131 0 -342 -73q-5 -2 -29 -10.5 t-35.5 -12.5t-35 -11.5t-38 -11t-33 -6.5t-31.5 -3h-32v-640h32q16 0 35.5 -9t40 -27t38.5 -35.5t40 -44t34.5 -42.5t31.5 -41t23 -30q55 -68 77 -91q41 -43 59.5 -109.5t30.5 -125.5t38 -85q96 0 128 47t32 145q0 59 -48 160.5t-48 159.5h352q50 0 89 38.5t39 89.5z M1536 511q0 -103 -76 -179t-180 -76h-176q48 -99 48 -192q0 -118 -35 -186q-35 -69 -102 -101.5t-151 -32.5q-51 0 -90 37q-34 33 -54 82t-25.5 90.5t-17.5 84.5t-31 64q-48 50 -107 127q-101 131 -137 155h-274q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5 h288q22 0 138 40q128 44 223 66t200 22h112q140 0 226.5 -79t85.5 -216v-5q60 -77 60 -178q0 -22 -3 -43q38 -67 38 -144q0 -36 -9 -69q49 -74 49 -163z" />
163 <glyph unicode="&#xf089;" horiz-adv-x="896" d="M832 1504v-1339l-449 -236q-22 -12 -40 -12q-21 0 -31.5 14.5t-10.5 35.5q0 6 2 20l86 500l-364 354q-25 27 -25 48q0 37 56 46l502 73l225 455q19 41 49 41z" />
164 <glyph unicode="&#xf08a;" horiz-adv-x="1792" d="M1664 940q0 81 -21.5 143t-55 98.5t-81.5 59.5t-94 31t-98 8t-112 -25.5t-110.5 -64t-86.5 -72t-60 -61.5q-18 -22 -49 -22t-49 22q-24 28 -60 61.5t-86.5 72t-110.5 64t-112 25.5t-98 -8t-94 -31t-81.5 -59.5t-55 -98.5t-21.5 -143q0 -168 187 -355l581 -560l580 559 q188 188 188 356zM1792 940q0 -221 -229 -450l-623 -600q-18 -18 -44 -18t-44 18l-624 602q-10 8 -27.5 26t-55.5 65.5t-68 97.5t-53.5 121t-23.5 138q0 220 127 344t351 124q62 0 126.5 -21.5t120 -58t95.5 -68.5t76 -68q36 36 76 68t95.5 68.5t120 58t126.5 21.5 q224 0 351 -124t127 -344z" />
165 <glyph unicode="&#xf08b;" horiz-adv-x="1664" d="M640 96q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-119 0 -203.5 84.5t-84.5 203.5v704q0 119 84.5 203.5t203.5 84.5h320q13 0 22.5 -9.5t9.5 -22.5q0 -4 1 -20t0.5 -26.5t-3 -23.5t-10 -19.5t-20.5 -6.5h-320q-66 0 -113 -47t-47 -113v-704 q0 -66 47 -113t113 -47h288h11h13t11.5 -1t11.5 -3t8 -5.5t7 -9t2 -13.5zM1568 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45z" />
166 <glyph unicode="&#xf08c;" d="M237 122h231v694h-231v-694zM483 1030q-1 52 -36 86t-93 34t-94.5 -34t-36.5 -86q0 -51 35.5 -85.5t92.5 -34.5h1q59 0 95 34.5t36 85.5zM1068 122h231v398q0 154 -73 233t-193 79q-136 0 -209 -117h2v101h-231q3 -66 0 -694h231v388q0 38 7 56q15 35 45 59.5t74 24.5 q116 0 116 -157v-371zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
167 <glyph unicode="&#xf08d;" horiz-adv-x="1152" d="M480 672v448q0 14 -9 23t-23 9t-23 -9t-9 -23v-448q0 -14 9 -23t23 -9t23 9t9 23zM1152 320q0 -26 -19 -45t-45 -19h-429l-51 -483q-2 -12 -10.5 -20.5t-20.5 -8.5h-1q-27 0 -32 27l-76 485h-404q-26 0 -45 19t-19 45q0 123 78.5 221.5t177.5 98.5v512q-52 0 -90 38 t-38 90t38 90t90 38h640q52 0 90 -38t38 -90t-38 -90t-90 -38v-512q99 0 177.5 -98.5t78.5 -221.5z" />
168 <glyph unicode="&#xf08e;" horiz-adv-x="1792" d="M1408 608v-320q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v320 q0 14 9 23t23 9h64q14 0 23 -9t9 -23zM1792 1472v-512q0 -26 -19 -45t-45 -19t-45 19l-176 176l-652 -652q-10 -10 -23 -10t-23 10l-114 114q-10 10 -10 23t10 23l652 652l-176 176q-19 19 -19 45t19 45t45 19h512q26 0 45 -19t19 -45z" />
169 <glyph unicode="&#xf090;" d="M1184 640q0 -26 -19 -45l-544 -544q-19 -19 -45 -19t-45 19t-19 45v288h-448q-26 0 -45 19t-19 45v384q0 26 19 45t45 19h448v288q0 26 19 45t45 19t45 -19l544 -544q19 -19 19 -45zM1536 992v-704q0 -119 -84.5 -203.5t-203.5 -84.5h-320q-13 0 -22.5 9.5t-9.5 22.5 q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q66 0 113 47t47 113v704q0 66 -47 113t-113 47h-288h-11h-13t-11.5 1t-11.5 3t-8 5.5t-7 9t-2 13.5q0 4 -1 20t-0.5 26.5t3 23.5t10 19.5t20.5 6.5h320q119 0 203.5 -84.5t84.5 -203.5z" />
170 <glyph unicode="&#xf091;" horiz-adv-x="1664" d="M458 653q-74 162 -74 371h-256v-96q0 -78 94.5 -162t235.5 -113zM1536 928v96h-256q0 -209 -74 -371q141 29 235.5 113t94.5 162zM1664 1056v-128q0 -71 -41.5 -143t-112 -130t-173 -97.5t-215.5 -44.5q-42 -54 -95 -95q-38 -34 -52.5 -72.5t-14.5 -89.5q0 -54 30.5 -91 t97.5 -37q75 0 133.5 -45.5t58.5 -114.5v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 69 58.5 114.5t133.5 45.5q67 0 97.5 37t30.5 91q0 51 -14.5 89.5t-52.5 72.5q-53 41 -95 95q-113 5 -215.5 44.5t-173 97.5t-112 130t-41.5 143v128q0 40 28 68t68 28h288v96 q0 66 47 113t113 47h576q66 0 113 -47t47 -113v-96h288q40 0 68 -28t28 -68z" />
171 <glyph unicode="&#xf092;" d="M394 184q-8 -9 -20 3q-13 11 -4 19q8 9 20 -3q12 -11 4 -19zM352 245q9 -12 0 -19q-8 -6 -17 7t0 18q9 7 17 -6zM291 305q-5 -7 -13 -2q-10 5 -7 12q3 5 13 2q10 -5 7 -12zM322 271q-6 -7 -16 3q-9 11 -2 16q6 6 16 -3q9 -11 2 -16zM451 159q-4 -12 -19 -6q-17 4 -13 15 t19 7q16 -5 13 -16zM514 154q0 -11 -16 -11q-17 -2 -17 11q0 11 16 11q17 2 17 -11zM572 164q2 -10 -14 -14t-18 8t14 15q16 2 18 -9zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-224q-16 0 -24.5 1t-19.5 5t-16 14.5t-5 27.5v239q0 97 -52 142q57 6 102.5 18t94 39 t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103 q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -103t0.5 -68q0 -22 -11 -33.5t-22 -13t-33 -1.5 h-224q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
172 <glyph unicode="&#xf093;" horiz-adv-x="1664" d="M1280 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 288v-320q0 -40 -28 -68t-68 -28h-1472q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h427q21 -56 70.5 -92 t110.5 -36h256q61 0 110.5 36t70.5 92h427q40 0 68 -28t28 -68zM1339 936q-17 -40 -59 -40h-256v-448q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v448h-256q-42 0 -59 40q-17 39 14 69l448 448q18 19 45 19t45 -19l448 -448q31 -30 14 -69z" />
173 <glyph unicode="&#xf094;" d="M1407 710q0 44 -7 113.5t-18 96.5q-12 30 -17 44t-9 36.5t-4 48.5q0 23 5 68.5t5 67.5q0 37 -10 55q-4 1 -13 1q-19 0 -58 -4.5t-59 -4.5q-60 0 -176 24t-175 24q-43 0 -94.5 -11.5t-85 -23.5t-89.5 -34q-137 -54 -202 -103q-96 -73 -159.5 -189.5t-88 -236t-24.5 -248.5 q0 -40 12.5 -120t12.5 -121q0 -23 -11 -66.5t-11 -65.5t12 -36.5t34 -14.5q24 0 72.5 11t73.5 11q57 0 169.5 -15.5t169.5 -15.5q181 0 284 36q129 45 235.5 152.5t166 245.5t59.5 275zM1535 712q0 -165 -70 -327.5t-196 -288t-281 -180.5q-124 -44 -326 -44 q-57 0 -170 14.5t-169 14.5q-24 0 -72.5 -14.5t-73.5 -14.5q-73 0 -123.5 55.5t-50.5 128.5q0 24 11 68t11 67q0 40 -12.5 120.5t-12.5 121.5q0 111 18 217.5t54.5 209.5t100.5 194t150 156q78 59 232 120q194 78 316 78q60 0 175.5 -24t173.5 -24q19 0 57 5t58 5 q81 0 118 -50.5t37 -134.5q0 -23 -5 -68t-5 -68q0 -10 1 -18.5t3 -17t4 -13.5t6.5 -16t6.5 -17q16 -40 25 -118.5t9 -136.5z" />
174 <glyph unicode="&#xf095;" horiz-adv-x="1408" d="M1408 296q0 -27 -10 -70.5t-21 -68.5q-21 -50 -122 -106q-94 -51 -186 -51q-27 0 -52.5 3.5t-57.5 12.5t-47.5 14.5t-55.5 20.5t-49 18q-98 35 -175 83q-128 79 -264.5 215.5t-215.5 264.5q-48 77 -83 175q-3 9 -18 49t-20.5 55.5t-14.5 47.5t-12.5 57.5t-3.5 52.5 q0 92 51 186q56 101 106 122q25 11 68.5 21t70.5 10q14 0 21 -3q18 -6 53 -76q11 -19 30 -54t35 -63.5t31 -53.5q3 -4 17.5 -25t21.5 -35.5t7 -28.5q0 -20 -28.5 -50t-62 -55t-62 -53t-28.5 -46q0 -9 5 -22.5t8.5 -20.5t14 -24t11.5 -19q76 -137 174 -235t235 -174 q2 -1 19 -11.5t24 -14t20.5 -8.5t22.5 -5q18 0 46 28.5t53 62t55 62t50 28.5q14 0 28.5 -7t35.5 -21.5t25 -17.5q25 -15 53.5 -31t63.5 -35t54 -30q70 -35 76 -53q3 -7 3 -21z" />
175 <glyph unicode="&#xf096;" horiz-adv-x="1408" d="M1120 1280h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113v832q0 66 -47 113t-113 47zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832 q119 0 203.5 -84.5t84.5 -203.5z" />
176 <glyph unicode="&#xf097;" horiz-adv-x="1280" d="M1152 1280h-1024v-1242l423 406l89 85l89 -85l423 -406v1242zM1164 1408q23 0 44 -9q33 -13 52.5 -41t19.5 -62v-1289q0 -34 -19.5 -62t-52.5 -41q-19 -8 -44 -8q-48 0 -83 32l-441 424l-441 -424q-36 -33 -83 -33q-23 0 -44 9q-33 13 -52.5 41t-19.5 62v1289 q0 34 19.5 62t52.5 41q21 9 44 9h1048z" />
177 <glyph unicode="&#xf098;" d="M1280 343q0 11 -2 16q-3 8 -38.5 29.5t-88.5 49.5l-53 29q-5 3 -19 13t-25 15t-21 5q-18 0 -47 -32.5t-57 -65.5t-44 -33q-7 0 -16.5 3.5t-15.5 6.5t-17 9.5t-14 8.5q-99 55 -170.5 126.5t-126.5 170.5q-2 3 -8.5 14t-9.5 17t-6.5 15.5t-3.5 16.5q0 13 20.5 33.5t45 38.5 t45 39.5t20.5 36.5q0 10 -5 21t-15 25t-13 19q-3 6 -15 28.5t-25 45.5t-26.5 47.5t-25 40.5t-16.5 18t-16 2q-48 0 -101 -22q-46 -21 -80 -94.5t-34 -130.5q0 -16 2.5 -34t5 -30.5t9 -33t10 -29.5t12.5 -33t11 -30q60 -164 216.5 -320.5t320.5 -216.5q6 -2 30 -11t33 -12.5 t29.5 -10t33 -9t30.5 -5t34 -2.5q57 0 130.5 34t94.5 80q22 53 22 101zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
178 <glyph unicode="&#xf099;" horiz-adv-x="1664" d="M1620 1128q-67 -98 -162 -167q1 -14 1 -42q0 -130 -38 -259.5t-115.5 -248.5t-184.5 -210.5t-258 -146t-323 -54.5q-271 0 -496 145q35 -4 78 -4q225 0 401 138q-105 2 -188 64.5t-114 159.5q33 -5 61 -5q43 0 85 11q-112 23 -185.5 111.5t-73.5 205.5v4q68 -38 146 -41 q-66 44 -105 115t-39 154q0 88 44 163q121 -149 294.5 -238.5t371.5 -99.5q-8 38 -8 74q0 134 94.5 228.5t228.5 94.5q140 0 236 -102q109 21 205 78q-37 -115 -142 -178q93 10 186 50z" />
179 <glyph unicode="&#xf09a;" horiz-adv-x="1024" d="M959 1524v-264h-157q-86 0 -116 -36t-30 -108v-189h293l-39 -296h-254v-759h-306v759h-255v296h255v218q0 186 104 288.5t277 102.5q147 0 228 -12z" />
180 <glyph unicode="&#xf09b;" d="M1536 640q0 -251 -146.5 -451.5t-378.5 -277.5q-27 -5 -39.5 7t-12.5 30v211q0 97 -52 142q57 6 102.5 18t94 39t81 66.5t53 105t20.5 150.5q0 121 -79 206q37 91 -8 204q-28 9 -81 -11t-92 -44l-38 -24q-93 26 -192 26t-192 -26q-16 11 -42.5 27t-83.5 38.5t-86 13.5 q-44 -113 -7 -204q-79 -85 -79 -206q0 -85 20.5 -150t52.5 -105t80.5 -67t94 -39t102.5 -18q-40 -36 -49 -103q-21 -10 -45 -15t-57 -5t-65.5 21.5t-55.5 62.5q-19 32 -48.5 52t-49.5 24l-20 3q-21 0 -29 -4.5t-5 -11.5t9 -14t13 -12l7 -5q22 -10 43.5 -38t31.5 -51l10 -23 q13 -38 44 -61.5t67 -30t69.5 -7t55.5 3.5l23 4q0 -38 0.5 -89t0.5 -54q0 -18 -13 -30t-40 -7q-232 77 -378.5 277.5t-146.5 451.5q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
181 <glyph unicode="&#xf09c;" horiz-adv-x="1664" d="M1664 960v-256q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45v256q0 106 -75 181t-181 75t-181 -75t-75 -181v-192h96q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h672v192q0 185 131.5 316.5t316.5 131.5 t316.5 -131.5t131.5 -316.5z" />
182 <glyph unicode="&#xf09d;" horiz-adv-x="1920" d="M1760 1408q66 0 113 -47t47 -113v-1216q0 -66 -47 -113t-113 -47h-1600q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1600zM160 1280q-13 0 -22.5 -9.5t-9.5 -22.5v-224h1664v224q0 13 -9.5 22.5t-22.5 9.5h-1600zM1760 0q13 0 22.5 9.5t9.5 22.5v608h-1664v-608 q0 -13 9.5 -22.5t22.5 -9.5h1600zM256 128v128h256v-128h-256zM640 128v128h384v-128h-384z" />
183 <glyph unicode="&#xf09e;" horiz-adv-x="1408" d="M384 192q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM896 69q2 -28 -17 -48q-18 -21 -47 -21h-135q-25 0 -43 16.5t-20 41.5q-22 229 -184.5 391.5t-391.5 184.5q-25 2 -41.5 20t-16.5 43v135q0 29 21 47q17 17 43 17h5q160 -13 306 -80.5 t259 -181.5q114 -113 181.5 -259t80.5 -306zM1408 67q2 -27 -18 -47q-18 -20 -46 -20h-143q-26 0 -44.5 17.5t-19.5 42.5q-12 215 -101 408.5t-231.5 336t-336 231.5t-408.5 102q-25 1 -42.5 19.5t-17.5 43.5v143q0 28 20 46q18 18 44 18h3q262 -13 501.5 -120t425.5 -294 q187 -186 294 -425.5t120 -501.5z" />
184 <glyph unicode="&#xf0a0;" d="M1040 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1296 320q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5zM1408 160v320q0 13 -9.5 22.5t-22.5 9.5 h-1216q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h1216q13 0 22.5 9.5t9.5 22.5zM178 640h1180l-157 482q-4 13 -16 21.5t-26 8.5h-782q-14 0 -26 -8.5t-16 -21.5zM1536 480v-320q0 -66 -47 -113t-113 -47h-1216q-66 0 -113 47t-47 113v320q0 25 16 75 l197 606q17 53 63 86t101 33h782q55 0 101 -33t63 -86l197 -606q16 -50 16 -75z" />
185 <glyph unicode="&#xf0a1;" horiz-adv-x="1792" d="M1664 896q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5v-384q0 -52 -38 -90t-90 -38q-417 347 -812 380q-58 -19 -91 -66t-31 -100.5t40 -92.5q-20 -33 -23 -65.5t6 -58t33.5 -55t48 -50t61.5 -50.5q-29 -58 -111.5 -83t-168.5 -11.5t-132 55.5q-7 23 -29.5 87.5 t-32 94.5t-23 89t-15 101t3.5 98.5t22 110.5h-122q-66 0 -113 47t-47 113v192q0 66 47 113t113 47h480q435 0 896 384q52 0 90 -38t38 -90v-384zM1536 292v954q-394 -302 -768 -343v-270q377 -42 768 -341z" />
186 <glyph unicode="&#xf0a2;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM246 128h1300q-266 300 -266 832q0 51 -24 105t-69 103t-121.5 80.5t-169.5 31.5t-169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -532 -266 -832z M1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5 t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
187 <glyph unicode="&#xf0a3;" d="M1376 640l138 -135q30 -28 20 -70q-12 -41 -52 -51l-188 -48l53 -186q12 -41 -19 -70q-29 -31 -70 -19l-186 53l-48 -188q-10 -40 -51 -52q-12 -2 -19 -2q-31 0 -51 22l-135 138l-135 -138q-28 -30 -70 -20q-41 11 -51 52l-48 188l-186 -53q-41 -12 -70 19q-31 29 -19 70 l53 186l-188 48q-40 10 -52 51q-10 42 20 70l138 135l-138 135q-30 28 -20 70q12 41 52 51l188 48l-53 186q-12 41 19 70q29 31 70 19l186 -53l48 188q10 41 51 51q41 12 70 -19l135 -139l135 139q29 30 70 19q41 -10 51 -51l48 -188l186 53q41 12 70 -19q31 -29 19 -70 l-53 -186l188 -48q40 -10 52 -51q10 -42 -20 -70z" />
188 <glyph unicode="&#xf0a4;" horiz-adv-x="1792" d="M256 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1664 768q0 51 -39 89.5t-89 38.5h-576q0 20 15 48.5t33 55t33 68t15 84.5q0 67 -44.5 97.5t-115.5 30.5q-24 0 -90 -139q-24 -44 -37 -65q-40 -64 -112 -145q-71 -81 -101 -106 q-69 -57 -140 -57h-32v-640h32q72 0 167 -32t193.5 -64t179.5 -32q189 0 189 167q0 26 -5 56q30 16 47.5 52.5t17.5 73.5t-18 69q53 50 53 119q0 25 -10 55.5t-25 47.5h331q52 0 90 38t38 90zM1792 769q0 -105 -75.5 -181t-180.5 -76h-169q-4 -62 -37 -119q3 -21 3 -43 q0 -101 -60 -178q1 -139 -85 -219.5t-227 -80.5q-133 0 -322 69q-164 59 -223 59h-288q-53 0 -90.5 37.5t-37.5 90.5v640q0 53 37.5 90.5t90.5 37.5h288q10 0 21.5 4.5t23.5 14t22.5 18t24 22.5t20.5 21.5t19 21.5t14 17q65 74 100 129q13 21 33 62t37 72t40.5 63t55 49.5 t69.5 17.5q125 0 206.5 -67t81.5 -189q0 -68 -22 -128h374q104 0 180 -76t76 -179z" />
189 <glyph unicode="&#xf0a5;" horiz-adv-x="1792" d="M1376 128h32v640h-32q-35 0 -67.5 12t-62.5 37t-50 46t-49 54q-2 3 -3.5 4.5t-4 4.5t-4.5 5q-72 81 -112 145q-14 22 -38 68q-1 3 -10.5 22.5t-18.5 36t-20 35.5t-21.5 30.5t-18.5 11.5q-71 0 -115.5 -30.5t-44.5 -97.5q0 -43 15 -84.5t33 -68t33 -55t15 -48.5h-576 q-50 0 -89 -38.5t-39 -89.5q0 -52 38 -90t90 -38h331q-15 -17 -25 -47.5t-10 -55.5q0 -69 53 -119q-18 -32 -18 -69t17.5 -73.5t47.5 -52.5q-4 -24 -4 -56q0 -85 48.5 -126t135.5 -41q84 0 183 32t194 64t167 32zM1664 192q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45 t45 -19t45 19t19 45zM1792 768v-640q0 -53 -37.5 -90.5t-90.5 -37.5h-288q-59 0 -223 -59q-190 -69 -317 -69q-142 0 -230 77.5t-87 217.5l1 5q-61 76 -61 178q0 22 3 43q-33 57 -37 119h-169q-105 0 -180.5 76t-75.5 181q0 103 76 179t180 76h374q-22 60 -22 128 q0 122 81.5 189t206.5 67q38 0 69.5 -17.5t55 -49.5t40.5 -63t37 -72t33 -62q35 -55 100 -129q2 -3 14 -17t19 -21.5t20.5 -21.5t24 -22.5t22.5 -18t23.5 -14t21.5 -4.5h288q53 0 90.5 -37.5t37.5 -90.5z" />
190 <glyph unicode="&#xf0a6;" d="M1280 -64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 700q0 189 -167 189q-26 0 -56 -5q-16 30 -52.5 47.5t-73.5 17.5t-69 -18q-50 53 -119 53q-25 0 -55.5 -10t-47.5 -25v331q0 52 -38 90t-90 38q-51 0 -89.5 -39t-38.5 -89v-576 q-20 0 -48.5 15t-55 33t-68 33t-84.5 15q-67 0 -97.5 -44.5t-30.5 -115.5q0 -24 139 -90q44 -24 65 -37q64 -40 145 -112q81 -71 106 -101q57 -69 57 -140v-32h640v32q0 72 32 167t64 193.5t32 179.5zM1536 705q0 -133 -69 -322q-59 -164 -59 -223v-288q0 -53 -37.5 -90.5 t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5v288q0 10 -4.5 21.5t-14 23.5t-18 22.5t-22.5 24t-21.5 20.5t-21.5 19t-17 14q-74 65 -129 100q-21 13 -62 33t-72 37t-63 40.5t-49.5 55t-17.5 69.5q0 125 67 206.5t189 81.5q68 0 128 -22v374q0 104 76 180t179 76 q105 0 181 -75.5t76 -180.5v-169q62 -4 119 -37q21 3 43 3q101 0 178 -60q139 1 219.5 -85t80.5 -227z" />
191 <glyph unicode="&#xf0a7;" d="M1408 576q0 84 -32 183t-64 194t-32 167v32h-640v-32q0 -35 -12 -67.5t-37 -62.5t-46 -50t-54 -49q-9 -8 -14 -12q-81 -72 -145 -112q-22 -14 -68 -38q-3 -1 -22.5 -10.5t-36 -18.5t-35.5 -20t-30.5 -21.5t-11.5 -18.5q0 -71 30.5 -115.5t97.5 -44.5q43 0 84.5 15t68 33 t55 33t48.5 15v-576q0 -50 38.5 -89t89.5 -39q52 0 90 38t38 90v331q46 -35 103 -35q69 0 119 53q32 -18 69 -18t73.5 17.5t52.5 47.5q24 -4 56 -4q85 0 126 48.5t41 135.5zM1280 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1536 580 q0 -142 -77.5 -230t-217.5 -87l-5 1q-76 -61 -178 -61q-22 0 -43 3q-54 -30 -119 -37v-169q0 -105 -76 -180.5t-181 -75.5q-103 0 -179 76t-76 180v374q-54 -22 -128 -22q-121 0 -188.5 81.5t-67.5 206.5q0 38 17.5 69.5t49.5 55t63 40.5t72 37t62 33q55 35 129 100 q3 2 17 14t21.5 19t21.5 20.5t22.5 24t18 22.5t14 23.5t4.5 21.5v288q0 53 37.5 90.5t90.5 37.5h640q53 0 90.5 -37.5t37.5 -90.5v-288q0 -59 59 -223q69 -190 69 -317z" />
192 <glyph unicode="&#xf0a8;" d="M1280 576v128q0 26 -19 45t-45 19h-502l189 189q19 19 19 45t-19 45l-91 91q-18 18 -45 18t-45 -18l-362 -362l-91 -91q-18 -18 -18 -45t18 -45l91 -91l362 -362q18 -18 45 -18t45 18l91 91q18 18 18 45t-18 45l-189 189h502q26 0 45 19t19 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
193 <glyph unicode="&#xf0a9;" d="M1285 640q0 27 -18 45l-91 91l-362 362q-18 18 -45 18t-45 -18l-91 -91q-18 -18 -18 -45t18 -45l189 -189h-502q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h502l-189 -189q-19 -19 -19 -45t19 -45l91 -91q18 -18 45 -18t45 18l362 362l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
194 <glyph unicode="&#xf0aa;" d="M1284 641q0 27 -18 45l-362 362l-91 91q-18 18 -45 18t-45 -18l-91 -91l-362 -362q-18 -18 -18 -45t18 -45l91 -91q18 -18 45 -18t45 18l189 189v-502q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v502l189 -189q19 -19 45 -19t45 19l91 91q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
195 <glyph unicode="&#xf0ab;" d="M1284 639q0 27 -18 45l-91 91q-18 18 -45 18t-45 -18l-189 -189v502q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-502l-189 189q-19 19 -45 19t-45 -19l-91 -91q-18 -18 -18 -45t18 -45l362 -362l91 -91q18 -18 45 -18t45 18l91 91l362 362q18 18 18 45zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
196 <glyph unicode="&#xf0ac;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1042 887q-2 -1 -9.5 -9.5t-13.5 -9.5q2 0 4.5 5t5 11t3.5 7q6 7 22 15q14 6 52 12q34 8 51 -11 q-2 2 9.5 13t14.5 12q3 2 15 4.5t15 7.5l2 22q-12 -1 -17.5 7t-6.5 21q0 -2 -6 -8q0 7 -4.5 8t-11.5 -1t-9 -1q-10 3 -15 7.5t-8 16.5t-4 15q-2 5 -9.5 10.5t-9.5 10.5q-1 2 -2.5 5.5t-3 6.5t-4 5.5t-5.5 2.5t-7 -5t-7.5 -10t-4.5 -5q-3 2 -6 1.5t-4.5 -1t-4.5 -3t-5 -3.5 q-3 -2 -8.5 -3t-8.5 -2q15 5 -1 11q-10 4 -16 3q9 4 7.5 12t-8.5 14h5q-1 4 -8.5 8.5t-17.5 8.5t-13 6q-8 5 -34 9.5t-33 0.5q-5 -6 -4.5 -10.5t4 -14t3.5 -12.5q1 -6 -5.5 -13t-6.5 -12q0 -7 14 -15.5t10 -21.5q-3 -8 -16 -16t-16 -12q-5 -8 -1.5 -18.5t10.5 -16.5 q2 -2 1.5 -4t-3.5 -4.5t-5.5 -4t-6.5 -3.5l-3 -2q-11 -5 -20.5 6t-13.5 26q-7 25 -16 30q-23 8 -29 -1q-5 13 -41 26q-25 9 -58 4q6 1 0 15q-7 15 -19 12q3 6 4 17.5t1 13.5q3 13 12 23q1 1 7 8.5t9.5 13.5t0.5 6q35 -4 50 11q5 5 11.5 17t10.5 17q9 6 14 5.5t14.5 -5.5 t14.5 -5q14 -1 15.5 11t-7.5 20q12 -1 3 17q-5 7 -8 9q-12 4 -27 -5q-8 -4 2 -8q-1 1 -9.5 -10.5t-16.5 -17.5t-16 5q-1 1 -5.5 13.5t-9.5 13.5q-8 0 -16 -15q3 8 -11 15t-24 8q19 12 -8 27q-7 4 -20.5 5t-19.5 -4q-5 -7 -5.5 -11.5t5 -8t10.5 -5.5t11.5 -4t8.5 -3 q14 -10 8 -14q-2 -1 -8.5 -3.5t-11.5 -4.5t-6 -4q-3 -4 0 -14t-2 -14q-5 5 -9 17.5t-7 16.5q7 -9 -25 -6l-10 1q-4 0 -16 -2t-20.5 -1t-13.5 8q-4 8 0 20q1 4 4 2q-4 3 -11 9.5t-10 8.5q-46 -15 -94 -41q6 -1 12 1q5 2 13 6.5t10 5.5q34 14 42 7l5 5q14 -16 20 -25 q-7 4 -30 1q-20 -6 -22 -12q7 -12 5 -18q-4 3 -11.5 10t-14.5 11t-15 5q-16 0 -22 -1q-146 -80 -235 -222q7 -7 12 -8q4 -1 5 -9t2.5 -11t11.5 3q9 -8 3 -19q1 1 44 -27q19 -17 21 -21q3 -11 -10 -18q-1 2 -9 9t-9 4q-3 -5 0.5 -18.5t10.5 -12.5q-7 0 -9.5 -16t-2.5 -35.5 t-1 -23.5l2 -1q-3 -12 5.5 -34.5t21.5 -19.5q-13 -3 20 -43q6 -8 8 -9q3 -2 12 -7.5t15 -10t10 -10.5q4 -5 10 -22.5t14 -23.5q-2 -6 9.5 -20t10.5 -23q-1 0 -2.5 -1t-2.5 -1q3 -7 15.5 -14t15.5 -13q1 -3 2 -10t3 -11t8 -2q2 20 -24 62q-15 25 -17 29q-3 5 -5.5 15.5 t-4.5 14.5q2 0 6 -1.5t8.5 -3.5t7.5 -4t2 -3q-3 -7 2 -17.5t12 -18.5t17 -19t12 -13q6 -6 14 -19.5t0 -13.5q9 0 20 -10t17 -20q5 -8 8 -26t5 -24q2 -7 8.5 -13.5t12.5 -9.5l16 -8t13 -7q5 -2 18.5 -10.5t21.5 -11.5q10 -4 16 -4t14.5 2.5t13.5 3.5q15 2 29 -15t21 -21 q36 -19 55 -11q-2 -1 0.5 -7.5t8 -15.5t9 -14.5t5.5 -8.5q5 -6 18 -15t18 -15q6 4 7 9q-3 -8 7 -20t18 -10q14 3 14 32q-31 -15 -49 18q0 1 -2.5 5.5t-4 8.5t-2.5 8.5t0 7.5t5 3q9 0 10 3.5t-2 12.5t-4 13q-1 8 -11 20t-12 15q-5 -9 -16 -8t-16 9q0 -1 -1.5 -5.5t-1.5 -6.5 q-13 0 -15 1q1 3 2.5 17.5t3.5 22.5q1 4 5.5 12t7.5 14.5t4 12.5t-4.5 9.5t-17.5 2.5q-19 -1 -26 -20q-1 -3 -3 -10.5t-5 -11.5t-9 -7q-7 -3 -24 -2t-24 5q-13 8 -22.5 29t-9.5 37q0 10 2.5 26.5t3 25t-5.5 24.5q3 2 9 9.5t10 10.5q2 1 4.5 1.5t4.5 0t4 1.5t3 6q-1 1 -4 3 q-3 3 -4 3q7 -3 28.5 1.5t27.5 -1.5q15 -11 22 2q0 1 -2.5 9.5t-0.5 13.5q5 -27 29 -9q3 -3 15.5 -5t17.5 -5q3 -2 7 -5.5t5.5 -4.5t5 0.5t8.5 6.5q10 -14 12 -24q11 -40 19 -44q7 -3 11 -2t4.5 9.5t0 14t-1.5 12.5l-1 8v18l-1 8q-15 3 -18.5 12t1.5 18.5t15 18.5q1 1 8 3.5 t15.5 6.5t12.5 8q21 19 15 35q7 0 11 9q-1 0 -5 3t-7.5 5t-4.5 2q9 5 2 16q5 3 7.5 11t7.5 10q9 -12 21 -2q7 8 1 16q5 7 20.5 10.5t18.5 9.5q7 -2 8 2t1 12t3 12q4 5 15 9t13 5l17 11q3 4 0 4q18 -2 31 11q10 11 -6 20q3 6 -3 9.5t-15 5.5q3 1 11.5 0.5t10.5 1.5 q15 10 -7 16q-17 5 -43 -12zM879 10q206 36 351 189q-3 3 -12.5 4.5t-12.5 3.5q-18 7 -24 8q1 7 -2.5 13t-8 9t-12.5 8t-11 7q-2 2 -7 6t-7 5.5t-7.5 4.5t-8.5 2t-10 -1l-3 -1q-3 -1 -5.5 -2.5t-5.5 -3t-4 -3t0 -2.5q-21 17 -36 22q-5 1 -11 5.5t-10.5 7t-10 1.5t-11.5 -7 q-5 -5 -6 -15t-2 -13q-7 5 0 17.5t2 18.5q-3 6 -10.5 4.5t-12 -4.5t-11.5 -8.5t-9 -6.5t-8.5 -5.5t-8.5 -7.5q-3 -4 -6 -12t-5 -11q-2 4 -11.5 6.5t-9.5 5.5q2 -10 4 -35t5 -38q7 -31 -12 -48q-27 -25 -29 -40q-4 -22 12 -26q0 -7 -8 -20.5t-7 -21.5q0 -6 2 -16z" />
197 <glyph unicode="&#xf0ad;" horiz-adv-x="1664" d="M384 64q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1028 484l-682 -682q-37 -37 -90 -37q-52 0 -91 37l-106 108q-38 36 -38 90q0 53 38 91l681 681q39 -98 114.5 -173.5t173.5 -114.5zM1662 919q0 -39 -23 -106q-47 -134 -164.5 -217.5 t-258.5 -83.5q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q58 0 121.5 -16.5t107.5 -46.5q16 -11 16 -28t-16 -28l-293 -169v-224l193 -107q5 3 79 48.5t135.5 81t70.5 35.5q15 0 23.5 -10t8.5 -25z" />
198 <glyph unicode="&#xf0ae;" horiz-adv-x="1792" d="M1024 128h640v128h-640v-128zM640 640h1024v128h-1024v-128zM1280 1152h384v128h-384v-128zM1792 320v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 832v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19 t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45zM1792 1344v-256q0 -26 -19 -45t-45 -19h-1664q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1664q26 0 45 -19t19 -45z" />
199 <glyph unicode="&#xf0b0;" horiz-adv-x="1408" d="M1403 1241q17 -41 -14 -70l-493 -493v-742q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-256 256q-19 19 -19 45v486l-493 493q-31 29 -14 70q17 39 59 39h1280q42 0 59 -39z" />
200 <glyph unicode="&#xf0b1;" horiz-adv-x="1792" d="M640 1280h512v128h-512v-128zM1792 640v-480q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v480h672v-160q0 -26 19 -45t45 -19h320q26 0 45 19t19 45v160h672zM1024 640v-128h-256v128h256zM1792 1120v-384h-1792v384q0 66 47 113t113 47h352v160q0 40 28 68 t68 28h576q40 0 68 -28t28 -68v-160h352q66 0 113 -47t47 -113z" />
201 <glyph unicode="&#xf0b2;" d="M1283 995l-355 -355l355 -355l144 144q29 31 70 14q39 -17 39 -59v-448q0 -26 -19 -45t-45 -19h-448q-42 0 -59 40q-17 39 14 69l144 144l-355 355l-355 -355l144 -144q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l144 -144 l355 355l-355 355l-144 -144q-19 -19 -45 -19q-12 0 -24 5q-40 17 -40 59v448q0 26 19 45t45 19h448q42 0 59 -40q17 -39 -14 -69l-144 -144l355 -355l355 355l-144 144q-31 30 -14 69q17 40 59 40h448q26 0 45 -19t19 -45v-448q0 -42 -39 -59q-13 -5 -25 -5q-26 0 -45 19z " />
202 <glyph unicode="&#xf0c0;" horiz-adv-x="1920" d="M593 640q-162 -5 -265 -128h-134q-82 0 -138 40.5t-56 118.5q0 353 124 353q6 0 43.5 -21t97.5 -42.5t119 -21.5q67 0 133 23q-5 -37 -5 -66q0 -139 81 -256zM1664 3q0 -120 -73 -189.5t-194 -69.5h-874q-121 0 -194 69.5t-73 189.5q0 53 3.5 103.5t14 109t26.5 108.5 t43 97.5t62 81t85.5 53.5t111.5 20q10 0 43 -21.5t73 -48t107 -48t135 -21.5t135 21.5t107 48t73 48t43 21.5q61 0 111.5 -20t85.5 -53.5t62 -81t43 -97.5t26.5 -108.5t14 -109t3.5 -103.5zM640 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75 t75 -181zM1344 896q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5zM1920 671q0 -78 -56 -118.5t-138 -40.5h-134q-103 123 -265 128q81 117 81 256q0 29 -5 66q66 -23 133 -23q59 0 119 21.5t97.5 42.5 t43.5 21q124 0 124 -353zM1792 1280q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181z" />
203 <glyph unicode="&#xf0c1;" horiz-adv-x="1664" d="M1456 320q0 40 -28 68l-208 208q-28 28 -68 28q-42 0 -72 -32q3 -3 19 -18.5t21.5 -21.5t15 -19t13 -25.5t3.5 -27.5q0 -40 -28 -68t-68 -28q-15 0 -27.5 3.5t-25.5 13t-19 15t-21.5 21.5t-18.5 19q-33 -31 -33 -73q0 -40 28 -68l206 -207q27 -27 68 -27q40 0 68 26 l147 146q28 28 28 67zM753 1025q0 40 -28 68l-206 207q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l208 -208q27 -27 68 -27q42 0 72 31q-3 3 -19 18.5t-21.5 21.5t-15 19t-13 25.5t-3.5 27.5q0 40 28 68t68 28q15 0 27.5 -3.5t25.5 -13t19 -15 t21.5 -21.5t18.5 -19q33 31 33 73zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-206 207q-83 83 -83 203q0 123 88 209l-88 88q-86 -88 -208 -88q-120 0 -204 84l-208 208q-84 84 -84 204t85 203l147 146q83 83 203 83q121 0 204 -85l206 -207 q83 -83 83 -203q0 -123 -88 -209l88 -88q86 88 208 88q120 0 204 -84l208 -208q84 -84 84 -204z" />
204 <glyph unicode="&#xf0c2;" horiz-adv-x="1920" d="M1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088q-185 0 -316.5 131.5t-131.5 316.5q0 132 71 241.5t187 163.5q-2 28 -2 43q0 212 150 362t362 150q158 0 286.5 -88t187.5 -230q70 62 166 62q106 0 181 -75t75 -181q0 -75 -41 -138q129 -30 213 -134.5t84 -239.5z " />
205 <glyph unicode="&#xf0c3;" horiz-adv-x="1664" d="M1527 88q56 -89 21.5 -152.5t-140.5 -63.5h-1152q-106 0 -140.5 63.5t21.5 152.5l503 793v399h-64q-26 0 -45 19t-19 45t19 45t45 19h512q26 0 45 -19t19 -45t-19 -45t-45 -19h-64v-399zM748 813l-272 -429h712l-272 429l-20 31v37v399h-128v-399v-37z" />
206 <glyph unicode="&#xf0c4;" horiz-adv-x="1792" d="M960 640q26 0 45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45t19 45t45 19zM1260 576l507 -398q28 -20 25 -56q-5 -35 -35 -51l-128 -64q-13 -7 -29 -7q-17 0 -31 8l-690 387l-110 -66q-8 -4 -12 -5q14 -49 10 -97q-7 -77 -56 -147.5t-132 -123.5q-132 -84 -277 -84 q-136 0 -222 78q-90 84 -79 207q7 76 56 147t131 124q132 84 278 84q83 0 151 -31q9 13 22 22l122 73l-122 73q-13 9 -22 22q-68 -31 -151 -31q-146 0 -278 84q-82 53 -131 124t-56 147q-5 59 15.5 113t63.5 93q85 79 222 79q145 0 277 -84q83 -52 132 -123t56 -148 q4 -48 -10 -97q4 -1 12 -5l110 -66l690 387q14 8 31 8q16 0 29 -7l128 -64q30 -16 35 -51q3 -36 -25 -56zM579 836q46 42 21 108t-106 117q-92 59 -192 59q-74 0 -113 -36q-46 -42 -21 -108t106 -117q92 -59 192 -59q74 0 113 36zM494 91q81 51 106 117t-21 108 q-39 36 -113 36q-100 0 -192 -59q-81 -51 -106 -117t21 -108q39 -36 113 -36q100 0 192 59zM672 704l96 -58v11q0 36 33 56l14 8l-79 47l-26 -26q-3 -3 -10 -11t-12 -12q-2 -2 -4 -3.5t-3 -2.5zM896 480l96 -32l736 576l-128 64l-768 -431v-113l-160 -96l9 -8q2 -2 7 -6 q4 -4 11 -12t11 -12l26 -26zM1600 64l128 64l-520 408l-177 -138q-2 -3 -13 -7z" />
207 <glyph unicode="&#xf0c5;" horiz-adv-x="1792" d="M1696 1152q40 0 68 -28t28 -68v-1216q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v288h-544q-40 0 -68 28t-28 68v672q0 40 20 88t48 76l408 408q28 28 76 48t88 20h416q40 0 68 -28t28 -68v-328q68 40 128 40h416zM1152 939l-299 -299h299v299zM512 1323l-299 -299 h299v299zM708 676l316 316v416h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h512v256q0 40 20 88t48 76zM1664 -128v1152h-384v-416q0 -40 -28 -68t-68 -28h-416v-640h896z" />
208 <glyph unicode="&#xf0c6;" horiz-adv-x="1408" d="M1404 151q0 -117 -79 -196t-196 -79q-135 0 -235 100l-777 776q-113 115 -113 271q0 159 110 270t269 111q158 0 273 -113l605 -606q10 -10 10 -22q0 -16 -30.5 -46.5t-46.5 -30.5q-13 0 -23 10l-606 607q-79 77 -181 77q-106 0 -179 -75t-73 -181q0 -105 76 -181 l776 -777q63 -63 145 -63q64 0 106 42t42 106q0 82 -63 145l-581 581q-26 24 -60 24q-29 0 -48 -19t-19 -48q0 -32 25 -59l410 -410q10 -10 10 -22q0 -16 -31 -47t-47 -31q-12 0 -22 10l-410 410q-63 61 -63 149q0 82 57 139t139 57q88 0 149 -63l581 -581q100 -98 100 -235 z" />
209 <glyph unicode="&#xf0c7;" d="M384 0h768v384h-768v-384zM1280 0h128v896q0 14 -10 38.5t-20 34.5l-281 281q-10 10 -34 20t-39 10v-416q0 -40 -28 -68t-68 -28h-576q-40 0 -68 28t-28 68v416h-128v-1280h128v416q0 40 28 68t68 28h832q40 0 68 -28t28 -68v-416zM896 928v320q0 13 -9.5 22.5t-22.5 9.5 h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5zM1536 896v-928q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h928q40 0 88 -20t76 -48l280 -280q28 -28 48 -76t20 -88z" />
210 <glyph unicode="&#xf0c8;" d="M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
211 <glyph unicode="&#xf0c9;" d="M1536 192v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 704v-128q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1536 1216v-128q0 -26 -19 -45 t-45 -19h-1408q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
212 <glyph unicode="&#xf0ca;" horiz-adv-x="1792" d="M384 128q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM384 640q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 224v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5 t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1152q0 -80 -56 -136t-136 -56t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z M1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
213 <glyph unicode="&#xf0cb;" horiz-adv-x="1792" d="M381 -84q0 -80 -54.5 -126t-135.5 -46q-106 0 -172 66l57 88q49 -45 106 -45q29 0 50.5 14.5t21.5 42.5q0 64 -105 56l-26 56q8 10 32.5 43.5t42.5 54t37 38.5v1q-16 0 -48.5 -1t-48.5 -1v-53h-106v152h333v-88l-95 -115q51 -12 81 -49t30 -88zM383 543v-159h-362 q-6 36 -6 54q0 51 23.5 93t56.5 68t66 47.5t56.5 43.5t23.5 45q0 25 -14.5 38.5t-39.5 13.5q-46 0 -81 -58l-85 59q24 51 71.5 79.5t105.5 28.5q73 0 123 -41.5t50 -112.5q0 -50 -34 -91.5t-75 -64.5t-75.5 -50.5t-35.5 -52.5h127v60h105zM1792 224v-192q0 -13 -9.5 -22.5 t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM384 1123v-99h-335v99h107q0 41 0.5 122t0.5 121v12h-2q-8 -17 -50 -54l-71 76l136 127h106v-404h108zM1792 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5 t-9.5 22.5v192q0 14 9 23t23 9h1216q13 0 22.5 -9.5t9.5 -22.5zM1792 1248v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1216q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1216q13 0 22.5 -9.5t9.5 -22.5z" />
214 <glyph unicode="&#xf0cc;" horiz-adv-x="1792" d="M1760 640q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-1728q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h1728zM483 704q-28 35 -51 80q-48 97 -48 188q0 181 134 309q133 127 393 127q50 0 167 -19q66 -12 177 -48q10 -38 21 -118q14 -123 14 -183q0 -18 -5 -45l-12 -3l-84 6 l-14 2q-50 149 -103 205q-88 91 -210 91q-114 0 -182 -59q-67 -58 -67 -146q0 -73 66 -140t279 -129q69 -20 173 -66q58 -28 95 -52h-743zM990 448h411q7 -39 7 -92q0 -111 -41 -212q-23 -55 -71 -104q-37 -35 -109 -81q-80 -48 -153 -66q-80 -21 -203 -21q-114 0 -195 23 l-140 40q-57 16 -72 28q-8 8 -8 22v13q0 108 -2 156q-1 30 0 68l2 37v44l102 2q15 -34 30 -71t22.5 -56t12.5 -27q35 -57 80 -94q43 -36 105 -57q59 -22 132 -22q64 0 139 27q77 26 122 86q47 61 47 129q0 84 -81 157q-34 29 -137 71z" />
215 <glyph unicode="&#xf0cd;" d="M48 1313q-37 2 -45 4l-3 88q13 1 40 1q60 0 112 -4q132 -7 166 -7q86 0 168 3q116 4 146 5q56 0 86 2l-1 -14l2 -64v-9q-60 -9 -124 -9q-60 0 -79 -25q-13 -14 -13 -132q0 -13 0.5 -32.5t0.5 -25.5l1 -229l14 -280q6 -124 51 -202q35 -59 96 -92q88 -47 177 -47 q104 0 191 28q56 18 99 51q48 36 65 64q36 56 53 114q21 73 21 229q0 79 -3.5 128t-11 122.5t-13.5 159.5l-4 59q-5 67 -24 88q-34 35 -77 34l-100 -2l-14 3l2 86h84l205 -10q76 -3 196 10l18 -2q6 -38 6 -51q0 -7 -4 -31q-45 -12 -84 -13q-73 -11 -79 -17q-15 -15 -15 -41 q0 -7 1.5 -27t1.5 -31q8 -19 22 -396q6 -195 -15 -304q-15 -76 -41 -122q-38 -65 -112 -123q-75 -57 -182 -89q-109 -33 -255 -33q-167 0 -284 46q-119 47 -179 122q-61 76 -83 195q-16 80 -16 237v333q0 188 -17 213q-25 36 -147 39zM1536 -96v64q0 14 -9 23t-23 9h-1472 q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h1472q14 0 23 9t9 23z" />
216 <glyph unicode="&#xf0ce;" horiz-adv-x="1664" d="M512 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 160v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23 v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM512 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 160v192 q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1024 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 544v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192 q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1536 928v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM1664 1248v-1088q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1344q66 0 113 -47t47 -113 z" />
217 <glyph unicode="&#xf0d0;" horiz-adv-x="1664" d="M1190 955l293 293l-107 107l-293 -293zM1637 1248q0 -27 -18 -45l-1286 -1286q-18 -18 -45 -18t-45 18l-198 198q-18 18 -18 45t18 45l1286 1286q18 18 45 18t45 -18l198 -198q18 -18 18 -45zM286 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM636 1276 l196 -60l-196 -60l-60 -196l-60 196l-196 60l196 60l60 196zM1566 798l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98zM926 1438l98 -30l-98 -30l-30 -98l-30 98l-98 30l98 30l30 98z" />
218 <glyph unicode="&#xf0d1;" horiz-adv-x="1792" d="M640 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM256 640h384v256h-158q-13 0 -22 -9l-195 -195q-9 -9 -9 -22v-30zM1536 128q0 52 -38 90t-90 38t-90 -38t-38 -90t38 -90t90 -38t90 38t38 90zM1792 1216v-1024q0 -15 -4 -26.5t-13.5 -18.5 t-16.5 -11.5t-23.5 -6t-22.5 -2t-25.5 0t-22.5 0.5q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-64q-3 0 -22.5 -0.5t-25.5 0t-22.5 2t-23.5 6t-16.5 11.5t-13.5 18.5t-4 26.5q0 26 19 45t45 19v320q0 8 -0.5 35t0 38 t2.5 34.5t6.5 37t14 30.5t22.5 30l198 198q19 19 50.5 32t58.5 13h160v192q0 26 19 45t45 19h1024q26 0 45 -19t19 -45z" />
219 <glyph unicode="&#xf0d2;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103q-111 0 -218 32q59 93 78 164q9 34 54 211q20 -39 73 -67.5t114 -28.5q121 0 216 68.5t147 188.5t52 270q0 114 -59.5 214t-172.5 163t-255 63q-105 0 -196 -29t-154.5 -77t-109 -110.5t-67 -129.5t-21.5 -134 q0 -104 40 -183t117 -111q30 -12 38 20q2 7 8 31t8 30q6 23 -11 43q-51 61 -51 151q0 151 104.5 259.5t273.5 108.5q151 0 235.5 -82t84.5 -213q0 -170 -68.5 -289t-175.5 -119q-61 0 -98 43.5t-23 104.5q8 35 26.5 93.5t30 103t11.5 75.5q0 50 -27 83t-77 33 q-62 0 -105 -57t-43 -142q0 -73 25 -122l-99 -418q-17 -70 -13 -177q-206 91 -333 281t-127 423q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
220 <glyph unicode="&#xf0d3;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-725q85 122 108 210q9 34 53 209q21 -39 73.5 -67t112.5 -28q181 0 295.5 147.5t114.5 373.5q0 84 -35 162.5t-96.5 139t-152.5 97t-197 36.5q-104 0 -194.5 -28.5t-153 -76.5 t-107.5 -109.5t-66.5 -128t-21.5 -132.5q0 -102 39.5 -180t116.5 -110q13 -5 23.5 0t14.5 19q10 44 15 61q6 23 -11 42q-50 62 -50 150q0 150 103.5 256.5t270.5 106.5q149 0 232.5 -81t83.5 -210q0 -168 -67.5 -286t-173.5 -118q-60 0 -97 43.5t-23 103.5q8 34 26.5 92.5 t29.5 102t11 74.5q0 49 -26.5 81.5t-75.5 32.5q-61 0 -103.5 -56.5t-42.5 -139.5q0 -72 24 -121l-98 -414q-24 -100 -7 -254h-183q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960z" />
221 <glyph unicode="&#xf0d4;" d="M829 318q0 -76 -58.5 -112.5t-139.5 -36.5q-41 0 -80.5 9.5t-75.5 28.5t-58 53t-22 78q0 46 25 80t65.5 51.5t82 25t84.5 7.5q20 0 31 -2q2 -1 23 -16.5t26 -19t23 -18t24.5 -22t19 -22.5t17 -26t9 -26.5t4.5 -31.5zM755 863q0 -60 -33 -99.5t-92 -39.5q-53 0 -93 42.5 t-57.5 96.5t-17.5 106q0 61 32 104t92 43q53 0 93.5 -45t58 -101t17.5 -107zM861 1120l88 64h-265q-85 0 -161 -32t-127.5 -98t-51.5 -153q0 -93 64.5 -154.5t158.5 -61.5q22 0 43 3q-13 -29 -13 -54q0 -44 40 -94q-175 -12 -257 -63q-47 -29 -75.5 -73t-28.5 -95 q0 -43 18.5 -77.5t48.5 -56.5t69 -37t77.5 -21t76.5 -6q60 0 120.5 15.5t113.5 46t86 82.5t33 117q0 49 -20 89.5t-49 66.5t-58 47.5t-49 44t-20 44.5t15.5 42.5t37.5 39.5t44 42t37.5 59.5t15.5 82.5q0 60 -22.5 99.5t-72.5 90.5h83zM1152 672h128v64h-128v128h-64v-128 h-128v-64h128v-160h64v160zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
222 <glyph unicode="&#xf0d5;" horiz-adv-x="1664" d="M735 740q0 -36 32 -70.5t77.5 -68t90.5 -73.5t77 -104t32 -142q0 -90 -48 -173q-72 -122 -211 -179.5t-298 -57.5q-132 0 -246.5 41.5t-171.5 137.5q-37 60 -37 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 42 -47.5 74t-15.5 73q0 36 21 85q-46 -4 -68 -4 q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q77 66 182.5 98t217.5 32h418l-138 -88h-131q74 -63 112 -133t38 -160q0 -72 -24.5 -129.5t-59 -93t-69.5 -65t-59.5 -61.5t-24.5 -66zM589 836q38 0 78 16.5t66 43.5q53 57 53 159q0 58 -17 125t-48.5 129.5 t-84.5 103.5t-117 41q-42 0 -82.5 -19.5t-65.5 -52.5q-47 -59 -47 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26zM591 -37q58 0 111.5 13t99 39t73 73t27.5 109q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -48 2 q-53 0 -105 -7t-107.5 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -70 35 -123.5t91.5 -83t119 -44t127.5 -14.5zM1401 839h213v-108h-213v-219h-105v219h-212v108h212v217h105v-217z" />
223 <glyph unicode="&#xf0d6;" horiz-adv-x="1920" d="M768 384h384v96h-128v448h-114l-148 -137l77 -80q42 37 55 57h2v-288h-128v-96zM1280 640q0 -70 -21 -142t-59.5 -134t-101.5 -101t-138 -39t-138 39t-101.5 101t-59.5 134t-21 142t21 142t59.5 134t101.5 101t138 39t138 -39t101.5 -101t59.5 -134t21 -142zM1792 384 v512q-106 0 -181 75t-75 181h-1152q0 -106 -75 -181t-181 -75v-512q106 0 181 -75t75 -181h1152q0 106 75 181t181 75zM1920 1216v-1152q0 -26 -19 -45t-45 -19h-1792q-26 0 -45 19t-19 45v1152q0 26 19 45t45 19h1792q26 0 45 -19t19 -45z" />
224 <glyph unicode="&#xf0d7;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
225 <glyph unicode="&#xf0d8;" horiz-adv-x="1024" d="M1024 320q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
226 <glyph unicode="&#xf0d9;" horiz-adv-x="640" d="M640 1088v-896q0 -26 -19 -45t-45 -19t-45 19l-448 448q-19 19 -19 45t19 45l448 448q19 19 45 19t45 -19t19 -45z" />
227 <glyph unicode="&#xf0da;" horiz-adv-x="640" d="M576 640q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19t-19 45v896q0 26 19 45t45 19t45 -19l448 -448q19 -19 19 -45z" />
228 <glyph unicode="&#xf0db;" horiz-adv-x="1664" d="M160 0h608v1152h-640v-1120q0 -13 9.5 -22.5t22.5 -9.5zM1536 32v1120h-640v-1152h608q13 0 22.5 9.5t9.5 22.5zM1664 1248v-1216q0 -66 -47 -113t-113 -47h-1344q-66 0 -113 47t-47 113v1216q0 66 47 113t113 47h1344q66 0 113 -47t47 -113z" />
229 <glyph unicode="&#xf0dc;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45zM1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
230 <glyph unicode="&#xf0dd;" horiz-adv-x="1024" d="M1024 448q0 -26 -19 -45l-448 -448q-19 -19 -45 -19t-45 19l-448 448q-19 19 -19 45t19 45t45 19h896q26 0 45 -19t19 -45z" />
231 <glyph unicode="&#xf0de;" horiz-adv-x="1024" d="M1024 832q0 -26 -19 -45t-45 -19h-896q-26 0 -45 19t-19 45t19 45l448 448q19 19 45 19t45 -19l448 -448q19 -19 19 -45z" />
232 <glyph unicode="&#xf0e0;" horiz-adv-x="1792" d="M1792 826v-794q0 -66 -47 -113t-113 -47h-1472q-66 0 -113 47t-47 113v794q44 -49 101 -87q362 -246 497 -345q57 -42 92.5 -65.5t94.5 -48t110 -24.5h1h1q51 0 110 24.5t94.5 48t92.5 65.5q170 123 498 345q57 39 100 87zM1792 1120q0 -79 -49 -151t-122 -123 q-376 -261 -468 -325q-10 -7 -42.5 -30.5t-54 -38t-52 -32.5t-57.5 -27t-50 -9h-1h-1q-23 0 -50 9t-57.5 27t-52 32.5t-54 38t-42.5 30.5q-91 64 -262 182.5t-205 142.5q-62 42 -117 115.5t-55 136.5q0 78 41.5 130t118.5 52h1472q65 0 112.5 -47t47.5 -113z" />
233 <glyph unicode="&#xf0e1;" d="M349 911v-991h-330v991h330zM370 1217q1 -73 -50.5 -122t-135.5 -49h-2q-82 0 -132 49t-50 122q0 74 51.5 122.5t134.5 48.5t133 -48.5t51 -122.5zM1536 488v-568h-329v530q0 105 -40.5 164.5t-126.5 59.5q-63 0 -105.5 -34.5t-63.5 -85.5q-11 -30 -11 -81v-553h-329 q2 399 2 647t-1 296l-1 48h329v-144h-2q20 32 41 56t56.5 52t87 43.5t114.5 15.5q171 0 275 -113.5t104 -332.5z" />
234 <glyph unicode="&#xf0e2;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298z" />
235 <glyph unicode="&#xf0e3;" horiz-adv-x="1792" d="M1771 0q0 -53 -37 -90l-107 -108q-39 -37 -91 -37q-53 0 -90 37l-363 364q-38 36 -38 90q0 53 43 96l-256 256l-126 -126q-14 -14 -34 -14t-34 14q2 -2 12.5 -12t12.5 -13t10 -11.5t10 -13.5t6 -13.5t5.5 -16.5t1.5 -18q0 -38 -28 -68q-3 -3 -16.5 -18t-19 -20.5 t-18.5 -16.5t-22 -15.5t-22 -9t-26 -4.5q-40 0 -68 28l-408 408q-28 28 -28 68q0 13 4.5 26t9 22t15.5 22t16.5 18.5t20.5 19t18 16.5q30 28 68 28q10 0 18 -1.5t16.5 -5.5t13.5 -6t13.5 -10t11.5 -10t13 -12.5t12 -12.5q-14 14 -14 34t14 34l348 348q14 14 34 14t34 -14 q-2 2 -12.5 12t-12.5 13t-10 11.5t-10 13.5t-6 13.5t-5.5 16.5t-1.5 18q0 38 28 68q3 3 16.5 18t19 20.5t18.5 16.5t22 15.5t22 9t26 4.5q40 0 68 -28l408 -408q28 -28 28 -68q0 -13 -4.5 -26t-9 -22t-15.5 -22t-16.5 -18.5t-20.5 -19t-18 -16.5q-30 -28 -68 -28 q-10 0 -18 1.5t-16.5 5.5t-13.5 6t-13.5 10t-11.5 10t-13 12.5t-12 12.5q14 -14 14 -34t-14 -34l-126 -126l256 -256q43 43 96 43q52 0 91 -37l363 -363q37 -39 37 -91z" />
236 <glyph unicode="&#xf0e4;" horiz-adv-x="1792" d="M384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM576 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1004 351l101 382q6 26 -7.5 48.5t-38.5 29.5 t-48 -6.5t-30 -39.5l-101 -382q-60 -5 -107 -43.5t-63 -98.5q-20 -77 20 -146t117 -89t146 20t89 117q16 60 -6 117t-72 91zM1664 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1024 1024q0 53 -37.5 90.5 t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1472 832q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1792 384q0 -261 -141 -483q-19 -29 -54 -29h-1402q-35 0 -54 29 q-141 221 -141 483q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
237 <glyph unicode="&#xf0e5;" horiz-adv-x="1792" d="M896 1152q-204 0 -381.5 -69.5t-282 -187.5t-104.5 -255q0 -112 71.5 -213.5t201.5 -175.5l87 -50l-27 -96q-24 -91 -70 -172q152 63 275 171l43 38l57 -6q69 -8 130 -8q204 0 381.5 69.5t282 187.5t104.5 255t-104.5 255t-282 187.5t-381.5 69.5zM1792 640 q0 -174 -120 -321.5t-326 -233t-450 -85.5q-70 0 -145 8q-198 -175 -460 -242q-49 -14 -114 -22h-5q-15 0 -27 10.5t-16 27.5v1q-3 4 -0.5 12t2 10t4.5 9.5l6 9t7 8.5t8 9q7 8 31 34.5t34.5 38t31 39.5t32.5 51t27 59t26 76q-157 89 -247.5 220t-90.5 281q0 174 120 321.5 t326 233t450 85.5t450 -85.5t326 -233t120 -321.5z" />
238 <glyph unicode="&#xf0e6;" horiz-adv-x="1792" d="M704 1152q-153 0 -286 -52t-211.5 -141t-78.5 -191q0 -82 53 -158t149 -132l97 -56l-35 -84q34 20 62 39l44 31l53 -10q78 -14 153 -14q153 0 286 52t211.5 141t78.5 191t-78.5 191t-211.5 141t-286 52zM704 1280q191 0 353.5 -68.5t256.5 -186.5t94 -257t-94 -257 t-256.5 -186.5t-353.5 -68.5q-86 0 -176 16q-124 -88 -278 -128q-36 -9 -86 -16h-3q-11 0 -20.5 8t-11.5 21q-1 3 -1 6.5t0.5 6.5t2 6l2.5 5t3.5 5.5t4 5t4.5 5t4 4.5q5 6 23 25t26 29.5t22.5 29t25 38.5t20.5 44q-124 72 -195 177t-71 224q0 139 94 257t256.5 186.5 t353.5 68.5zM1526 111q10 -24 20.5 -44t25 -38.5t22.5 -29t26 -29.5t23 -25q1 -1 4 -4.5t4.5 -5t4 -5t3.5 -5.5l2.5 -5t2 -6t0.5 -6.5t-1 -6.5q-3 -14 -13 -22t-22 -7q-50 7 -86 16q-154 40 -278 128q-90 -16 -176 -16q-271 0 -472 132q58 -4 88 -4q161 0 309 45t264 129 q125 92 192 212t67 254q0 77 -23 152q129 -71 204 -178t75 -230q0 -120 -71 -224.5t-195 -176.5z" />
239 <glyph unicode="&#xf0e7;" horiz-adv-x="896" d="M885 970q18 -20 7 -44l-540 -1157q-13 -25 -42 -25q-4 0 -14 2q-17 5 -25.5 19t-4.5 30l197 808l-406 -101q-4 -1 -12 -1q-18 0 -31 11q-18 15 -13 39l201 825q4 14 16 23t28 9h328q19 0 32 -12.5t13 -29.5q0 -8 -5 -18l-171 -463l396 98q8 2 12 2q19 0 34 -15z" />
240 <glyph unicode="&#xf0e8;" horiz-adv-x="1792" d="M1792 288v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192h-512v-192h96q40 0 68 -28t28 -68v-320 q0 -40 -28 -68t-68 -28h-320q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h96v192q0 52 38 90t90 38h512v192h-96q-40 0 -68 28t-28 68v320q0 40 28 68t68 28h320q40 0 68 -28t28 -68v-320q0 -40 -28 -68t-68 -28h-96v-192h512q52 0 90 -38t38 -90v-192h96q40 0 68 -28t28 -68 z" />
241 <glyph unicode="&#xf0e9;" horiz-adv-x="1664" d="M896 708v-580q0 -104 -76 -180t-180 -76t-180 76t-76 180q0 26 19 45t45 19t45 -19t19 -45q0 -50 39 -89t89 -39t89 39t39 89v580q33 11 64 11t64 -11zM1664 681q0 -13 -9.5 -22.5t-22.5 -9.5q-11 0 -23 10q-49 46 -93 69t-102 23q-68 0 -128 -37t-103 -97 q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -28 -17q-18 0 -29 17q-4 6 -14.5 24t-17.5 28q-43 60 -102.5 97t-127.5 37t-127.5 -37t-102.5 -97q-7 -10 -17.5 -28t-14.5 -24q-11 -17 -29 -17q-17 0 -28 17q-4 6 -14.5 24t-17.5 28q-43 60 -103 97t-128 37q-58 0 -102 -23t-93 -69 q-12 -10 -23 -10q-13 0 -22.5 9.5t-9.5 22.5q0 5 1 7q45 183 172.5 319.5t298 204.5t360.5 68q140 0 274.5 -40t246.5 -113.5t194.5 -187t115.5 -251.5q1 -2 1 -7zM896 1408v-98q-42 2 -64 2t-64 -2v98q0 26 19 45t45 19t45 -19t19 -45z" />
242 <glyph unicode="&#xf0ea;" horiz-adv-x="1792" d="M768 -128h896v640h-416q-40 0 -68 28t-28 68v416h-384v-1152zM1024 1312v64q0 13 -9.5 22.5t-22.5 9.5h-704q-13 0 -22.5 -9.5t-9.5 -22.5v-64q0 -13 9.5 -22.5t22.5 -9.5h704q13 0 22.5 9.5t9.5 22.5zM1280 640h299l-299 299v-299zM1792 512v-672q0 -40 -28 -68t-68 -28 h-960q-40 0 -68 28t-28 68v160h-544q-40 0 -68 28t-28 68v1344q0 40 28 68t68 28h1088q40 0 68 -28t28 -68v-328q21 -13 36 -28l408 -408q28 -28 48 -76t20 -88z" />
243 <glyph unicode="&#xf0eb;" horiz-adv-x="1024" d="M736 960q0 -13 -9.5 -22.5t-22.5 -9.5t-22.5 9.5t-9.5 22.5q0 46 -54 71t-106 25q-13 0 -22.5 9.5t-9.5 22.5t9.5 22.5t22.5 9.5q50 0 99.5 -16t87 -54t37.5 -90zM896 960q0 72 -34.5 134t-90 101.5t-123 62t-136.5 22.5t-136.5 -22.5t-123 -62t-90 -101.5t-34.5 -134 q0 -101 68 -180q10 -11 30.5 -33t30.5 -33q128 -153 141 -298h228q13 145 141 298q10 11 30.5 33t30.5 33q68 79 68 180zM1024 960q0 -155 -103 -268q-45 -49 -74.5 -87t-59.5 -95.5t-34 -107.5q47 -28 47 -82q0 -37 -25 -64q25 -27 25 -64q0 -52 -45 -81q13 -23 13 -47 q0 -46 -31.5 -71t-77.5 -25q-20 -44 -60 -70t-87 -26t-87 26t-60 70q-46 0 -77.5 25t-31.5 71q0 24 13 47q-45 29 -45 81q0 37 25 64q-25 27 -25 64q0 54 47 82q-4 50 -34 107.5t-59.5 95.5t-74.5 87q-103 113 -103 268q0 99 44.5 184.5t117 142t164 89t186.5 32.5 t186.5 -32.5t164 -89t117 -142t44.5 -184.5z" />
244 <glyph unicode="&#xf0ec;" horiz-adv-x="1792" d="M1792 352v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-1376v-192q0 -13 -9.5 -22.5t-22.5 -9.5q-12 0 -24 10l-319 320q-9 9 -9 22q0 14 9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h1376q13 0 22.5 -9.5t9.5 -22.5zM1792 896q0 -14 -9 -23l-320 -320q-9 -9 -23 -9 q-13 0 -22.5 9.5t-9.5 22.5v192h-1376q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h1376v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23z" />
245 <glyph unicode="&#xf0ed;" horiz-adv-x="1920" d="M1280 608q0 14 -9 23t-23 9h-224v352q0 13 -9.5 22.5t-22.5 9.5h-192q-13 0 -22.5 -9.5t-9.5 -22.5v-352h-224q-13 0 -22.5 -9.5t-9.5 -22.5q0 -14 9 -23l352 -352q9 -9 23 -9t23 9l351 351q10 12 10 24zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
246 <glyph unicode="&#xf0ee;" horiz-adv-x="1920" d="M1280 672q0 14 -9 23l-352 352q-9 9 -23 9t-23 -9l-351 -351q-10 -12 -10 -24q0 -14 9 -23t23 -9h224v-352q0 -13 9.5 -22.5t22.5 -9.5h192q13 0 22.5 9.5t9.5 22.5v352h224q13 0 22.5 9.5t9.5 22.5zM1920 384q0 -159 -112.5 -271.5t-271.5 -112.5h-1088 q-185 0 -316.5 131.5t-131.5 316.5q0 130 70 240t188 165q-2 30 -2 43q0 212 150 362t362 150q156 0 285.5 -87t188.5 -231q71 62 166 62q106 0 181 -75t75 -181q0 -76 -41 -138q130 -31 213.5 -135.5t83.5 -238.5z" />
247 <glyph unicode="&#xf0f0;" horiz-adv-x="1408" d="M384 192q0 -26 -19 -45t-45 -19t-45 19t-19 45t19 45t45 19t45 -19t19 -45zM1408 131q0 -121 -73 -190t-194 -69h-874q-121 0 -194 69t-73 190q0 68 5.5 131t24 138t47.5 132.5t81 103t120 60.5q-22 -52 -22 -120v-203q-58 -20 -93 -70t-35 -111q0 -80 56 -136t136 -56 t136 56t56 136q0 61 -35.5 111t-92.5 70v203q0 62 25 93q132 -104 295 -104t295 104q25 -31 25 -93v-64q-106 0 -181 -75t-75 -181v-89q-32 -29 -32 -71q0 -40 28 -68t68 -28t68 28t28 68q0 42 -32 71v89q0 52 38 90t90 38t90 -38t38 -90v-89q-32 -29 -32 -71q0 -40 28 -68 t68 -28t68 28t28 68q0 42 -32 71v89q0 68 -34.5 127.5t-93.5 93.5q0 10 0.5 42.5t0 48t-2.5 41.5t-7 47t-13 40q68 -15 120 -60.5t81 -103t47.5 -132.5t24 -138t5.5 -131zM1088 1024q0 -159 -112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5t112.5 271.5t271.5 112.5 t271.5 -112.5t112.5 -271.5z" />
248 <glyph unicode="&#xf0f1;" horiz-adv-x="1408" d="M1280 832q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 832q0 -62 -35.5 -111t-92.5 -70v-395q0 -159 -131.5 -271.5t-316.5 -112.5t-316.5 112.5t-131.5 271.5v132q-164 20 -274 128t-110 252v512q0 26 19 45t45 19q6 0 16 -2q17 30 47 48 t65 18q53 0 90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5q-33 0 -64 18v-402q0 -106 94 -181t226 -75t226 75t94 181v402q-31 -18 -64 -18q-53 0 -90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5q35 0 65 -18t47 -48q10 2 16 2q26 0 45 -19t19 -45v-512q0 -144 -110 -252 t-274 -128v-132q0 -106 94 -181t226 -75t226 75t94 181v395q-57 21 -92.5 70t-35.5 111q0 80 56 136t136 56t136 -56t56 -136z" />
249 <glyph unicode="&#xf0f2;" horiz-adv-x="1792" d="M640 1152h512v128h-512v-128zM288 1152v-1280h-64q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h64zM1408 1152v-1280h-1024v1280h128v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h128zM1792 928v-832q0 -92 -66 -158t-158 -66h-64v1280h64q92 0 158 -66 t66 -158z" />
250 <glyph unicode="&#xf0f3;" horiz-adv-x="1792" d="M912 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM1728 128q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-181 75t-75 181h-448q-52 0 -90 38t-38 90q50 42 91 88t85 119.5t74.5 158.5 t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q190 -28 307 -158.5t117 -282.5q0 -139 19.5 -260t50 -206t74.5 -158.5t85 -119.5t91 -88z" />
251 <glyph unicode="&#xf0f4;" horiz-adv-x="1920" d="M1664 896q0 80 -56 136t-136 56h-64v-384h64q80 0 136 56t56 136zM0 128h1792q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM1856 896q0 -159 -112.5 -271.5t-271.5 -112.5h-64v-32q0 -92 -66 -158t-158 -66h-704q-92 0 -158 66t-66 158v736q0 26 19 45 t45 19h1152q159 0 271.5 -112.5t112.5 -271.5z" />
252 <glyph unicode="&#xf0f5;" horiz-adv-x="1408" d="M640 1472v-640q0 -61 -35.5 -111t-92.5 -70v-779q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v779q-57 20 -92.5 70t-35.5 111v640q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45v-416q0 -26 19 -45 t45 -19t45 19t19 45v416q0 26 19 45t45 19t45 -19t19 -45zM1408 1472v-1600q0 -52 -38 -90t-90 -38h-128q-52 0 -90 38t-38 90v512h-224q-13 0 -22.5 9.5t-9.5 22.5v800q0 132 94 226t226 94h256q26 0 45 -19t19 -45z" />
253 <glyph unicode="&#xf0f6;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M384 736q0 14 9 23t23 9h704q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64zM1120 512q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704zM1120 256q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-704 q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h704z" />
254 <glyph unicode="&#xf0f7;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 992v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 1248v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1536h-1152v-1536h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM1408 1472v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280q26 0 45 -19t19 -45z" />
255 <glyph unicode="&#xf0f8;" horiz-adv-x="1408" d="M384 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM384 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M1152 224v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM896 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M640 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 480v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5zM1152 736v-64q0 -13 -9.5 -22.5t-22.5 -9.5h-64q-13 0 -22.5 9.5t-9.5 22.5v64q0 13 9.5 22.5t22.5 9.5h64q13 0 22.5 -9.5t9.5 -22.5z M896 -128h384v1152h-256v-32q0 -40 -28 -68t-68 -28h-448q-40 0 -68 28t-28 68v32h-256v-1152h384v224q0 13 9.5 22.5t22.5 9.5h320q13 0 22.5 -9.5t9.5 -22.5v-224zM896 1056v320q0 13 -9.5 22.5t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-96h-128v96q0 13 -9.5 22.5 t-22.5 9.5h-64q-13 0 -22.5 -9.5t-9.5 -22.5v-320q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5v96h128v-96q0 -13 9.5 -22.5t22.5 -9.5h64q13 0 22.5 9.5t9.5 22.5zM1408 1088v-1280q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1280q0 26 19 45t45 19h320 v288q0 40 28 68t68 28h448q40 0 68 -28t28 -68v-288h320q26 0 45 -19t19 -45z" />
256 <glyph unicode="&#xf0f9;" horiz-adv-x="1920" d="M640 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM256 640h384v256h-158q-14 -2 -22 -9l-195 -195q-7 -12 -9 -22v-30zM1536 128q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5zM1664 800v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM1920 1344v-1152 q0 -26 -19 -45t-45 -19h-192q0 -106 -75 -181t-181 -75t-181 75t-75 181h-384q0 -106 -75 -181t-181 -75t-181 75t-75 181h-128q-26 0 -45 19t-19 45t19 45t45 19v416q0 26 13 58t32 51l198 198q19 19 51 32t58 13h160v320q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
257 <glyph unicode="&#xf0fa;" horiz-adv-x="1792" d="M1280 416v192q0 14 -9 23t-23 9h-224v224q0 14 -9 23t-23 9h-192q-14 0 -23 -9t-9 -23v-224h-224q-14 0 -23 -9t-9 -23v-192q0 -14 9 -23t23 -9h224v-224q0 -14 9 -23t23 -9h192q14 0 23 9t9 23v224h224q14 0 23 9t9 23zM640 1152h512v128h-512v-128zM256 1152v-1280h-32 q-92 0 -158 66t-66 158v832q0 92 66 158t158 66h32zM1440 1152v-1280h-1088v1280h160v160q0 40 28 68t68 28h576q40 0 68 -28t28 -68v-160h160zM1792 928v-832q0 -92 -66 -158t-158 -66h-32v1280h32q92 0 158 -66t66 -158z" />
258 <glyph unicode="&#xf0fb;" horiz-adv-x="1920" d="M1920 576q-1 -32 -288 -96l-352 -32l-224 -64h-64l-293 -352h69q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-96h-160h-64v32h64v416h-160l-192 -224h-96l-32 32v192h32v32h128v8l-192 24v128l192 24v8h-128v32h-32v192l32 32h96l192 -224h160v416h-64v32h64h160h96 q26 0 45 -4.5t19 -11.5t-19 -11.5t-45 -4.5h-69l293 -352h64l224 -64l352 -32q261 -58 287 -93z" />
259 <glyph unicode="&#xf0fc;" horiz-adv-x="1664" d="M640 640v384h-256v-256q0 -53 37.5 -90.5t90.5 -37.5h128zM1664 192v-192h-1152v192l128 192h-128q-159 0 -271.5 112.5t-112.5 271.5v320l-64 64l32 128h480l32 128h960l32 -192l-64 -32v-800z" />
260 <glyph unicode="&#xf0fd;" d="M1280 192v896q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-512v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-896q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h512v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
261 <glyph unicode="&#xf0fe;" d="M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
262 <glyph unicode="&#xf100;" horiz-adv-x="1024" d="M627 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23zM1011 160q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23z" />
263 <glyph unicode="&#xf101;" horiz-adv-x="1024" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM979 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23 l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
264 <glyph unicode="&#xf102;" horiz-adv-x="1152" d="M1075 224q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23zM1075 608q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393 q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
265 <glyph unicode="&#xf103;" horiz-adv-x="1152" d="M1075 672q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23zM1075 1056q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23 t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
266 <glyph unicode="&#xf104;" horiz-adv-x="640" d="M627 992q0 -13 -10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
267 <glyph unicode="&#xf105;" horiz-adv-x="640" d="M595 576q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
268 <glyph unicode="&#xf106;" horiz-adv-x="1152" d="M1075 352q0 -13 -10 -23l-50 -50q-10 -10 -23 -10t-23 10l-393 393l-393 -393q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l466 -466q10 -10 10 -23z" />
269 <glyph unicode="&#xf107;" horiz-adv-x="1152" d="M1075 800q0 -13 -10 -23l-466 -466q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l393 -393l393 393q10 10 23 10t23 -10l50 -50q10 -10 10 -23z" />
270 <glyph unicode="&#xf108;" horiz-adv-x="1920" d="M1792 544v832q0 13 -9.5 22.5t-22.5 9.5h-1600q-13 0 -22.5 -9.5t-9.5 -22.5v-832q0 -13 9.5 -22.5t22.5 -9.5h1600q13 0 22.5 9.5t9.5 22.5zM1920 1376v-1088q0 -66 -47 -113t-113 -47h-544q0 -37 16 -77.5t32 -71t16 -43.5q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19 t-19 45q0 14 16 44t32 70t16 78h-544q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h1600q66 0 113 -47t47 -113z" />
271 <glyph unicode="&#xf109;" horiz-adv-x="1920" d="M416 256q-66 0 -113 47t-47 113v704q0 66 47 113t113 47h1088q66 0 113 -47t47 -113v-704q0 -66 -47 -113t-113 -47h-1088zM384 1120v-704q0 -13 9.5 -22.5t22.5 -9.5h1088q13 0 22.5 9.5t9.5 22.5v704q0 13 -9.5 22.5t-22.5 9.5h-1088q-13 0 -22.5 -9.5t-9.5 -22.5z M1760 192h160v-96q0 -40 -47 -68t-113 -28h-1600q-66 0 -113 28t-47 68v96h160h1600zM1040 96q16 0 16 16t-16 16h-160q-16 0 -16 -16t16 -16h160z" />
272 <glyph unicode="&#xf10a;" horiz-adv-x="1152" d="M640 128q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1024 288v960q0 13 -9.5 22.5t-22.5 9.5h-832q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h832q13 0 22.5 9.5t9.5 22.5zM1152 1248v-1088q0 -66 -47 -113t-113 -47h-832 q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h832q66 0 113 -47t47 -113z" />
273 <glyph unicode="&#xf10b;" horiz-adv-x="768" d="M464 128q0 33 -23.5 56.5t-56.5 23.5t-56.5 -23.5t-23.5 -56.5t23.5 -56.5t56.5 -23.5t56.5 23.5t23.5 56.5zM672 288v704q0 13 -9.5 22.5t-22.5 9.5h-512q-13 0 -22.5 -9.5t-9.5 -22.5v-704q0 -13 9.5 -22.5t22.5 -9.5h512q13 0 22.5 9.5t9.5 22.5zM480 1136 q0 16 -16 16h-160q-16 0 -16 -16t16 -16h160q16 0 16 16zM768 1152v-1024q0 -52 -38 -90t-90 -38h-512q-52 0 -90 38t-38 90v1024q0 52 38 90t90 38h512q52 0 90 -38t38 -90z" />
274 <glyph unicode="&#xf10c;" d="M768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103 t279.5 -279.5t103 -385.5z" />
275 <glyph unicode="&#xf10d;" horiz-adv-x="1664" d="M768 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z M1664 576v-384q0 -80 -56 -136t-136 -56h-384q-80 0 -136 56t-56 136v704q0 104 40.5 198.5t109.5 163.5t163.5 109.5t198.5 40.5h64q26 0 45 -19t19 -45v-128q0 -26 -19 -45t-45 -19h-64q-106 0 -181 -75t-75 -181v-32q0 -40 28 -68t68 -28h224q80 0 136 -56t56 -136z" />
276 <glyph unicode="&#xf10e;" horiz-adv-x="1664" d="M768 1216v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136zM1664 1216 v-704q0 -104 -40.5 -198.5t-109.5 -163.5t-163.5 -109.5t-198.5 -40.5h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64q106 0 181 75t75 181v32q0 40 -28 68t-68 28h-224q-80 0 -136 56t-56 136v384q0 80 56 136t136 56h384q80 0 136 -56t56 -136z" />
277 <glyph unicode="&#xf110;" horiz-adv-x="1568" d="M496 192q0 -60 -42.5 -102t-101.5 -42q-60 0 -102 42t-42 102t42 102t102 42q59 0 101.5 -42t42.5 -102zM928 0q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM320 640q0 -66 -47 -113t-113 -47t-113 47t-47 113 t47 113t113 47t113 -47t47 -113zM1360 192q0 -46 -33 -79t-79 -33t-79 33t-33 79t33 79t79 33t79 -33t33 -79zM528 1088q0 -73 -51.5 -124.5t-124.5 -51.5t-124.5 51.5t-51.5 124.5t51.5 124.5t124.5 51.5t124.5 -51.5t51.5 -124.5zM992 1280q0 -80 -56 -136t-136 -56 t-136 56t-56 136t56 136t136 56t136 -56t56 -136zM1536 640q0 -40 -28 -68t-68 -28t-68 28t-28 68t28 68t68 28t68 -28t28 -68zM1328 1088q0 -33 -23.5 -56.5t-56.5 -23.5t-56.5 23.5t-23.5 56.5t23.5 56.5t56.5 23.5t56.5 -23.5t23.5 -56.5z" />
278 <glyph unicode="&#xf111;" d="M1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
279 <glyph unicode="&#xf112;" horiz-adv-x="1792" d="M1792 416q0 -166 -127 -451q-3 -7 -10.5 -24t-13.5 -30t-13 -22q-12 -17 -28 -17q-15 0 -23.5 10t-8.5 25q0 9 2.5 26.5t2.5 23.5q5 68 5 123q0 101 -17.5 181t-48.5 138.5t-80 101t-105.5 69.5t-133 42.5t-154 21.5t-175.5 6h-224v-256q0 -26 -19 -45t-45 -19t-45 19 l-512 512q-19 19 -19 45t19 45l512 512q19 19 45 19t45 -19t19 -45v-256h224q713 0 875 -403q53 -134 53 -333z" />
280 <glyph unicode="&#xf113;" horiz-adv-x="1664" d="M640 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1280 320q0 -40 -12.5 -82t-43 -76t-72.5 -34t-72.5 34t-43 76t-12.5 82t12.5 82t43 76t72.5 34t72.5 -34t43 -76t12.5 -82zM1440 320 q0 120 -69 204t-187 84q-41 0 -195 -21q-71 -11 -157 -11t-157 11q-152 21 -195 21q-118 0 -187 -84t-69 -204q0 -88 32 -153.5t81 -103t122 -60t140 -29.5t149 -7h168q82 0 149 7t140 29.5t122 60t81 103t32 153.5zM1664 496q0 -207 -61 -331q-38 -77 -105.5 -133t-141 -86 t-170 -47.5t-171.5 -22t-167 -4.5q-78 0 -142 3t-147.5 12.5t-152.5 30t-137 51.5t-121 81t-86 115q-62 123 -62 331q0 237 136 396q-27 82 -27 170q0 116 51 218q108 0 190 -39.5t189 -123.5q147 35 309 35q148 0 280 -32q105 82 187 121t189 39q51 -102 51 -218 q0 -87 -27 -168q136 -160 136 -398z" />
281 <glyph unicode="&#xf114;" horiz-adv-x="1664" d="M1536 224v704q0 40 -28 68t-68 28h-704q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68v-960q0 -40 28 -68t68 -28h1216q40 0 68 28t28 68zM1664 928v-704q0 -92 -66 -158t-158 -66h-1216q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320 q92 0 158 -66t66 -158v-32h672q92 0 158 -66t66 -158z" />
282 <glyph unicode="&#xf115;" horiz-adv-x="1920" d="M1781 605q0 35 -53 35h-1088q-40 0 -85.5 -21.5t-71.5 -52.5l-294 -363q-18 -24 -18 -40q0 -35 53 -35h1088q40 0 86 22t71 53l294 363q18 22 18 39zM640 768h768v160q0 40 -28 68t-68 28h-576q-40 0 -68 28t-28 68v64q0 40 -28 68t-68 28h-320q-40 0 -68 -28t-28 -68 v-853l256 315q44 53 116 87.5t140 34.5zM1909 605q0 -62 -46 -120l-295 -363q-43 -53 -116 -87.5t-140 -34.5h-1088q-92 0 -158 66t-66 158v960q0 92 66 158t158 66h320q92 0 158 -66t66 -158v-32h544q92 0 158 -66t66 -158v-160h192q54 0 99 -24.5t67 -70.5q15 -32 15 -68z " />
283 <glyph unicode="&#xf116;" horiz-adv-x="1792" />
284 <glyph unicode="&#xf117;" horiz-adv-x="1792" />
285 <glyph unicode="&#xf118;" d="M1134 461q-37 -121 -138 -195t-228 -74t-228 74t-138 195q-8 25 4 48.5t38 31.5q25 8 48.5 -4t31.5 -38q25 -80 92.5 -129.5t151.5 -49.5t151.5 49.5t92.5 129.5q8 26 32 38t49 4t37 -31.5t4 -48.5zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5 t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5 t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
286 <glyph unicode="&#xf119;" d="M1134 307q8 -25 -4 -48.5t-37 -31.5t-49 4t-32 38q-25 80 -92.5 129.5t-151.5 49.5t-151.5 -49.5t-92.5 -129.5q-8 -26 -31.5 -38t-48.5 -4q-26 8 -38 31.5t-4 48.5q37 121 138 195t228 74t228 -74t138 -195zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204 t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
287 <glyph unicode="&#xf11a;" d="M1152 448q0 -26 -19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h640q26 0 45 -19t19 -45zM640 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1152 896q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5t37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
288 <glyph unicode="&#xf11b;" horiz-adv-x="1920" d="M832 448v128q0 14 -9 23t-23 9h-192v192q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-192h-192q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h192v-192q0 -14 9 -23t23 -9h128q14 0 23 9t9 23v192h192q14 0 23 9t9 23zM1408 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 640q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1920 512q0 -212 -150 -362t-362 -150q-192 0 -338 128h-220q-146 -128 -338 -128q-212 0 -362 150 t-150 362t150 362t362 150h896q212 0 362 -150t150 -362z" />
289 <glyph unicode="&#xf11c;" horiz-adv-x="1920" d="M384 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM512 624v-96q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h224q16 0 16 -16zM384 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 368v-96q0 -16 -16 -16 h-864q-16 0 -16 16v96q0 16 16 16h864q16 0 16 -16zM768 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM640 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1024 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16 h96q16 0 16 -16zM896 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1280 624v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 368v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1152 880v-96 q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1408 880v-96q0 -16 -16 -16h-96q-16 0 -16 16v96q0 16 16 16h96q16 0 16 -16zM1664 880v-352q0 -16 -16 -16h-224q-16 0 -16 16v96q0 16 16 16h112v240q0 16 16 16h96q16 0 16 -16zM1792 128v896h-1664v-896 h1664zM1920 1024v-896q0 -53 -37.5 -90.5t-90.5 -37.5h-1664q-53 0 -90.5 37.5t-37.5 90.5v896q0 53 37.5 90.5t90.5 37.5h1664q53 0 90.5 -37.5t37.5 -90.5z" />
290 <glyph unicode="&#xf11d;" horiz-adv-x="1792" d="M1664 491v616q-169 -91 -306 -91q-82 0 -145 32q-100 49 -184 76.5t-178 27.5q-173 0 -403 -127v-599q245 113 433 113q55 0 103.5 -7.5t98 -26t77 -31t82.5 -39.5l28 -14q44 -22 101 -22q120 0 293 92zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9 h-64q-14 0 -23 9t-9 23v1266q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102 q-15 -9 -33 -9q-16 0 -32 8q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
291 <glyph unicode="&#xf11e;" horiz-adv-x="1792" d="M832 536v192q-181 -16 -384 -117v-185q205 96 384 110zM832 954v197q-172 -8 -384 -126v-189q215 111 384 118zM1664 491v184q-235 -116 -384 -71v224q-20 6 -39 15q-5 3 -33 17t-34.5 17t-31.5 15t-34.5 15.5t-32.5 13t-36 12.5t-35 8.5t-39.5 7.5t-39.5 4t-44 2 q-23 0 -49 -3v-222h19q102 0 192.5 -29t197.5 -82q19 -9 39 -15v-188q42 -17 91 -17q120 0 293 92zM1664 918v189q-169 -91 -306 -91q-45 0 -78 8v-196q148 -42 384 90zM320 1280q0 -35 -17.5 -64t-46.5 -46v-1266q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v1266 q-29 17 -46.5 46t-17.5 64q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5zM1792 1216v-763q0 -39 -35 -57q-10 -5 -17 -9q-218 -116 -369 -116q-88 0 -158 35l-28 14q-64 33 -99 48t-91 29t-114 14q-102 0 -235.5 -44t-228.5 -102q-15 -9 -33 -9q-16 0 -32 8 q-32 19 -32 56v742q0 35 31 55q35 21 78.5 42.5t114 52t152.5 49.5t155 19q112 0 209 -31t209 -86q38 -19 89 -19q122 0 310 112q22 12 31 17q31 16 62 -2q31 -20 31 -55z" />
292 <glyph unicode="&#xf120;" horiz-adv-x="1664" d="M585 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23zM1664 96v-64q0 -14 -9 -23t-23 -9h-960q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h960q14 0 23 -9 t9 -23z" />
293 <glyph unicode="&#xf121;" horiz-adv-x="1920" d="M617 137l-50 -50q-10 -10 -23 -10t-23 10l-466 466q-10 10 -10 23t10 23l466 466q10 10 23 10t23 -10l50 -50q10 -10 10 -23t-10 -23l-393 -393l393 -393q10 -10 10 -23t-10 -23zM1208 1204l-373 -1291q-4 -13 -15.5 -19.5t-23.5 -2.5l-62 17q-13 4 -19.5 15.5t-2.5 24.5 l373 1291q4 13 15.5 19.5t23.5 2.5l62 -17q13 -4 19.5 -15.5t2.5 -24.5zM1865 553l-466 -466q-10 -10 -23 -10t-23 10l-50 50q-10 10 -10 23t10 23l393 393l-393 393q-10 10 -10 23t10 23l50 50q10 10 23 10t23 -10l466 -466q10 -10 10 -23t-10 -23z" />
294 <glyph unicode="&#xf122;" horiz-adv-x="1792" d="M640 454v-70q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-69l-397 -398q-19 -19 -19 -45t19 -45zM1792 416q0 -58 -17 -133.5t-38.5 -138t-48 -125t-40.5 -90.5l-20 -40q-8 -17 -28 -17q-6 0 -9 1 q-25 8 -23 34q43 400 -106 565q-64 71 -170.5 110.5t-267.5 52.5v-251q0 -42 -39 -59q-13 -5 -25 -5q-27 0 -45 19l-512 512q-19 19 -19 45t19 45l512 512q29 31 70 14q39 -17 39 -59v-262q411 -28 599 -221q169 -173 169 -509z" />
295 <glyph unicode="&#xf123;" horiz-adv-x="1664" d="M1186 579l257 250l-356 52l-66 10l-30 60l-159 322v-963l59 -31l318 -168l-60 355l-12 66zM1638 841l-363 -354l86 -500q5 -33 -6 -51.5t-34 -18.5q-17 0 -40 12l-449 236l-449 -236q-23 -12 -40 -12q-23 0 -34 18.5t-6 51.5l86 500l-364 354q-32 32 -23 59.5t54 34.5 l502 73l225 455q20 41 49 41q28 0 49 -41l225 -455l502 -73q45 -7 54 -34.5t-24 -59.5z" />
296 <glyph unicode="&#xf124;" horiz-adv-x="1408" d="M1401 1187l-640 -1280q-17 -35 -57 -35q-5 0 -15 2q-22 5 -35.5 22.5t-13.5 39.5v576h-576q-22 0 -39.5 13.5t-22.5 35.5t4 42t29 30l1280 640q13 7 29 7q27 0 45 -19q15 -14 18.5 -34.5t-6.5 -39.5z" />
297 <glyph unicode="&#xf125;" horiz-adv-x="1664" d="M557 256h595v595zM512 301l595 595h-595v-595zM1664 224v-192q0 -14 -9 -23t-23 -9h-224v-224q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v224h-864q-14 0 -23 9t-9 23v864h-224q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h224v224q0 14 9 23t23 9h192q14 0 23 -9t9 -23 v-224h851l246 247q10 9 23 9t23 -9q9 -10 9 -23t-9 -23l-247 -246v-851h224q14 0 23 -9t9 -23z" />
298 <glyph unicode="&#xf126;" horiz-adv-x="1024" d="M288 64q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM288 1216q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM928 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1024 1088q0 -52 -26 -96.5t-70 -69.5 q-2 -287 -226 -414q-68 -38 -203 -81q-128 -40 -169.5 -71t-41.5 -100v-26q44 -25 70 -69.5t26 -96.5q0 -80 -56 -136t-136 -56t-136 56t-56 136q0 52 26 96.5t70 69.5v820q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136q0 -52 -26 -96.5t-70 -69.5v-497 q54 26 154 57q55 17 87.5 29.5t70.5 31t59 39.5t40.5 51t28 69.5t8.5 91.5q-44 25 -70 69.5t-26 96.5q0 80 56 136t136 56t136 -56t56 -136z" />
299 <glyph unicode="&#xf127;" horiz-adv-x="1664" d="M439 265l-256 -256q-10 -9 -23 -9q-12 0 -23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23zM608 224v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM384 448q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9t-9 23t9 23t23 9h320 q14 0 23 -9t9 -23zM1648 320q0 -120 -85 -203l-147 -146q-83 -83 -203 -83q-121 0 -204 85l-334 335q-21 21 -42 56l239 18l273 -274q27 -27 68 -27.5t68 26.5l147 146q28 28 28 67q0 40 -28 68l-274 275l18 239q35 -21 56 -42l336 -336q84 -86 84 -204zM1031 1044l-239 -18 l-273 274q-28 28 -68 28q-39 0 -68 -27l-147 -146q-28 -28 -28 -67q0 -40 28 -68l274 -274l-18 -240q-35 21 -56 42l-336 336q-84 86 -84 204q0 120 85 203l147 146q83 83 203 83q121 0 204 -85l334 -335q21 -21 42 -56zM1664 960q0 -14 -9 -23t-23 -9h-320q-14 0 -23 9 t-9 23t9 23t23 9h320q14 0 23 -9t9 -23zM1120 1504v-320q0 -14 -9 -23t-23 -9t-23 9t-9 23v320q0 14 9 23t23 9t23 -9t9 -23zM1527 1353l-256 -256q-11 -9 -23 -9t-23 9q-9 10 -9 23t9 23l256 256q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
300 <glyph unicode="&#xf128;" horiz-adv-x="1024" d="M704 280v-240q0 -16 -12 -28t-28 -12h-240q-16 0 -28 12t-12 28v240q0 16 12 28t28 12h240q16 0 28 -12t12 -28zM1020 880q0 -54 -15.5 -101t-35 -76.5t-55 -59.5t-57.5 -43.5t-61 -35.5q-41 -23 -68.5 -65t-27.5 -67q0 -17 -12 -32.5t-28 -15.5h-240q-15 0 -25.5 18.5 t-10.5 37.5v45q0 83 65 156.5t143 108.5q59 27 84 56t25 76q0 42 -46.5 74t-107.5 32q-65 0 -108 -29q-35 -25 -107 -115q-13 -16 -31 -16q-12 0 -25 8l-164 125q-13 10 -15.5 25t5.5 28q160 266 464 266q80 0 161 -31t146 -83t106 -127.5t41 -158.5z" />
301 <glyph unicode="&#xf129;" horiz-adv-x="640" d="M640 192v-128q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h64v384h-64q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h384q26 0 45 -19t19 -45v-576h64q26 0 45 -19t19 -45zM512 1344v-192q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v192 q0 26 19 45t45 19h256q26 0 45 -19t19 -45z" />
302 <glyph unicode="&#xf12a;" horiz-adv-x="640" d="M512 288v-224q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v224q0 26 19 45t45 19h256q26 0 45 -19t19 -45zM542 1344l-28 -768q-1 -26 -20.5 -45t-45.5 -19h-256q-26 0 -45.5 19t-20.5 45l-28 768q-1 26 17.5 45t44.5 19h320q26 0 44.5 -19t17.5 -45z" />
303 <glyph unicode="&#xf12b;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1534 846v-206h-514l-3 27 q-4 28 -4 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q83 65 188 65q110 0 178 -59.5t68 -158.5q0 -56 -24.5 -103t-62 -76.5t-81.5 -58.5t-82 -50.5t-65.5 -51.5t-30.5 -63h232v80 h126z" />
304 <glyph unicode="&#xf12c;" d="M897 167v-167h-248l-159 252l-24 42q-8 9 -11 21h-3l-9 -21q-10 -20 -25 -44l-155 -250h-258v167h128l197 291l-185 272h-137v168h276l139 -228q2 -4 23 -42q8 -9 11 -21h3q3 9 11 21l25 42l140 228h257v-168h-125l-184 -267l204 -296h109zM1536 -50v-206h-514l-4 27 q-3 45 -3 46q0 64 26 117t65 86.5t84 65t84 54.5t65 54t26 64q0 38 -29.5 62.5t-70.5 24.5q-51 0 -97 -39q-14 -11 -36 -38l-105 92q26 37 63 66q80 65 188 65q110 0 178 -59.5t68 -158.5q0 -66 -34.5 -118.5t-84 -86t-99.5 -62.5t-87 -63t-41 -73h232v80h126z" />
305 <glyph unicode="&#xf12d;" horiz-adv-x="1920" d="M896 128l336 384h-768l-336 -384h768zM1909 1205q15 -34 9.5 -71.5t-30.5 -65.5l-896 -1024q-38 -44 -96 -44h-768q-38 0 -69.5 20.5t-47.5 54.5q-15 34 -9.5 71.5t30.5 65.5l896 1024q38 44 96 44h768q38 0 69.5 -20.5t47.5 -54.5z" />
306 <glyph unicode="&#xf12e;" horiz-adv-x="1664" d="M1664 438q0 -81 -44.5 -135t-123.5 -54q-41 0 -77.5 17.5t-59 38t-56.5 38t-71 17.5q-110 0 -110 -124q0 -39 16 -115t15 -115v-5q-22 0 -33 -1q-34 -3 -97.5 -11.5t-115.5 -13.5t-98 -5q-61 0 -103 26.5t-42 83.5q0 37 17.5 71t38 56.5t38 59t17.5 77.5q0 79 -54 123.5 t-135 44.5q-84 0 -143 -45.5t-59 -127.5q0 -43 15 -83t33.5 -64.5t33.5 -53t15 -50.5q0 -45 -46 -89q-37 -35 -117 -35q-95 0 -245 24q-9 2 -27.5 4t-27.5 4l-13 2q-1 0 -3 1q-2 0 -2 1v1024q2 -1 17.5 -3.5t34 -5t21.5 -3.5q150 -24 245 -24q80 0 117 35q46 44 46 89 q0 22 -15 50.5t-33.5 53t-33.5 64.5t-15 83q0 82 59 127.5t144 45.5q80 0 134 -44.5t54 -123.5q0 -41 -17.5 -77.5t-38 -59t-38 -56.5t-17.5 -71q0 -57 42 -83.5t103 -26.5q64 0 180 15t163 17v-2q-1 -2 -3.5 -17.5t-5 -34t-3.5 -21.5q-24 -150 -24 -245q0 -80 35 -117 q44 -46 89 -46q22 0 50.5 15t53 33.5t64.5 33.5t83 15q82 0 127.5 -59t45.5 -143z" />
307 <glyph unicode="&#xf130;" horiz-adv-x="1152" d="M1152 832v-128q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-217 24 -364.5 187.5t-147.5 384.5v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -185 131.5 -316.5t316.5 -131.5 t316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45zM896 1216v-512q0 -132 -94 -226t-226 -94t-226 94t-94 226v512q0 132 94 226t226 94t226 -94t94 -226z" />
308 <glyph unicode="&#xf131;" horiz-adv-x="1408" d="M271 591l-101 -101q-42 103 -42 214v128q0 26 19 45t45 19t45 -19t19 -45v-128q0 -53 15 -113zM1385 1193l-361 -361v-128q0 -132 -94 -226t-226 -94q-55 0 -109 19l-96 -96q97 -51 205 -51q185 0 316.5 131.5t131.5 316.5v128q0 26 19 45t45 19t45 -19t19 -45v-128 q0 -221 -147.5 -384.5t-364.5 -187.5v-132h256q26 0 45 -19t19 -45t-19 -45t-45 -19h-640q-26 0 -45 19t-19 45t19 45t45 19h256v132q-125 13 -235 81l-254 -254q-10 -10 -23 -10t-23 10l-82 82q-10 10 -10 23t10 23l1234 1234q10 10 23 10t23 -10l82 -82q10 -10 10 -23 t-10 -23zM1005 1325l-621 -621v512q0 132 94 226t226 94q102 0 184.5 -59t116.5 -152z" />
309 <glyph unicode="&#xf132;" horiz-adv-x="1280" d="M1088 576v640h-448v-1137q119 63 213 137q235 184 235 360zM1280 1344v-768q0 -86 -33.5 -170.5t-83 -150t-118 -127.5t-126.5 -103t-121 -77.5t-89.5 -49.5t-42.5 -20q-12 -6 -26 -6t-26 6q-16 7 -42.5 20t-89.5 49.5t-121 77.5t-126.5 103t-118 127.5t-83 150 t-33.5 170.5v768q0 26 19 45t45 19h1152q26 0 45 -19t19 -45z" />
310 <glyph unicode="&#xf133;" horiz-adv-x="1664" d="M128 -128h1408v1024h-1408v-1024zM512 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1280 1088v288q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-288q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1664 1152v-1280 q0 -52 -38 -90t-90 -38h-1408q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h128v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h384v96q0 66 47 113t113 47h64q66 0 113 -47t47 -113v-96h128q52 0 90 -38t38 -90z" />
311 <glyph unicode="&#xf134;" horiz-adv-x="1408" d="M512 1344q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1408 1376v-320q0 -16 -12 -25q-8 -7 -20 -7q-4 0 -7 1l-448 96q-11 2 -18 11t-7 20h-256v-102q111 -23 183.5 -111t72.5 -203v-800q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v800 q0 106 62.5 190.5t161.5 114.5v111h-32q-59 0 -115 -23.5t-91.5 -53t-66 -66.5t-40.5 -53.5t-14 -24.5q-17 -35 -57 -35q-16 0 -29 7q-23 12 -31.5 37t3.5 49q5 10 14.5 26t37.5 53.5t60.5 70t85 67t108.5 52.5q-25 42 -25 86q0 66 47 113t113 47t113 -47t47 -113 q0 -33 -14 -64h302q0 11 7 20t18 11l448 96q3 1 7 1q12 0 20 -7q12 -9 12 -25z" />
312 <glyph unicode="&#xf135;" horiz-adv-x="1664" d="M1440 1088q0 40 -28 68t-68 28t-68 -28t-28 -68t28 -68t68 -28t68 28t28 68zM1664 1376q0 -249 -75.5 -430.5t-253.5 -360.5q-81 -80 -195 -176l-20 -379q-2 -16 -16 -26l-384 -224q-7 -4 -16 -4q-12 0 -23 9l-64 64q-13 14 -8 32l85 276l-281 281l-276 -85q-3 -1 -9 -1 q-14 0 -23 9l-64 64q-17 19 -5 39l224 384q10 14 26 16l379 20q96 114 176 195q188 187 358 258t431 71q14 0 24 -9.5t10 -22.5z" />
313 <glyph unicode="&#xf136;" horiz-adv-x="1792" d="M1745 763l-164 -763h-334l178 832q13 56 -15 88q-27 33 -83 33h-169l-204 -953h-334l204 953h-286l-204 -953h-334l204 953l-153 327h1276q101 0 189.5 -40.5t147.5 -113.5q60 -73 81 -168.5t0 -194.5z" />
314 <glyph unicode="&#xf137;" d="M909 141l102 102q19 19 19 45t-19 45l-307 307l307 307q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
315 <glyph unicode="&#xf138;" d="M717 141l454 454q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l307 -307l-307 -307q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
316 <glyph unicode="&#xf139;" d="M1165 397l102 102q19 19 19 45t-19 45l-454 454q-19 19 -45 19t-45 -19l-454 -454q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l307 307l307 -307q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
317 <glyph unicode="&#xf13a;" d="M813 237l454 454q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-307 -307l-307 307q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l454 -454q19 -19 45 -19t45 19zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5 t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
318 <glyph unicode="&#xf13b;" horiz-adv-x="1408" d="M1130 939l16 175h-884l47 -534h612l-22 -228l-197 -53l-196 53l-13 140h-175l22 -278l362 -100h4v1l359 99l50 544h-644l-15 181h674zM0 1408h1408l-128 -1438l-578 -162l-574 162z" />
319 <glyph unicode="&#xf13c;" horiz-adv-x="1792" d="M275 1408h1505l-266 -1333l-804 -267l-698 267l71 356h297l-29 -147l422 -161l486 161l68 339h-1208l58 297h1209l38 191h-1208z" />
320 <glyph unicode="&#xf13d;" horiz-adv-x="1792" d="M960 1280q0 26 -19 45t-45 19t-45 -19t-19 -45t19 -45t45 -19t45 19t19 45zM1792 352v-352q0 -22 -20 -30q-8 -2 -12 -2q-13 0 -23 9l-93 93q-119 -143 -318.5 -226.5t-429.5 -83.5t-429.5 83.5t-318.5 226.5l-93 -93q-9 -9 -23 -9q-4 0 -12 2q-20 8 -20 30v352 q0 14 9 23t23 9h352q22 0 30 -20q8 -19 -7 -35l-100 -100q67 -91 189.5 -153.5t271.5 -82.5v647h-192q-26 0 -45 19t-19 45v128q0 26 19 45t45 19h192v163q-58 34 -93 92.5t-35 128.5q0 106 75 181t181 75t181 -75t75 -181q0 -70 -35 -128.5t-93 -92.5v-163h192q26 0 45 -19 t19 -45v-128q0 -26 -19 -45t-45 -19h-192v-647q149 20 271.5 82.5t189.5 153.5l-100 100q-15 16 -7 35q8 20 30 20h352q14 0 23 -9t9 -23z" />
321 <glyph unicode="&#xf13e;" horiz-adv-x="1152" d="M1056 768q40 0 68 -28t28 -68v-576q0 -40 -28 -68t-68 -28h-960q-40 0 -68 28t-28 68v576q0 40 28 68t68 28h32v320q0 185 131.5 316.5t316.5 131.5t316.5 -131.5t131.5 -316.5q0 -26 -19 -45t-45 -19h-64q-26 0 -45 19t-19 45q0 106 -75 181t-181 75t-181 -75t-75 -181 v-320h736z" />
322 <glyph unicode="&#xf140;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM1152 640q0 159 -112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5zM1280 640q0 -212 -150 -362t-362 -150t-362 150 t-150 362t150 362t362 150t362 -150t150 -362zM1408 640q0 130 -51 248.5t-136.5 204t-204 136.5t-248.5 51t-248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5zM1536 640 q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
323 <glyph unicode="&#xf141;" horiz-adv-x="1408" d="M384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM896 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM1408 800v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
324 <glyph unicode="&#xf142;" horiz-adv-x="384" d="M384 288v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 800v-192q0 -40 -28 -68t-68 -28h-192q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68zM384 1312v-192q0 -40 -28 -68t-68 -28h-192 q-40 0 -68 28t-28 68v192q0 40 28 68t68 28h192q40 0 68 -28t28 -68z" />
325 <glyph unicode="&#xf143;" d="M512 256q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM863 162q-13 232 -177 396t-396 177q-14 1 -24 -9t-10 -23v-128q0 -13 8.5 -22t21.5 -10q154 -11 264 -121t121 -264q1 -13 10 -21.5t22 -8.5h128q13 0 23 10 t9 24zM1247 161q-5 154 -56 297.5t-139.5 260t-205 205t-260 139.5t-297.5 56q-14 1 -23 -9q-10 -10 -10 -23v-128q0 -13 9 -22t22 -10q204 -7 378 -111.5t278.5 -278.5t111.5 -378q1 -13 10 -22t22 -9h128q13 0 23 10q11 9 9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
326 <glyph unicode="&#xf144;" d="M768 1408q209 0 385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103zM1152 585q32 18 32 55t-32 55l-544 320q-31 19 -64 1q-32 -19 -32 -56v-640q0 -37 32 -56 q16 -8 32 -8q17 0 32 9z" />
327 <glyph unicode="&#xf145;" horiz-adv-x="1792" d="M1024 1084l316 -316l-572 -572l-316 316zM813 105l618 618q19 19 19 45t-19 45l-362 362q-18 18 -45 18t-45 -18l-618 -618q-19 -19 -19 -45t19 -45l362 -362q18 -18 45 -18t45 18zM1702 742l-907 -908q-37 -37 -90.5 -37t-90.5 37l-126 126q56 56 56 136t-56 136 t-136 56t-136 -56l-125 126q-37 37 -37 90.5t37 90.5l907 906q37 37 90.5 37t90.5 -37l125 -125q-56 -56 -56 -136t56 -136t136 -56t136 56l126 -125q37 -37 37 -90.5t-37 -90.5z" />
328 <glyph unicode="&#xf146;" d="M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
329 <glyph unicode="&#xf147;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h832q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5 t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
330 <glyph unicode="&#xf148;" horiz-adv-x="1024" d="M1018 933q-18 -37 -58 -37h-192v-864q0 -14 -9 -23t-23 -9h-704q-21 0 -29 18q-8 20 4 35l160 192q9 11 25 11h320v640h-192q-40 0 -58 37q-17 37 9 68l320 384q18 22 49 22t49 -22l320 -384q27 -32 9 -68z" />
331 <glyph unicode="&#xf149;" horiz-adv-x="1024" d="M32 1280h704q13 0 22.5 -9.5t9.5 -23.5v-863h192q40 0 58 -37t-9 -69l-320 -384q-18 -22 -49 -22t-49 22l-320 384q-26 31 -9 69q18 37 58 37h192v640h-320q-14 0 -25 11l-160 192q-13 14 -4 34q9 19 29 19z" />
332 <glyph unicode="&#xf14a;" d="M685 237l614 614q19 19 19 45t-19 45l-102 102q-19 19 -45 19t-45 -19l-467 -467l-211 211q-19 19 -45 19t-45 -19l-102 -102q-19 -19 -19 -45t19 -45l358 -358q19 -19 45 -19t45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5 t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
333 <glyph unicode="&#xf14b;" d="M404 428l152 -152l-52 -52h-56v96h-96v56zM818 818q14 -13 -3 -30l-291 -291q-17 -17 -30 -3q-14 13 3 30l291 291q17 17 30 3zM544 128l544 544l-288 288l-544 -544v-288h288zM1152 736l92 92q28 28 28 68t-28 68l-152 152q-28 28 -68 28t-68 -28l-92 -92zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
334 <glyph unicode="&#xf14c;" d="M1280 608v480q0 26 -19 45t-45 19h-480q-42 0 -59 -39q-17 -41 14 -70l144 -144l-534 -534q-19 -19 -19 -45t19 -45l102 -102q19 -19 45 -19t45 19l534 534l144 -144q18 -19 45 -19q12 0 25 5q39 17 39 59zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
335 <glyph unicode="&#xf14d;" d="M1005 435l352 352q19 19 19 45t-19 45l-352 352q-30 31 -69 14q-40 -17 -40 -59v-160q-119 0 -216 -19.5t-162.5 -51t-114 -79t-76.5 -95.5t-44.5 -109t-21.5 -111.5t-5 -110.5q0 -181 167 -404q10 -12 25 -12q7 0 13 3q22 9 19 33q-44 354 62 473q46 52 130 75.5 t224 23.5v-160q0 -42 40 -59q12 -5 24 -5q26 0 45 19zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
336 <glyph unicode="&#xf14e;" d="M640 448l256 128l-256 128v-256zM1024 1039v-542l-512 -256v542zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
337 <glyph unicode="&#xf150;" d="M1145 861q18 -35 -5 -66l-320 -448q-19 -27 -52 -27t-52 27l-320 448q-23 31 -5 66q17 35 57 35h640q40 0 57 -35zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
338 <glyph unicode="&#xf151;" d="M1145 419q-17 -35 -57 -35h-640q-40 0 -57 35q-18 35 5 66l320 448q19 27 52 27t52 -27l320 -448q23 -31 5 -66zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
339 <glyph unicode="&#xf152;" d="M1088 640q0 -33 -27 -52l-448 -320q-31 -23 -66 -5q-35 17 -35 57v640q0 40 35 57q35 18 66 -5l448 -320q27 -19 27 -52zM1280 160v960q0 14 -9 23t-23 9h-960q-14 0 -23 -9t-9 -23v-960q0 -14 9 -23t23 -9h960q14 0 23 9t9 23zM1536 1120v-960q0 -119 -84.5 -203.5 t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
340 <glyph unicode="&#xf153;" horiz-adv-x="1024" d="M976 229l35 -159q3 -12 -3 -22.5t-17 -14.5l-5 -1q-4 -2 -10.5 -3.5t-16 -4.5t-21.5 -5.5t-25.5 -5t-30 -5t-33.5 -4.5t-36.5 -3t-38.5 -1q-234 0 -409 130.5t-238 351.5h-95q-13 0 -22.5 9.5t-9.5 22.5v113q0 13 9.5 22.5t22.5 9.5h66q-2 57 1 105h-67q-14 0 -23 9 t-9 23v114q0 14 9 23t23 9h98q67 210 243.5 338t400.5 128q102 0 194 -23q11 -3 20 -15q6 -11 3 -24l-43 -159q-3 -13 -14 -19.5t-24 -2.5l-4 1q-4 1 -11.5 2.5l-17.5 3.5t-22.5 3.5t-26 3t-29 2.5t-29.5 1q-126 0 -226 -64t-150 -176h468q16 0 25 -12q10 -12 7 -26 l-24 -114q-5 -26 -32 -26h-488q-3 -37 0 -105h459q15 0 25 -12q9 -12 6 -27l-24 -112q-2 -11 -11 -18.5t-20 -7.5h-387q48 -117 149.5 -185.5t228.5 -68.5q18 0 36 1.5t33.5 3.5t29.5 4.5t24.5 5t18.5 4.5l12 3l5 2q13 5 26 -2q12 -7 15 -21z" />
341 <glyph unicode="&#xf154;" horiz-adv-x="1024" d="M1020 399v-367q0 -14 -9 -23t-23 -9h-956q-14 0 -23 9t-9 23v150q0 13 9.5 22.5t22.5 9.5h97v383h-95q-14 0 -23 9.5t-9 22.5v131q0 14 9 23t23 9h95v223q0 171 123.5 282t314.5 111q185 0 335 -125q9 -8 10 -20.5t-7 -22.5l-103 -127q-9 -11 -22 -12q-13 -2 -23 7 q-5 5 -26 19t-69 32t-93 18q-85 0 -137 -47t-52 -123v-215h305q13 0 22.5 -9t9.5 -23v-131q0 -13 -9.5 -22.5t-22.5 -9.5h-305v-379h414v181q0 13 9 22.5t23 9.5h162q14 0 23 -9.5t9 -22.5z" />
342 <glyph unicode="&#xf155;" horiz-adv-x="1024" d="M978 351q0 -153 -99.5 -263.5t-258.5 -136.5v-175q0 -14 -9 -23t-23 -9h-135q-13 0 -22.5 9.5t-9.5 22.5v175q-66 9 -127.5 31t-101.5 44.5t-74 48t-46.5 37.5t-17.5 18q-17 21 -2 41l103 135q7 10 23 12q15 2 24 -9l2 -2q113 -99 243 -125q37 -8 74 -8q81 0 142.5 43 t61.5 122q0 28 -15 53t-33.5 42t-58.5 37.5t-66 32t-80 32.5q-39 16 -61.5 25t-61.5 26.5t-62.5 31t-56.5 35.5t-53.5 42.5t-43.5 49t-35.5 58t-21 66.5t-8.5 78q0 138 98 242t255 134v180q0 13 9.5 22.5t22.5 9.5h135q14 0 23 -9t9 -23v-176q57 -6 110.5 -23t87 -33.5 t63.5 -37.5t39 -29t15 -14q17 -18 5 -38l-81 -146q-8 -15 -23 -16q-14 -3 -27 7q-3 3 -14.5 12t-39 26.5t-58.5 32t-74.5 26t-85.5 11.5q-95 0 -155 -43t-60 -111q0 -26 8.5 -48t29.5 -41.5t39.5 -33t56 -31t60.5 -27t70 -27.5q53 -20 81 -31.5t76 -35t75.5 -42.5t62 -50 t53 -63.5t31.5 -76.5t13 -94z" />
343 <glyph unicode="&#xf156;" horiz-adv-x="898" d="M898 1066v-102q0 -14 -9 -23t-23 -9h-168q-23 -144 -129 -234t-276 -110q167 -178 459 -536q14 -16 4 -34q-8 -18 -29 -18h-195q-16 0 -25 12q-306 367 -498 571q-9 9 -9 22v127q0 13 9.5 22.5t22.5 9.5h112q132 0 212.5 43t102.5 125h-427q-14 0 -23 9t-9 23v102 q0 14 9 23t23 9h413q-57 113 -268 113h-145q-13 0 -22.5 9.5t-9.5 22.5v133q0 14 9 23t23 9h832q14 0 23 -9t9 -23v-102q0 -14 -9 -23t-23 -9h-233q47 -61 64 -144h171q14 0 23 -9t9 -23z" />
344 <glyph unicode="&#xf157;" horiz-adv-x="1027" d="M603 0h-172q-13 0 -22.5 9t-9.5 23v330h-288q-13 0 -22.5 9t-9.5 23v103q0 13 9.5 22.5t22.5 9.5h288v85h-288q-13 0 -22.5 9t-9.5 23v104q0 13 9.5 22.5t22.5 9.5h214l-321 578q-8 16 0 32q10 16 28 16h194q19 0 29 -18l215 -425q19 -38 56 -125q10 24 30.5 68t27.5 61 l191 420q8 19 29 19h191q17 0 27 -16q9 -14 1 -31l-313 -579h215q13 0 22.5 -9.5t9.5 -22.5v-104q0 -14 -9.5 -23t-22.5 -9h-290v-85h290q13 0 22.5 -9.5t9.5 -22.5v-103q0 -14 -9.5 -23t-22.5 -9h-290v-330q0 -13 -9.5 -22.5t-22.5 -9.5z" />
345 <glyph unicode="&#xf158;" horiz-adv-x="1280" d="M1043 971q0 100 -65 162t-171 62h-320v-448h320q106 0 171 62t65 162zM1280 971q0 -193 -126.5 -315t-326.5 -122h-340v-118h505q14 0 23 -9t9 -23v-128q0 -14 -9 -23t-23 -9h-505v-192q0 -14 -9.5 -23t-22.5 -9h-167q-14 0 -23 9t-9 23v192h-224q-14 0 -23 9t-9 23v128 q0 14 9 23t23 9h224v118h-224q-14 0 -23 9t-9 23v149q0 13 9 22.5t23 9.5h224v629q0 14 9 23t23 9h539q200 0 326.5 -122t126.5 -315z" />
346 <glyph unicode="&#xf159;" horiz-adv-x="1792" d="M514 341l81 299h-159l75 -300q1 -1 1 -3t1 -3q0 1 0.5 3.5t0.5 3.5zM630 768l35 128h-292l32 -128h225zM822 768h139l-35 128h-70zM1271 340l78 300h-162l81 -299q0 -1 0.5 -3.5t1.5 -3.5q0 1 0.5 3t0.5 3zM1382 768l33 128h-297l34 -128h230zM1792 736v-64q0 -14 -9 -23 t-23 -9h-213l-164 -616q-7 -24 -31 -24h-159q-24 0 -31 24l-166 616h-209l-167 -616q-7 -24 -31 -24h-159q-11 0 -19.5 7t-10.5 17l-160 616h-208q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h175l-33 128h-142q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h109l-89 344q-5 15 5 28 q10 12 26 12h137q26 0 31 -24l90 -360h359l97 360q7 24 31 24h126q24 0 31 -24l98 -360h365l93 360q5 24 31 24h137q16 0 26 -12q10 -13 5 -28l-91 -344h111q14 0 23 -9t9 -23v-64q0 -14 -9 -23t-23 -9h-145l-34 -128h179q14 0 23 -9t9 -23z" />
347 <glyph unicode="&#xf15a;" horiz-adv-x="1280" d="M1167 896q18 -182 -131 -258q117 -28 175 -103t45 -214q-7 -71 -32.5 -125t-64.5 -89t-97 -58.5t-121.5 -34.5t-145.5 -15v-255h-154v251q-80 0 -122 1v-252h-154v255q-18 0 -54 0.5t-55 0.5h-200l31 183h111q50 0 58 51v402h16q-6 1 -16 1v287q-13 68 -89 68h-111v164 l212 -1q64 0 97 1v252h154v-247q82 2 122 2v245h154v-252q79 -7 140 -22.5t113 -45t82.5 -78t36.5 -114.5zM952 351q0 36 -15 64t-37 46t-57.5 30.5t-65.5 18.5t-74 9t-69 3t-64.5 -1t-47.5 -1v-338q8 0 37 -0.5t48 -0.5t53 1.5t58.5 4t57 8.5t55.5 14t47.5 21t39.5 30 t24.5 40t9.5 51zM881 827q0 33 -12.5 58.5t-30.5 42t-48 28t-55 16.5t-61.5 8t-58 2.5t-54 -1t-39.5 -0.5v-307q5 0 34.5 -0.5t46.5 0t50 2t55 5.5t51.5 11t48.5 18.5t37 27t27 38.5t9 51z" />
348 <glyph unicode="&#xf15b;" d="M1024 1024v472q22 -14 36 -28l408 -408q14 -14 28 -36h-472zM896 992q0 -40 28 -68t68 -28h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544z" />
349 <glyph unicode="&#xf15c;" d="M1468 1060q14 -14 28 -36h-472v472q22 -14 36 -28zM992 896h544v-1056q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h800v-544q0 -40 28 -68t68 -28zM1152 160v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-704q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h704q14 0 23 9t9 23z" />
350 <glyph unicode="&#xf15d;" horiz-adv-x="1664" d="M1191 1128h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1572 -23 v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -11v-2l14 2q9 2 30 2h248v119h121zM1661 874v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162 l230 -662h70z" />
351 <glyph unicode="&#xf15e;" horiz-adv-x="1664" d="M1191 104h177l-72 218l-12 47q-2 16 -2 20h-4l-3 -20q0 -1 -3.5 -18t-7.5 -29zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1661 -150 v-106h-288v106h75l-47 144h-243l-47 -144h75v-106h-287v106h70l230 662h162l230 -662h70zM1572 1001v-233h-584v90l369 529q12 18 21 27l11 9v3q-2 0 -6.5 -0.5t-7.5 -0.5q-12 -3 -30 -3h-232v-115h-120v229h567v-89l-369 -530q-6 -8 -21 -26l-11 -10v-3l14 3q9 1 30 1h248 v119h121z" />
352 <glyph unicode="&#xf160;" horiz-adv-x="1792" d="M736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23zM1792 -32v-192q0 -14 -9 -23t-23 -9h-832q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832 q14 0 23 -9t9 -23zM1600 480v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1408 992v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1216 1504v-192q0 -14 -9 -23t-23 -9h-256 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23z" />
353 <glyph unicode="&#xf161;" horiz-adv-x="1792" d="M1216 -32v-192q0 -14 -9 -23t-23 -9h-256q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h256q14 0 23 -9t9 -23zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192 q14 0 23 -9t9 -23zM1408 480v-192q0 -14 -9 -23t-23 -9h-448q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h448q14 0 23 -9t9 -23zM1600 992v-192q0 -14 -9 -23t-23 -9h-640q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h640q14 0 23 -9t9 -23zM1792 1504v-192q0 -14 -9 -23t-23 -9h-832 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h832q14 0 23 -9t9 -23z" />
354 <glyph unicode="&#xf162;" d="M1346 223q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9t9 -23 zM1486 165q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5 t82 -252.5zM1456 882v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165z" />
355 <glyph unicode="&#xf163;" d="M1346 1247q0 63 -44 116t-103 53q-52 0 -83 -37t-31 -94t36.5 -95t104.5 -38q50 0 85 27t35 68zM736 96q0 -12 -10 -24l-319 -319q-10 -9 -23 -9q-12 0 -23 9l-320 320q-15 16 -7 35q8 20 30 20h192v1376q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1376h192q14 0 23 -9 t9 -23zM1456 -142v-114h-469v114h167v432q0 7 0.5 19t0.5 17v16h-2l-7 -12q-8 -13 -26 -31l-62 -58l-82 86l192 185h123v-654h165zM1486 1189q0 -62 -13 -121.5t-41 -114t-68 -95.5t-98.5 -65.5t-127.5 -24.5q-62 0 -108 16q-24 8 -42 15l39 113q15 -7 31 -11q37 -13 75 -13 q84 0 134.5 58.5t66.5 145.5h-2q-21 -23 -61.5 -37t-84.5 -14q-106 0 -173 71.5t-67 172.5q0 105 72 178t181 73q123 0 205 -94.5t82 -252.5z" />
356 <glyph unicode="&#xf164;" horiz-adv-x="1664" d="M256 192q0 26 -19 45t-45 19q-27 0 -45.5 -19t-18.5 -45q0 -27 18.5 -45.5t45.5 -18.5q26 0 45 18.5t19 45.5zM416 704v-640q0 -26 -19 -45t-45 -19h-288q-26 0 -45 19t-19 45v640q0 26 19 45t45 19h288q26 0 45 -19t19 -45zM1600 704q0 -86 -55 -149q15 -44 15 -76 q3 -76 -43 -137q17 -56 0 -117q-15 -57 -54 -94q9 -112 -49 -181q-64 -76 -197 -78h-36h-76h-17q-66 0 -144 15.5t-121.5 29t-120.5 39.5q-123 43 -158 44q-26 1 -45 19.5t-19 44.5v641q0 25 18 43.5t43 20.5q24 2 76 59t101 121q68 87 101 120q18 18 31 48t17.5 48.5 t13.5 60.5q7 39 12.5 61t19.5 52t34 50q19 19 45 19q46 0 82.5 -10.5t60 -26t40 -40.5t24 -45t12 -50t5 -45t0.5 -39q0 -38 -9.5 -76t-19 -60t-27.5 -56q-3 -6 -10 -18t-11 -22t-8 -24h277q78 0 135 -57t57 -135z" />
357 <glyph unicode="&#xf165;" horiz-adv-x="1664" d="M256 960q0 -26 -19 -45t-45 -19q-27 0 -45.5 19t-18.5 45q0 27 18.5 45.5t45.5 18.5q26 0 45 -18.5t19 -45.5zM416 448v640q0 26 -19 45t-45 19h-288q-26 0 -45 -19t-19 -45v-640q0 -26 19 -45t45 -19h288q26 0 45 19t19 45zM1545 597q55 -61 55 -149q-1 -78 -57.5 -135 t-134.5 -57h-277q4 -14 8 -24t11 -22t10 -18q18 -37 27 -57t19 -58.5t10 -76.5q0 -24 -0.5 -39t-5 -45t-12 -50t-24 -45t-40 -40.5t-60 -26t-82.5 -10.5q-26 0 -45 19q-20 20 -34 50t-19.5 52t-12.5 61q-9 42 -13.5 60.5t-17.5 48.5t-31 48q-33 33 -101 120q-49 64 -101 121 t-76 59q-25 2 -43 20.5t-18 43.5v641q0 26 19 44.5t45 19.5q35 1 158 44q77 26 120.5 39.5t121.5 29t144 15.5h17h76h36q133 -2 197 -78q58 -69 49 -181q39 -37 54 -94q17 -61 0 -117q46 -61 43 -137q0 -32 -15 -76z" />
358 <glyph unicode="&#xf166;" d="M919 233v157q0 50 -29 50q-17 0 -33 -16v-224q16 -16 33 -16q29 0 29 49zM1103 355h66v34q0 51 -33 51t-33 -51v-34zM532 621v-70h-80v-423h-74v423h-78v70h232zM733 495v-367h-67v40q-39 -45 -76 -45q-33 0 -42 28q-6 16 -6 54v290h66v-270q0 -24 1 -26q1 -15 15 -15 q20 0 42 31v280h67zM985 384v-146q0 -52 -7 -73q-12 -42 -53 -42q-35 0 -68 41v-36h-67v493h67v-161q32 40 68 40q41 0 53 -42q7 -21 7 -74zM1236 255v-9q0 -29 -2 -43q-3 -22 -15 -40q-27 -40 -80 -40q-52 0 -81 38q-21 27 -21 86v129q0 59 20 86q29 38 80 38t78 -38 q21 -28 21 -86v-76h-133v-65q0 -51 34 -51q24 0 30 26q0 1 0.5 7t0.5 16.5v21.5h68zM785 1079v-156q0 -51 -32 -51t-32 51v156q0 52 32 52t32 -52zM1318 366q0 177 -19 260q-10 44 -43 73.5t-76 34.5q-136 15 -412 15q-275 0 -411 -15q-44 -5 -76.5 -34.5t-42.5 -73.5 q-20 -87 -20 -260q0 -176 20 -260q10 -43 42.5 -73t75.5 -35q137 -15 412 -15t412 15q43 5 75.5 35t42.5 73q20 84 20 260zM563 1017l90 296h-75l-51 -195l-53 195h-78l24 -69t23 -69q35 -103 46 -158v-201h74v201zM852 936v130q0 58 -21 87q-29 38 -78 38q-51 0 -78 -38 q-21 -29 -21 -87v-130q0 -58 21 -87q27 -38 78 -38q49 0 78 38q21 27 21 87zM1033 816h67v370h-67v-283q-22 -31 -42 -31q-15 0 -16 16q-1 2 -1 26v272h-67v-293q0 -37 6 -55q11 -27 43 -27q36 0 77 45v-40zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960 q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
359 <glyph unicode="&#xf167;" d="M971 292v-211q0 -67 -39 -67q-23 0 -45 22v301q22 22 45 22q39 0 39 -67zM1309 291v-46h-90v46q0 68 45 68t45 -68zM343 509h107v94h-312v-94h105v-569h100v569zM631 -60h89v494h-89v-378q-30 -42 -57 -42q-18 0 -21 21q-1 3 -1 35v364h-89v-391q0 -49 8 -73 q12 -37 58 -37q48 0 102 61v-54zM1060 88v197q0 73 -9 99q-17 56 -71 56q-50 0 -93 -54v217h-89v-663h89v48q45 -55 93 -55q54 0 71 55q9 27 9 100zM1398 98v13h-91q0 -51 -2 -61q-7 -36 -40 -36q-46 0 -46 69v87h179v103q0 79 -27 116q-39 51 -106 51q-68 0 -107 -51 q-28 -37 -28 -116v-173q0 -79 29 -116q39 -51 108 -51q72 0 108 53q18 27 21 54q2 9 2 58zM790 1011v210q0 69 -43 69t-43 -69v-210q0 -70 43 -70t43 70zM1509 260q0 -234 -26 -350q-14 -59 -58 -99t-102 -46q-184 -21 -555 -21t-555 21q-58 6 -102.5 46t-57.5 99 q-26 112 -26 350q0 234 26 350q14 59 58 99t103 47q183 20 554 20t555 -20q58 -7 102.5 -47t57.5 -99q26 -112 26 -350zM511 1536h102l-121 -399v-271h-100v271q-14 74 -61 212q-37 103 -65 187h106l71 -263zM881 1203v-175q0 -81 -28 -118q-37 -51 -106 -51q-67 0 -105 51 q-28 38 -28 118v175q0 80 28 117q38 51 105 51q69 0 106 -51q28 -37 28 -117zM1216 1365v-499h-91v55q-53 -62 -103 -62q-46 0 -59 37q-8 24 -8 75v394h91v-367q0 -33 1 -35q3 -22 21 -22q27 0 57 43v381h91z" />
360 <glyph unicode="&#xf168;" horiz-adv-x="1408" d="M597 869q-10 -18 -257 -456q-27 -46 -65 -46h-239q-21 0 -31 17t0 36l253 448q1 0 0 1l-161 279q-12 22 -1 37q9 15 32 15h239q40 0 66 -45zM1403 1511q11 -16 0 -37l-528 -934v-1l336 -615q11 -20 1 -37q-10 -15 -32 -15h-239q-42 0 -66 45l-339 622q18 32 531 942 q25 45 64 45h241q22 0 31 -15z" />
361 <glyph unicode="&#xf169;" d="M685 771q0 1 -126 222q-21 34 -52 34h-184q-18 0 -26 -11q-7 -12 1 -29l125 -216v-1l-196 -346q-9 -14 0 -28q8 -13 24 -13h185q31 0 50 36zM1309 1268q-7 12 -24 12h-187q-30 0 -49 -35l-411 -729q1 -2 262 -481q20 -35 52 -35h184q18 0 25 12q8 13 -1 28l-260 476v1 l409 723q8 16 0 28zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
362 <glyph unicode="&#xf16a;" horiz-adv-x="1792" d="M1280 640q0 37 -30 54l-512 320q-31 20 -65 2q-33 -18 -33 -56v-640q0 -38 33 -56q16 -8 31 -8q20 0 34 10l512 320q30 17 30 54zM1792 640q0 -96 -1 -150t-8.5 -136.5t-22.5 -147.5q-16 -73 -69 -123t-124 -58q-222 -25 -671 -25t-671 25q-71 8 -124.5 58t-69.5 123 q-14 65 -21.5 147.5t-8.5 136.5t-1 150t1 150t8.5 136.5t22.5 147.5q16 73 69 123t124 58q222 25 671 25t671 -25q71 -8 124.5 -58t69.5 -123q14 -65 21.5 -147.5t8.5 -136.5t1 -150z" />
363 <glyph unicode="&#xf16b;" horiz-adv-x="1792" d="M402 829l494 -305l-342 -285l-490 319zM1388 274v-108l-490 -293v-1l-1 1l-1 -1v1l-489 293v108l147 -96l342 284v2l1 -1l1 1v-2l343 -284zM554 1418l342 -285l-494 -304l-338 270zM1390 829l338 -271l-489 -319l-343 285zM1239 1418l489 -319l-338 -270l-494 304z" />
364 <glyph unicode="&#xf16c;" horiz-adv-x="1408" d="M928 135v-151l-707 -1v151zM1169 481v-701l-1 -35v-1h-1132l-35 1h-1v736h121v-618h928v618h120zM241 393l704 -65l-13 -150l-705 65zM309 709l683 -183l-39 -146l-683 183zM472 1058l609 -360l-77 -130l-609 360zM832 1389l398 -585l-124 -85l-399 584zM1285 1536 l121 -697l-149 -26l-121 697z" />
365 <glyph unicode="&#xf16d;" d="M1362 110v648h-135q20 -63 20 -131q0 -126 -64 -232.5t-174 -168.5t-240 -62q-197 0 -337 135.5t-140 327.5q0 68 20 131h-141v-648q0 -26 17.5 -43.5t43.5 -17.5h1069q25 0 43 17.5t18 43.5zM1078 643q0 124 -90.5 211.5t-218.5 87.5q-127 0 -217.5 -87.5t-90.5 -211.5 t90.5 -211.5t217.5 -87.5q128 0 218.5 87.5t90.5 211.5zM1362 1003v165q0 28 -20 48.5t-49 20.5h-174q-29 0 -49 -20.5t-20 -48.5v-165q0 -29 20 -49t49 -20h174q29 0 49 20t20 49zM1536 1211v-1142q0 -81 -58 -139t-139 -58h-1142q-81 0 -139 58t-58 139v1142q0 81 58 139 t139 58h1142q81 0 139 -58t58 -139z" />
366 <glyph unicode="&#xf16e;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM698 640q0 88 -62 150t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150zM1262 640q0 88 -62 150 t-150 62t-150 -62t-62 -150t62 -150t150 -62t150 62t62 150z" />
367 <glyph unicode="&#xf170;" d="M768 914l201 -306h-402zM1133 384h94l-459 691l-459 -691h94l104 160h522zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
368 <glyph unicode="&#xf171;" horiz-adv-x="1408" d="M815 677q8 -63 -50.5 -101t-111.5 -6q-39 17 -53.5 58t-0.5 82t52 58q36 18 72.5 12t64 -35.5t27.5 -67.5zM926 698q-14 107 -113 164t-197 13q-63 -28 -100.5 -88.5t-34.5 -129.5q4 -91 77.5 -155t165.5 -56q91 8 152 84t50 168zM1165 1240q-20 27 -56 44.5t-58 22 t-71 12.5q-291 47 -566 -2q-43 -7 -66 -12t-55 -22t-50 -43q30 -28 76 -45.5t73.5 -22t87.5 -11.5q228 -29 448 -1q63 8 89.5 12t72.5 21.5t75 46.5zM1222 205q-8 -26 -15.5 -76.5t-14 -84t-28.5 -70t-58 -56.5q-86 -48 -189.5 -71.5t-202 -22t-201.5 18.5q-46 8 -81.5 18 t-76.5 27t-73 43.5t-52 61.5q-25 96 -57 292l6 16l18 9q223 -148 506.5 -148t507.5 148q21 -6 24 -23t-5 -45t-8 -37zM1403 1166q-26 -167 -111 -655q-5 -30 -27 -56t-43.5 -40t-54.5 -31q-252 -126 -610 -88q-248 27 -394 139q-15 12 -25.5 26.5t-17 35t-9 34t-6 39.5 t-5.5 35q-9 50 -26.5 150t-28 161.5t-23.5 147.5t-22 158q3 26 17.5 48.5t31.5 37.5t45 30t46 22.5t48 18.5q125 46 313 64q379 37 676 -50q155 -46 215 -122q16 -20 16.5 -51t-5.5 -54z" />
369 <glyph unicode="&#xf172;" d="M848 666q0 43 -41 66t-77 1q-43 -20 -42.5 -72.5t43.5 -70.5q39 -23 81 4t36 72zM928 682q8 -66 -36 -121t-110 -61t-119 40t-56 113q-2 49 25.5 93t72.5 64q70 31 141.5 -10t81.5 -118zM1100 1073q-20 -21 -53.5 -34t-53 -16t-63.5 -8q-155 -20 -324 0q-44 6 -63 9.5 t-52.5 16t-54.5 32.5q13 19 36 31t40 15.5t47 8.5q198 35 408 1q33 -5 51 -8.5t43 -16t39 -31.5zM1142 327q0 7 5.5 26.5t3 32t-17.5 16.5q-161 -106 -365 -106t-366 106l-12 -6l-5 -12q26 -154 41 -210q47 -81 204 -108q249 -46 428 53q34 19 49 51.5t22.5 85.5t12.5 71z M1272 1020q9 53 -8 75q-43 55 -155 88q-216 63 -487 36q-132 -12 -226 -46q-38 -15 -59.5 -25t-47 -34t-29.5 -54q8 -68 19 -138t29 -171t24 -137q1 -5 5 -31t7 -36t12 -27t22 -28q105 -80 284 -100q259 -28 440 63q24 13 39.5 23t31 29t19.5 40q48 267 80 473zM1536 1120 v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
370 <glyph unicode="&#xf173;" horiz-adv-x="1024" d="M944 207l80 -237q-23 -35 -111 -66t-177 -32q-104 -2 -190.5 26t-142.5 74t-95 106t-55.5 120t-16.5 118v544h-168v215q72 26 129 69.5t91 90t58 102t34 99t15 88.5q1 5 4.5 8.5t7.5 3.5h244v-424h333v-252h-334v-518q0 -30 6.5 -56t22.5 -52.5t49.5 -41.5t81.5 -14 q78 2 134 29z" />
371 <glyph unicode="&#xf174;" d="M1136 75l-62 183q-44 -22 -103 -22q-36 -1 -62 10.5t-38.5 31.5t-17.5 40.5t-5 43.5v398h257v194h-256v326h-188q-8 0 -9 -10q-5 -44 -17.5 -87t-39 -95t-77 -95t-118.5 -68v-165h130v-418q0 -57 21.5 -115t65 -111t121 -85.5t176.5 -30.5q69 1 136.5 25t85.5 50z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
372 <glyph unicode="&#xf175;" horiz-adv-x="768" d="M765 237q8 -19 -5 -35l-350 -384q-10 -10 -23 -10q-14 0 -24 10l-355 384q-13 16 -5 35q9 19 29 19h224v1248q0 14 9 23t23 9h192q14 0 23 -9t9 -23v-1248h224q21 0 29 -19z" />
373 <glyph unicode="&#xf176;" horiz-adv-x="768" d="M765 1043q-9 -19 -29 -19h-224v-1248q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v1248h-224q-21 0 -29 19t5 35l350 384q10 10 23 10q14 0 24 -10l355 -384q13 -16 5 -35z" />
374 <glyph unicode="&#xf177;" horiz-adv-x="1792" d="M1792 736v-192q0 -14 -9 -23t-23 -9h-1248v-224q0 -21 -19 -29t-35 5l-384 350q-10 10 -10 23q0 14 10 24l384 354q16 14 35 6q19 -9 19 -29v-224h1248q14 0 23 -9t9 -23z" />
375 <glyph unicode="&#xf178;" horiz-adv-x="1792" d="M1728 643q0 -14 -10 -24l-384 -354q-16 -14 -35 -6q-19 9 -19 29v224h-1248q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h1248v224q0 21 19 29t35 -5l384 -350q10 -10 10 -23z" />
376 <glyph unicode="&#xf179;" horiz-adv-x="1408" d="M1393 321q-39 -125 -123 -250q-129 -196 -257 -196q-49 0 -140 32q-86 32 -151 32q-61 0 -142 -33q-81 -34 -132 -34q-152 0 -301 259q-147 261 -147 503q0 228 113 374q112 144 284 144q72 0 177 -30q104 -30 138 -30q45 0 143 34q102 34 173 34q119 0 213 -65 q52 -36 104 -100q-79 -67 -114 -118q-65 -94 -65 -207q0 -124 69 -223t158 -126zM1017 1494q0 -61 -29 -136q-30 -75 -93 -138q-54 -54 -108 -72q-37 -11 -104 -17q3 149 78 257q74 107 250 148q1 -3 2.5 -11t2.5 -11q0 -4 0.5 -10t0.5 -10z" />
377 <glyph unicode="&#xf17a;" horiz-adv-x="1664" d="M682 530v-651l-682 94v557h682zM682 1273v-659h-682v565zM1664 530v-786l-907 125v661h907zM1664 1408v-794h-907v669z" />
378 <glyph unicode="&#xf17b;" horiz-adv-x="1408" d="M493 1053q16 0 27.5 11.5t11.5 27.5t-11.5 27.5t-27.5 11.5t-27 -11.5t-11 -27.5t11 -27.5t27 -11.5zM915 1053q16 0 27 11.5t11 27.5t-11 27.5t-27 11.5t-27.5 -11.5t-11.5 -27.5t11.5 -27.5t27.5 -11.5zM103 869q42 0 72 -30t30 -72v-430q0 -43 -29.5 -73t-72.5 -30 t-73 30t-30 73v430q0 42 30 72t73 30zM1163 850v-666q0 -46 -32 -78t-77 -32h-75v-227q0 -43 -30 -73t-73 -30t-73 30t-30 73v227h-138v-227q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73l-1 227h-74q-46 0 -78 32t-32 78v666h918zM931 1255q107 -55 171 -153.5t64 -215.5 h-925q0 117 64 215.5t172 153.5l-71 131q-7 13 5 20q13 6 20 -6l72 -132q95 42 201 42t201 -42l72 132q7 12 20 6q12 -7 5 -20zM1408 767v-430q0 -43 -30 -73t-73 -30q-42 0 -72 30t-30 73v430q0 43 30 72.5t72 29.5q43 0 73 -29.5t30 -72.5z" />
379 <glyph unicode="&#xf17c;" d="M663 1125q-11 -1 -15.5 -10.5t-8.5 -9.5q-5 -1 -5 5q0 12 19 15h10zM750 1111q-4 -1 -11.5 6.5t-17.5 4.5q24 11 32 -2q3 -6 -3 -9zM399 684q-4 1 -6 -3t-4.5 -12.5t-5.5 -13.5t-10 -13q-7 -10 -1 -12q4 -1 12.5 7t12.5 18q1 3 2 7t2 6t1.5 4.5t0.5 4v3t-1 2.5t-3 2z M1254 325q0 18 -55 42q4 15 7.5 27.5t5 26t3 21.5t0.5 22.5t-1 19.5t-3.5 22t-4 20.5t-5 25t-5.5 26.5q-10 48 -47 103t-72 75q24 -20 57 -83q87 -162 54 -278q-11 -40 -50 -42q-31 -4 -38.5 18.5t-8 83.5t-11.5 107q-9 39 -19.5 69t-19.5 45.5t-15.5 24.5t-13 15t-7.5 7 q-14 62 -31 103t-29.5 56t-23.5 33t-15 40q-4 21 6 53.5t4.5 49.5t-44.5 25q-15 3 -44.5 18t-35.5 16q-8 1 -11 26t8 51t36 27q37 3 51 -30t4 -58q-11 -19 -2 -26.5t30 -0.5q13 4 13 36v37q-5 30 -13.5 50t-21 30.5t-23.5 15t-27 7.5q-107 -8 -89 -134q0 -15 -1 -15 q-9 9 -29.5 10.5t-33 -0.5t-15.5 5q1 57 -16 90t-45 34q-27 1 -41.5 -27.5t-16.5 -59.5q-1 -15 3.5 -37t13 -37.5t15.5 -13.5q10 3 16 14q4 9 -7 8q-7 0 -15.5 14.5t-9.5 33.5q-1 22 9 37t34 14q17 0 27 -21t9.5 -39t-1.5 -22q-22 -15 -31 -29q-8 -12 -27.5 -23.5 t-20.5 -12.5q-13 -14 -15.5 -27t7.5 -18q14 -8 25 -19.5t16 -19t18.5 -13t35.5 -6.5q47 -2 102 15q2 1 23 7t34.5 10.5t29.5 13t21 17.5q9 14 20 8q5 -3 6.5 -8.5t-3 -12t-16.5 -9.5q-20 -6 -56.5 -21.5t-45.5 -19.5q-44 -19 -70 -23q-25 -5 -79 2q-10 2 -9 -2t17 -19 q25 -23 67 -22q17 1 36 7t36 14t33.5 17.5t30 17t24.5 12t17.5 2.5t8.5 -11q0 -2 -1 -4.5t-4 -5t-6 -4.5t-8.5 -5t-9 -4.5t-10 -5t-9.5 -4.5q-28 -14 -67.5 -44t-66.5 -43t-49 -1q-21 11 -63 73q-22 31 -25 22q-1 -3 -1 -10q0 -25 -15 -56.5t-29.5 -55.5t-21 -58t11.5 -63 q-23 -6 -62.5 -90t-47.5 -141q-2 -18 -1.5 -69t-5.5 -59q-8 -24 -29 -3q-32 31 -36 94q-2 28 4 56q4 19 -1 18l-4 -5q-36 -65 10 -166q5 -12 25 -28t24 -20q20 -23 104 -90.5t93 -76.5q16 -15 17.5 -38t-14 -43t-45.5 -23q8 -15 29 -44.5t28 -54t7 -70.5q46 24 7 92 q-4 8 -10.5 16t-9.5 12t-2 6q3 5 13 9.5t20 -2.5q46 -52 166 -36q133 15 177 87q23 38 34 30q12 -6 10 -52q-1 -25 -23 -92q-9 -23 -6 -37.5t24 -15.5q3 19 14.5 77t13.5 90q2 21 -6.5 73.5t-7.5 97t23 70.5q15 18 51 18q1 37 34.5 53t72.5 10.5t60 -22.5zM626 1152 q3 17 -2.5 30t-11.5 15q-9 2 -9 -7q2 -5 5 -6q10 0 7 -15q-3 -20 8 -20q3 0 3 3zM1045 955q-2 8 -6.5 11.5t-13 5t-14.5 5.5q-5 3 -9.5 8t-7 8t-5.5 6.5t-4 4t-4 -1.5q-14 -16 7 -43.5t39 -31.5q9 -1 14.5 8t3.5 20zM867 1168q0 11 -5 19.5t-11 12.5t-9 3q-14 -1 -7 -7l4 -2 q14 -4 18 -31q0 -3 8 2zM921 1401q0 2 -2.5 5t-9 7t-9.5 6q-15 15 -24 15q-9 -1 -11.5 -7.5t-1 -13t-0.5 -12.5q-1 -4 -6 -10.5t-6 -9t3 -8.5q4 -3 8 0t11 9t15 9q1 1 9 1t15 2t9 7zM1486 60q20 -12 31 -24.5t12 -24t-2.5 -22.5t-15.5 -22t-23.5 -19.5t-30 -18.5 t-31.5 -16.5t-32 -15.5t-27 -13q-38 -19 -85.5 -56t-75.5 -64q-17 -16 -68 -19.5t-89 14.5q-18 9 -29.5 23.5t-16.5 25.5t-22 19.5t-47 9.5q-44 1 -130 1q-19 0 -57 -1.5t-58 -2.5q-44 -1 -79.5 -15t-53.5 -30t-43.5 -28.5t-53.5 -11.5q-29 1 -111 31t-146 43q-19 4 -51 9.5 t-50 9t-39.5 9.5t-33.5 14.5t-17 19.5q-10 23 7 66.5t18 54.5q1 16 -4 40t-10 42.5t-4.5 36.5t10.5 27q14 12 57 14t60 12q30 18 42 35t12 51q21 -73 -32 -106q-32 -20 -83 -15q-34 3 -43 -10q-13 -15 5 -57q2 -6 8 -18t8.5 -18t4.5 -17t1 -22q0 -15 -17 -49t-14 -48 q3 -17 37 -26q20 -6 84.5 -18.5t99.5 -20.5q24 -6 74 -22t82.5 -23t55.5 -4q43 6 64.5 28t23 48t-7.5 58.5t-19 52t-20 36.5q-121 190 -169 242q-68 74 -113 40q-11 -9 -15 15q-3 16 -2 38q1 29 10 52t24 47t22 42q8 21 26.5 72t29.5 78t30 61t39 54q110 143 124 195 q-12 112 -16 310q-2 90 24 151.5t106 104.5q39 21 104 21q53 1 106 -13.5t89 -41.5q57 -42 91.5 -121.5t29.5 -147.5q-5 -95 30 -214q34 -113 133 -218q55 -59 99.5 -163t59.5 -191q8 -49 5 -84.5t-12 -55.5t-20 -22q-10 -2 -23.5 -19t-27 -35.5t-40.5 -33.5t-61 -14 q-18 1 -31.5 5t-22.5 13.5t-13.5 15.5t-11.5 20.5t-9 19.5q-22 37 -41 30t-28 -49t7 -97q20 -70 1 -195q-10 -65 18 -100.5t73 -33t85 35.5q59 49 89.5 66.5t103.5 42.5q53 18 77 36.5t18.5 34.5t-25 28.5t-51.5 23.5q-33 11 -49.5 48t-15 72.5t15.5 47.5q1 -31 8 -56.5 t14.5 -40.5t20.5 -28.5t21 -19t21.5 -13t16.5 -9.5z" />
380 <glyph unicode="&#xf17d;" d="M1024 36q-42 241 -140 498h-2l-2 -1q-16 -6 -43 -16.5t-101 -49t-137 -82t-131 -114.5t-103 -148l-15 11q184 -150 418 -150q132 0 256 52zM839 643q-21 49 -53 111q-311 -93 -673 -93q-1 -7 -1 -21q0 -124 44 -236.5t124 -201.5q50 89 123.5 166.5t142.5 124.5t130.5 81 t99.5 48l37 13q4 1 13 3.5t13 4.5zM732 855q-120 213 -244 378q-138 -65 -234 -186t-128 -272q302 0 606 80zM1416 536q-210 60 -409 29q87 -239 128 -469q111 75 185 189.5t96 250.5zM611 1277q-1 0 -2 -1q1 1 2 1zM1201 1132q-185 164 -433 164q-76 0 -155 -19 q131 -170 246 -382q69 26 130 60.5t96.5 61.5t65.5 57t37.5 40.5zM1424 647q-3 232 -149 410l-1 -1q-9 -12 -19 -24.5t-43.5 -44.5t-71 -60.5t-100 -65t-131.5 -64.5q25 -53 44 -95q2 -6 6.5 -17.5t7.5 -16.5q36 5 74.5 7t73.5 2t69 -1.5t64 -4t56.5 -5.5t48 -6.5t36.5 -6 t25 -4.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
381 <glyph unicode="&#xf17e;" d="M1173 473q0 50 -19.5 91.5t-48.5 68.5t-73 49t-82.5 34t-87.5 23l-104 24q-30 7 -44 10.5t-35 11.5t-30 16t-16.5 21t-7.5 30q0 77 144 77q43 0 77 -12t54 -28.5t38 -33.5t40 -29t48 -12q47 0 75.5 32t28.5 77q0 55 -56 99.5t-142 67.5t-182 23q-68 0 -132 -15.5 t-119.5 -47t-89 -87t-33.5 -128.5q0 -61 19 -106.5t56 -75.5t80 -48.5t103 -32.5l146 -36q90 -22 112 -36q32 -20 32 -60q0 -39 -40 -64.5t-105 -25.5q-51 0 -91.5 16t-65 38.5t-45.5 45t-46 38.5t-54 16q-50 0 -75.5 -30t-25.5 -75q0 -92 122 -157.5t291 -65.5 q73 0 140 18.5t122.5 53.5t88.5 93.5t33 131.5zM1536 256q0 -159 -112.5 -271.5t-271.5 -112.5q-130 0 -234 80q-77 -16 -150 -16q-143 0 -273.5 55.5t-225 150t-150 225t-55.5 273.5q0 73 16 150q-80 104 -80 234q0 159 112.5 271.5t271.5 112.5q130 0 234 -80 q77 16 150 16q143 0 273.5 -55.5t225 -150t150 -225t55.5 -273.5q0 -73 -16 -150q80 -104 80 -234z" />
382 <glyph unicode="&#xf180;" horiz-adv-x="1280" d="M1000 1102l37 194q5 23 -9 40t-35 17h-712q-23 0 -38.5 -17t-15.5 -37v-1101q0 -7 6 -1l291 352q23 26 38 33.5t48 7.5h239q22 0 37 14.5t18 29.5q24 130 37 191q4 21 -11.5 40t-36.5 19h-294q-29 0 -48 19t-19 48v42q0 29 19 47.5t48 18.5h346q18 0 35 13.5t20 29.5z M1227 1324q-15 -73 -53.5 -266.5t-69.5 -350t-35 -173.5q-6 -22 -9 -32.5t-14 -32.5t-24.5 -33t-38.5 -21t-58 -10h-271q-13 0 -22 -10q-8 -9 -426 -494q-22 -25 -58.5 -28.5t-48.5 5.5q-55 22 -55 98v1410q0 55 38 102.5t120 47.5h888q95 0 127 -53t10 -159zM1227 1324 l-158 -790q4 17 35 173.5t69.5 350t53.5 266.5z" />
383 <glyph unicode="&#xf181;" d="M704 192v1024q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-1024q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1376 576v640q0 14 -9 23t-23 9h-480q-14 0 -23 -9t-9 -23v-640q0 -14 9 -23t23 -9h480q14 0 23 9t9 23zM1536 1344v-1408q0 -26 -19 -45t-45 -19h-1408 q-26 0 -45 19t-19 45v1408q0 26 19 45t45 19h1408q26 0 45 -19t19 -45z" />
384 <glyph unicode="&#xf182;" horiz-adv-x="1280" d="M1280 480q0 -40 -28 -68t-68 -28q-51 0 -80 43l-227 341h-45v-132l247 -411q9 -15 9 -33q0 -26 -19 -45t-45 -19h-192v-272q0 -46 -33 -79t-79 -33h-160q-46 0 -79 33t-33 79v272h-192q-26 0 -45 19t-19 45q0 18 9 33l247 411v132h-45l-227 -341q-29 -43 -80 -43 q-40 0 -68 28t-28 68q0 29 16 53l256 384q73 107 176 107h384q103 0 176 -107l256 -384q16 -24 16 -53zM864 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
385 <glyph unicode="&#xf183;" horiz-adv-x="1024" d="M1024 832v-416q0 -40 -28 -68t-68 -28t-68 28t-28 68v352h-64v-912q0 -46 -33 -79t-79 -33t-79 33t-33 79v464h-64v-464q0 -46 -33 -79t-79 -33t-79 33t-33 79v912h-64v-352q0 -40 -28 -68t-68 -28t-68 28t-28 68v416q0 80 56 136t136 56h640q80 0 136 -56t56 -136z M736 1280q0 -93 -65.5 -158.5t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
386 <glyph unicode="&#xf184;" d="M773 234l350 473q16 22 24.5 59t-6 85t-61.5 79q-40 26 -83 25.5t-73.5 -17.5t-54.5 -45q-36 -40 -96 -40q-59 0 -95 40q-24 28 -54.5 45t-73.5 17.5t-84 -25.5q-46 -31 -60.5 -79t-6 -85t24.5 -59zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
387 <glyph unicode="&#xf185;" horiz-adv-x="1792" d="M1472 640q0 117 -45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5t45.5 -223.5t123 -184t184 -123t223.5 -45.5t223.5 45.5t184 123t123 184t45.5 223.5zM1748 363q-4 -15 -20 -20l-292 -96v-306q0 -16 -13 -26q-15 -10 -29 -4 l-292 94l-180 -248q-10 -13 -26 -13t-26 13l-180 248l-292 -94q-14 -6 -29 4q-13 10 -13 26v306l-292 96q-16 5 -20 20q-5 17 4 29l180 248l-180 248q-9 13 -4 29q4 15 20 20l292 96v306q0 16 13 26q15 10 29 4l292 -94l180 248q9 12 26 12t26 -12l180 -248l292 94 q14 6 29 -4q13 -10 13 -26v-306l292 -96q16 -5 20 -20q5 -16 -4 -29l-180 -248l180 -248q9 -12 4 -29z" />
388 <glyph unicode="&#xf186;" d="M1262 233q-54 -9 -110 -9q-182 0 -337 90t-245 245t-90 337q0 192 104 357q-201 -60 -328.5 -229t-127.5 -384q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51q144 0 273.5 61.5t220.5 171.5zM1465 318q-94 -203 -283.5 -324.5t-413.5 -121.5q-156 0 -298 61 t-245 164t-164 245t-61 298q0 153 57.5 292.5t156 241.5t235.5 164.5t290 68.5q44 2 61 -39q18 -41 -15 -72q-86 -78 -131.5 -181.5t-45.5 -218.5q0 -148 73 -273t198 -198t273 -73q118 0 228 51q41 18 72 -13q14 -14 17.5 -34t-4.5 -38z" />
389 <glyph unicode="&#xf187;" horiz-adv-x="1792" d="M1088 704q0 26 -19 45t-45 19h-256q-26 0 -45 -19t-19 -45t19 -45t45 -19h256q26 0 45 19t19 45zM1664 896v-960q0 -26 -19 -45t-45 -19h-1408q-26 0 -45 19t-19 45v960q0 26 19 45t45 19h1408q26 0 45 -19t19 -45zM1728 1344v-256q0 -26 -19 -45t-45 -19h-1536 q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h1536q26 0 45 -19t19 -45z" />
390 <glyph unicode="&#xf188;" horiz-adv-x="1664" d="M1632 576q0 -26 -19 -45t-45 -19h-224q0 -171 -67 -290l208 -209q19 -19 19 -45t-19 -45q-18 -19 -45 -19t-45 19l-198 197q-5 -5 -15 -13t-42 -28.5t-65 -36.5t-82 -29t-97 -13v896h-128v-896q-51 0 -101.5 13.5t-87 33t-66 39t-43.5 32.5l-15 14l-183 -207 q-20 -21 -48 -21q-24 0 -43 16q-19 18 -20.5 44.5t15.5 46.5l202 227q-58 114 -58 274h-224q-26 0 -45 19t-19 45t19 45t45 19h224v294l-173 173q-19 19 -19 45t19 45t45 19t45 -19l173 -173h844l173 173q19 19 45 19t45 -19t19 -45t-19 -45l-173 -173v-294h224q26 0 45 -19 t19 -45zM1152 1152h-640q0 133 93.5 226.5t226.5 93.5t226.5 -93.5t93.5 -226.5z" />
391 <glyph unicode="&#xf189;" horiz-adv-x="1920" d="M1917 1016q23 -64 -150 -294q-24 -32 -65 -85q-78 -100 -90 -131q-17 -41 14 -81q17 -21 81 -82h1l1 -1l1 -1l2 -2q141 -131 191 -221q3 -5 6.5 -12.5t7 -26.5t-0.5 -34t-25 -27.5t-59 -12.5l-256 -4q-24 -5 -56 5t-52 22l-20 12q-30 21 -70 64t-68.5 77.5t-61 58 t-56.5 15.5q-3 -1 -8 -3.5t-17 -14.5t-21.5 -29.5t-17 -52t-6.5 -77.5q0 -15 -3.5 -27.5t-7.5 -18.5l-4 -5q-18 -19 -53 -22h-115q-71 -4 -146 16.5t-131.5 53t-103 66t-70.5 57.5l-25 24q-10 10 -27.5 30t-71.5 91t-106 151t-122.5 211t-130.5 272q-6 16 -6 27t3 16l4 6 q15 19 57 19l274 2q12 -2 23 -6.5t16 -8.5l5 -3q16 -11 24 -32q20 -50 46 -103.5t41 -81.5l16 -29q29 -60 56 -104t48.5 -68.5t41.5 -38.5t34 -14t27 5q2 1 5 5t12 22t13.5 47t9.5 81t0 125q-2 40 -9 73t-14 46l-6 12q-25 34 -85 43q-13 2 5 24q17 19 38 30q53 26 239 24 q82 -1 135 -13q20 -5 33.5 -13.5t20.5 -24t10.5 -32t3.5 -45.5t-1 -55t-2.5 -70.5t-1.5 -82.5q0 -11 -1 -42t-0.5 -48t3.5 -40.5t11.5 -39t22.5 -24.5q8 -2 17 -4t26 11t38 34.5t52 67t68 107.5q60 104 107 225q4 10 10 17.5t11 10.5l4 3l5 2.5t13 3t20 0.5l288 2 q39 5 64 -2.5t31 -16.5z" />
392 <glyph unicode="&#xf18a;" horiz-adv-x="1792" d="M675 252q21 34 11 69t-45 50q-34 14 -73 1t-60 -46q-22 -34 -13 -68.5t43 -50.5t74.5 -2.5t62.5 47.5zM769 373q8 13 3.5 26.5t-17.5 18.5q-14 5 -28.5 -0.5t-21.5 -18.5q-17 -31 13 -45q14 -5 29 0.5t22 18.5zM943 266q-45 -102 -158 -150t-224 -12 q-107 34 -147.5 126.5t6.5 187.5q47 93 151.5 139t210.5 19q111 -29 158.5 -119.5t2.5 -190.5zM1255 426q-9 96 -89 170t-208.5 109t-274.5 21q-223 -23 -369.5 -141.5t-132.5 -264.5q9 -96 89 -170t208.5 -109t274.5 -21q223 23 369.5 141.5t132.5 264.5zM1563 422 q0 -68 -37 -139.5t-109 -137t-168.5 -117.5t-226 -83t-270.5 -31t-275 33.5t-240.5 93t-171.5 151t-65 199.5q0 115 69.5 245t197.5 258q169 169 341.5 236t246.5 -7q65 -64 20 -209q-4 -14 -1 -20t10 -7t14.5 0.5t13.5 3.5l6 2q139 59 246 59t153 -61q45 -63 0 -178 q-2 -13 -4.5 -20t4.5 -12.5t12 -7.5t17 -6q57 -18 103 -47t80 -81.5t34 -116.5zM1489 1046q42 -47 54.5 -108.5t-6.5 -117.5q-8 -23 -29.5 -34t-44.5 -4q-23 8 -34 29.5t-4 44.5q20 63 -24 111t-107 35q-24 -5 -45 8t-25 37q-5 24 8 44.5t37 25.5q60 13 119 -5.5t101 -65.5z M1670 1209q87 -96 112.5 -222.5t-13.5 -241.5q-9 -27 -34 -40t-52 -4t-40 34t-5 52q28 82 10 172t-80 158q-62 69 -148 95.5t-173 8.5q-28 -6 -52 9.5t-30 43.5t9.5 51.5t43.5 29.5q123 26 244 -11.5t208 -134.5z" />
393 <glyph unicode="&#xf18b;" d="M1133 -34q-171 -94 -368 -94q-196 0 -367 94q138 87 235.5 211t131.5 268q35 -144 132.5 -268t235.5 -211zM638 1394v-485q0 -252 -126.5 -459.5t-330.5 -306.5q-181 215 -181 495q0 187 83.5 349.5t229.5 269.5t325 137zM1536 638q0 -280 -181 -495 q-204 99 -330.5 306.5t-126.5 459.5v485q179 -30 325 -137t229.5 -269.5t83.5 -349.5z" />
394 <glyph unicode="&#xf18c;" horiz-adv-x="1408" d="M1402 433q-32 -80 -76 -138t-91 -88.5t-99 -46.5t-101.5 -14.5t-96.5 8.5t-86.5 22t-69.5 27.5t-46 22.5l-17 10q-113 -228 -289.5 -359.5t-384.5 -132.5q-19 0 -32 13t-13 32t13 31.5t32 12.5q173 1 322.5 107.5t251.5 294.5q-36 -14 -72 -23t-83 -13t-91 2.5t-93 28.5 t-92 59t-84.5 100t-74.5 146q114 47 214 57t167.5 -7.5t124.5 -56.5t88.5 -77t56.5 -82q53 131 79 291q-7 -1 -18 -2.5t-46.5 -2.5t-69.5 0.5t-81.5 10t-88.5 23t-84 42.5t-75 65t-54.5 94.5t-28.5 127.5q70 28 133.5 36.5t112.5 -1t92 -30t73.5 -50t56 -61t42 -63t27.5 -56 t16 -39.5l4 -16q12 122 12 195q-8 6 -21.5 16t-49 44.5t-63.5 71.5t-54 93t-33 112.5t12 127t70 138.5q73 -25 127.5 -61.5t84.5 -76.5t48 -85t20.5 -89t-0.5 -85.5t-13 -76.5t-19 -62t-17 -42l-7 -15q1 -5 1 -50.5t-1 -71.5q3 7 10 18.5t30.5 43t50.5 58t71 55.5t91.5 44.5 t112 14.5t132.5 -24q-2 -78 -21.5 -141.5t-50 -104.5t-69.5 -71.5t-81.5 -45.5t-84.5 -24t-80 -9.5t-67.5 1t-46.5 4.5l-17 3q-23 -147 -73 -283q6 7 18 18.5t49.5 41t77.5 52.5t99.5 42t117.5 20t129 -23.5t137 -77.5z" />
395 <glyph unicode="&#xf18d;" horiz-adv-x="1280" d="M1259 283v-66q0 -85 -57.5 -144.5t-138.5 -59.5h-57l-260 -269v269h-529q-81 0 -138.5 59.5t-57.5 144.5v66h1238zM1259 609v-255h-1238v255h1238zM1259 937v-255h-1238v255h1238zM1259 1077v-67h-1238v67q0 84 57.5 143.5t138.5 59.5h846q81 0 138.5 -59.5t57.5 -143.5z " />
396 <glyph unicode="&#xf18e;" d="M1152 640q0 -14 -9 -23l-320 -320q-9 -9 -23 -9q-13 0 -22.5 9.5t-9.5 22.5v192h-352q-13 0 -22.5 9.5t-9.5 22.5v192q0 13 9.5 22.5t22.5 9.5h352v192q0 14 9 23t23 9q12 0 24 -10l319 -319q9 -9 9 -23zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
397 <glyph unicode="&#xf190;" d="M1152 736v-192q0 -13 -9.5 -22.5t-22.5 -9.5h-352v-192q0 -14 -9 -23t-23 -9q-12 0 -24 10l-319 319q-9 9 -9 23t9 23l320 320q9 9 23 9q13 0 22.5 -9.5t9.5 -22.5v-192h352q13 0 22.5 -9.5t9.5 -22.5zM1312 640q0 148 -73 273t-198 198t-273 73t-273 -73t-198 -198 t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
398 <glyph unicode="&#xf191;" d="M1024 960v-640q0 -26 -19 -45t-45 -19q-20 0 -37 12l-448 320q-27 19 -27 52t27 52l448 320q17 12 37 12q26 0 45 -19t19 -45zM1280 160v960q0 13 -9.5 22.5t-22.5 9.5h-960q-13 0 -22.5 -9.5t-9.5 -22.5v-960q0 -13 9.5 -22.5t22.5 -9.5h960q13 0 22.5 9.5t9.5 22.5z M1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
399 <glyph unicode="&#xf192;" d="M1024 640q0 -106 -75 -181t-181 -75t-181 75t-75 181t75 181t181 75t181 -75t75 -181zM768 1184q-148 0 -273 -73t-198 -198t-73 -273t73 -273t198 -198t273 -73t273 73t198 198t73 273t-73 273t-198 198t-273 73zM1536 640q0 -209 -103 -385.5t-279.5 -279.5 t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
400 <glyph unicode="&#xf193;" horiz-adv-x="1664" d="M1023 349l102 -204q-58 -179 -210 -290t-339 -111q-156 0 -288.5 77.5t-210 210t-77.5 288.5q0 181 104.5 330t274.5 211l17 -131q-122 -54 -195 -165.5t-73 -244.5q0 -185 131.5 -316.5t316.5 -131.5q126 0 232.5 65t165 175.5t49.5 236.5zM1571 249l58 -114l-256 -128 q-13 -7 -29 -7q-40 0 -57 35l-239 477h-472q-24 0 -42.5 16.5t-21.5 40.5l-96 779q-2 16 6 42q14 51 57 82.5t97 31.5q66 0 113 -47t47 -113q0 -69 -52 -117.5t-120 -41.5l37 -289h423v-128h-407l16 -128h455q40 0 57 -35l228 -455z" />
401 <glyph unicode="&#xf194;" d="M1254 899q16 85 -21 132q-52 65 -187 45q-17 -3 -41 -12.5t-57.5 -30.5t-64.5 -48.5t-59.5 -70t-44.5 -91.5q80 7 113.5 -16t26.5 -99q-5 -52 -52 -143q-43 -78 -71 -99q-44 -32 -87 14q-23 24 -37.5 64.5t-19 73t-10 84t-8.5 71.5q-23 129 -34 164q-12 37 -35.5 69 t-50.5 40q-57 16 -127 -25q-54 -32 -136.5 -106t-122.5 -102v-7q16 -8 25.5 -26t21.5 -20q21 -3 54.5 8.5t58 10.5t41.5 -30q11 -18 18.5 -38.5t15 -48t12.5 -40.5q17 -46 53 -187q36 -146 57 -197q42 -99 103 -125q43 -12 85 -1.5t76 31.5q131 77 250 237 q104 139 172.5 292.5t82.5 226.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
402 <glyph unicode="&#xf195;" horiz-adv-x="1152" d="M1152 704q0 -191 -94.5 -353t-256.5 -256.5t-353 -94.5h-160q-14 0 -23 9t-9 23v611l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v93l-215 -66q-3 -1 -9 -1q-10 0 -19 6q-13 10 -13 26v128q0 23 23 31l233 71v250q0 14 9 23t23 9h160 q14 0 23 -9t9 -23v-181l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-93l375 116q15 5 28 -5t13 -26v-128q0 -23 -23 -31l-393 -121v-487q188 13 318 151t130 328q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
403 <glyph unicode="&#xf196;" horiz-adv-x="1408" d="M1152 736v-64q0 -14 -9 -23t-23 -9h-352v-352q0 -14 -9 -23t-23 -9h-64q-14 0 -23 9t-9 23v352h-352q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h352v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23v-352h352q14 0 23 -9t9 -23zM1280 288v832q0 66 -47 113t-113 47h-832 q-66 0 -113 -47t-47 -113v-832q0 -66 47 -113t113 -47h832q66 0 113 47t47 113zM1408 1120v-832q0 -119 -84.5 -203.5t-203.5 -84.5h-832q-119 0 -203.5 84.5t-84.5 203.5v832q0 119 84.5 203.5t203.5 84.5h832q119 0 203.5 -84.5t84.5 -203.5z" />
404 <glyph unicode="&#xf197;" horiz-adv-x="2176" d="M620 416q-110 -64 -268 -64h-128v64h-64q-13 0 -22.5 23.5t-9.5 56.5q0 24 7 49q-58 2 -96.5 10.5t-38.5 20.5t38.5 20.5t96.5 10.5q-7 25 -7 49q0 33 9.5 56.5t22.5 23.5h64v64h128q158 0 268 -64h1113q42 -7 106.5 -18t80.5 -14q89 -15 150 -40.5t83.5 -47.5t22.5 -40 t-22.5 -40t-83.5 -47.5t-150 -40.5q-16 -3 -80.5 -14t-106.5 -18h-1113zM1739 668q53 -36 53 -92t-53 -92l81 -30q68 48 68 122t-68 122zM625 400h1015q-217 -38 -456 -80q-57 0 -113 -24t-83 -48l-28 -24l-288 -288q-26 -26 -70.5 -45t-89.5 -19h-96l-93 464h29 q157 0 273 64zM352 816h-29l93 464h96q46 0 90 -19t70 -45l288 -288q4 -4 11 -10.5t30.5 -23t48.5 -29t61.5 -23t72.5 -10.5l456 -80h-1015q-116 64 -273 64z" />
405 <glyph unicode="&#xf198;" horiz-adv-x="1664" d="M1519 760q62 0 103.5 -40.5t41.5 -101.5q0 -97 -93 -130l-172 -59l56 -167q7 -21 7 -47q0 -59 -42 -102t-101 -43q-47 0 -85.5 27t-53.5 72l-55 165l-310 -106l55 -164q8 -24 8 -47q0 -59 -42 -102t-102 -43q-47 0 -85 27t-53 72l-55 163l-153 -53q-29 -9 -50 -9 q-61 0 -101.5 40t-40.5 101q0 47 27.5 85t71.5 53l156 53l-105 313l-156 -54q-26 -8 -48 -8q-60 0 -101 40.5t-41 100.5q0 47 27.5 85t71.5 53l157 53l-53 159q-8 24 -8 47q0 60 42 102.5t102 42.5q47 0 85 -27t53 -72l54 -160l310 105l-54 160q-8 24 -8 47q0 59 42.5 102 t101.5 43q47 0 85.5 -27.5t53.5 -71.5l53 -161l162 55q21 6 43 6q60 0 102.5 -39.5t42.5 -98.5q0 -45 -30 -81.5t-74 -51.5l-157 -54l105 -316l164 56q24 8 46 8zM725 498l310 105l-105 315l-310 -107z" />
406 <glyph unicode="&#xf199;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM1280 352v436q-31 -35 -64 -55q-34 -22 -132.5 -85t-151.5 -99q-98 -69 -164 -69v0v0q-66 0 -164 69 q-46 32 -141.5 92.5t-142.5 92.5q-12 8 -33 27t-31 27v-436q0 -40 28 -68t68 -28h832q40 0 68 28t28 68zM1280 925q0 41 -27.5 70t-68.5 29h-832q-40 0 -68 -28t-28 -68q0 -37 30.5 -76.5t67.5 -64.5q47 -32 137.5 -89t129.5 -83q3 -2 17 -11.5t21 -14t21 -13t23.5 -13 t21.5 -9.5t22.5 -7.5t20.5 -2.5t20.5 2.5t22.5 7.5t21.5 9.5t23.5 13t21 13t21 14t17 11.5l267 174q35 23 66.5 62.5t31.5 73.5z" />
407 <glyph unicode="&#xf19a;" horiz-adv-x="1792" d="M127 640q0 163 67 313l367 -1005q-196 95 -315 281t-119 411zM1415 679q0 -19 -2.5 -38.5t-10 -49.5t-11.5 -44t-17.5 -59t-17.5 -58l-76 -256l-278 826q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-75 1 -202 10q-12 1 -20.5 -5t-11.5 -15t-1.5 -18.5t9 -16.5 t19.5 -8l80 -8l120 -328l-168 -504l-280 832q46 3 88 8q19 2 26 18.5t-2.5 31t-28.5 13.5l-205 -10q-7 0 -23 0.5t-26 0.5q105 160 274.5 253.5t367.5 93.5q147 0 280.5 -53t238.5 -149h-10q-55 0 -92 -40.5t-37 -95.5q0 -12 2 -24t4 -21.5t8 -23t9 -21t12 -22.5t12.5 -21 t14.5 -24t14 -23q63 -107 63 -212zM909 573l237 -647q1 -6 5 -11q-126 -44 -255 -44q-112 0 -217 32zM1570 1009q95 -174 95 -369q0 -209 -104 -385.5t-279 -278.5l235 678q59 169 59 276q0 42 -6 79zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286 t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 -215q173 0 331.5 68t273 182.5t182.5 273t68 331.5t-68 331.5t-182.5 273t-273 182.5t-331.5 68t-331.5 -68t-273 -182.5t-182.5 -273t-68 -331.5t68 -331.5t182.5 -273 t273 -182.5t331.5 -68z" />
408 <glyph unicode="&#xf19b;" horiz-adv-x="1792" d="M1086 1536v-1536l-272 -128q-228 20 -414 102t-293 208.5t-107 272.5q0 140 100.5 263.5t275 205.5t391.5 108v-172q-217 -38 -356.5 -150t-139.5 -255q0 -152 154.5 -267t388.5 -145v1360zM1755 954l37 -390l-525 114l147 83q-119 70 -280 99v172q277 -33 481 -157z" />
409 <glyph unicode="&#xf19c;" horiz-adv-x="2048" d="M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" />
410 <glyph unicode="&#xf19d;" horiz-adv-x="2304" d="M1774 700l18 -316q4 -69 -82 -128t-235 -93.5t-323 -34.5t-323 34.5t-235 93.5t-82 128l18 316l574 -181q22 -7 48 -7t48 7zM2304 1024q0 -23 -22 -31l-1120 -352q-4 -1 -10 -1t-10 1l-652 206q-43 -34 -71 -111.5t-34 -178.5q63 -36 63 -109q0 -69 -58 -107l58 -433 q2 -14 -8 -25q-9 -11 -24 -11h-192q-15 0 -24 11q-10 11 -8 25l58 433q-58 38 -58 107q0 73 65 111q11 207 98 330l-333 104q-22 8 -22 31t22 31l1120 352q4 1 10 1t10 -1l1120 -352q22 -8 22 -31z" />
411 <glyph unicode="&#xf19e;" d="M859 579l13 -707q-62 11 -105 11q-41 0 -105 -11l13 707q-40 69 -168.5 295.5t-216.5 374.5t-181 287q58 -15 108 -15q43 0 111 15q63 -111 133.5 -229.5t167 -276.5t138.5 -227q37 61 109.5 177.5t117.5 190t105 176t107 189.5q54 -14 107 -14q56 0 114 14v0 q-28 -39 -60 -88.5t-49.5 -78.5t-56.5 -96t-49 -84q-146 -248 -353 -610z" />
412 <glyph unicode="&#xf1a0;" horiz-adv-x="1280" d="M981 197q0 25 -7 49t-14.5 42t-27 41.5t-29.5 35t-38.5 34.5t-36.5 29t-41.5 30t-36.5 26q-16 2 -49 2q-53 0 -104.5 -7t-107 -25t-97 -46t-68.5 -74.5t-27 -105.5q0 -56 23.5 -102t61 -75.5t87 -50t100 -29t101.5 -8.5q58 0 111.5 13t99 39t73 73t27.5 109zM864 1055 q0 59 -17 125.5t-48 129t-84 103.5t-117 41q-42 0 -82.5 -19.5t-66.5 -52.5q-46 -59 -46 -160q0 -46 10 -97.5t31.5 -103t52 -92.5t75 -67t96.5 -26q37 0 77.5 16.5t65.5 43.5q53 56 53 159zM752 1536h417l-137 -88h-132q75 -63 113 -133t38 -160q0 -72 -24.5 -129.5 t-59.5 -93t-69.5 -65t-59 -61.5t-24.5 -66q0 -36 32 -70.5t77 -68t90.5 -73.5t77.5 -104t32 -142q0 -91 -49 -173q-71 -122 -209.5 -179.5t-298.5 -57.5q-132 0 -246.5 41.5t-172.5 137.5q-36 59 -36 131q0 81 44.5 150t118.5 115q131 82 404 100q-32 41 -47.5 73.5 t-15.5 73.5q0 40 21 85q-46 -4 -68 -4q-148 0 -249.5 96.5t-101.5 244.5q0 82 36 159t99 131q76 66 182 98t218 32z" />
413 <glyph unicode="&#xf1a1;" horiz-adv-x="1984" d="M831 572q0 -56 -40.5 -96t-96.5 -40q-57 0 -98 40t-41 96q0 57 41.5 98t97.5 41t96.5 -41t40.5 -98zM1292 711q56 0 96.5 -41t40.5 -98q0 -56 -40.5 -96t-96.5 -40q-57 0 -98 40t-41 96q0 57 41.5 98t97.5 41zM1984 722q0 -62 -31 -114t-83 -82q5 -33 5 -61 q0 -121 -68.5 -230.5t-197.5 -193.5q-125 -82 -285.5 -125.5t-335.5 -43.5q-176 0 -336.5 43.5t-284.5 125.5q-129 84 -197.5 193t-68.5 231q0 29 5 66q-48 31 -77 81.5t-29 109.5q0 94 66 160t160 66q83 0 148 -55q248 158 592 164l134 423q4 14 17.5 21.5t28.5 4.5 l347 -82q22 50 68.5 81t102.5 31q77 0 131.5 -54.5t54.5 -131.5t-54.5 -132t-131.5 -55q-76 0 -130.5 54t-55.5 131l-315 74l-116 -366q327 -14 560 -166q64 58 151 58q94 0 160 -66t66 -160zM1664 1459q-45 0 -77 -32t-32 -77t32 -77t77 -32t77 32t32 77t-32 77t-77 32z M77 722q0 -67 51 -111q49 131 180 235q-36 25 -82 25q-62 0 -105.5 -43.5t-43.5 -105.5zM1567 105q112 73 171.5 166t59.5 194t-59.5 193.5t-171.5 165.5q-116 75 -265.5 115.5t-313.5 40.5t-313.5 -40.5t-265.5 -115.5q-112 -73 -171.5 -165.5t-59.5 -193.5t59.5 -194 t171.5 -166q116 -75 265.5 -115.5t313.5 -40.5t313.5 40.5t265.5 115.5zM1850 605q57 46 57 117q0 62 -43.5 105.5t-105.5 43.5q-49 0 -86 -28q131 -105 178 -238zM1258 237q11 11 27 11t27 -11t11 -27.5t-11 -27.5q-99 -99 -319 -99h-2q-220 0 -319 99q-11 11 -11 27.5 t11 27.5t27 11t27 -11q77 -77 265 -77h2q188 0 265 77z" />
414 <glyph unicode="&#xf1a2;" d="M950 393q7 7 17.5 7t17.5 -7t7 -18t-7 -18q-65 -64 -208 -64h-1h-1q-143 0 -207 64q-8 7 -8 18t8 18q7 7 17.5 7t17.5 -7q49 -51 172 -51h1h1q122 0 173 51zM671 613q0 -37 -26 -64t-63 -27t-63 27t-26 64t26 63t63 26t63 -26t26 -63zM1214 1049q-29 0 -50 21t-21 50 q0 30 21 51t50 21q30 0 51 -21t21 -51q0 -29 -21 -50t-51 -21zM1216 1408q132 0 226 -94t94 -227v-894q0 -133 -94 -227t-226 -94h-896q-132 0 -226 94t-94 227v894q0 133 94 227t226 94h896zM1321 596q35 14 57 45.5t22 70.5q0 51 -36 87.5t-87 36.5q-60 0 -98 -48 q-151 107 -375 115l83 265l206 -49q1 -50 36.5 -85t84.5 -35q50 0 86 35.5t36 85.5t-36 86t-86 36q-36 0 -66 -20.5t-45 -53.5l-227 54q-9 2 -17.5 -2.5t-11.5 -14.5l-95 -302q-224 -4 -381 -113q-36 43 -93 43q-51 0 -87 -36.5t-36 -87.5q0 -37 19.5 -67.5t52.5 -45.5 q-7 -25 -7 -54q0 -98 74 -181.5t201.5 -132t278.5 -48.5q150 0 277.5 48.5t201.5 132t74 181.5q0 27 -6 54zM971 702q37 0 63 -26t26 -63t-26 -64t-63 -27t-63 27t-26 64t26 63t63 26z" />
415 <glyph unicode="&#xf1a3;" d="M866 697l90 27v62q0 79 -58 135t-138 56t-138 -55.5t-58 -134.5v-283q0 -20 -14 -33.5t-33 -13.5t-32.5 13.5t-13.5 33.5v120h-151v-122q0 -82 57.5 -139t139.5 -57q81 0 138.5 56.5t57.5 136.5v280q0 19 13.5 33t33.5 14q19 0 32.5 -14t13.5 -33v-54zM1199 502v122h-150 v-126q0 -20 -13.5 -33.5t-33.5 -13.5q-19 0 -32.5 14t-13.5 33v123l-90 -26l-60 28v-123q0 -80 58 -137t139 -57t138.5 57t57.5 139zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103 t385.5 -103t279.5 -279.5t103 -385.5z" />
416 <glyph unicode="&#xf1a4;" horiz-adv-x="1920" d="M1062 824v118q0 42 -30 72t-72 30t-72 -30t-30 -72v-612q0 -175 -126 -299t-303 -124q-178 0 -303.5 125.5t-125.5 303.5v266h328v-262q0 -43 30 -72.5t72 -29.5t72 29.5t30 72.5v620q0 171 126.5 292t301.5 121q176 0 302 -122t126 -294v-136l-195 -58zM1592 602h328 v-266q0 -178 -125.5 -303.5t-303.5 -125.5q-177 0 -303 124.5t-126 300.5v268l131 -61l195 58v-270q0 -42 30 -71.5t72 -29.5t72 29.5t30 71.5v275z" />
417 <glyph unicode="&#xf1a5;" d="M1472 160v480h-704v704h-480q-93 0 -158.5 -65.5t-65.5 -158.5v-480h704v-704h480q93 0 158.5 65.5t65.5 158.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z" />
418 <glyph unicode="&#xf1a6;" horiz-adv-x="2048" d="M328 1254h204v-983h-532v697h328v286zM328 435v369h-123v-369h123zM614 968v-697h205v697h-205zM614 1254v-204h205v204h-205zM901 968h533v-942h-533v163h328v82h-328v697zM1229 435v369h-123v-369h123zM1516 968h532v-942h-532v163h327v82h-327v697zM1843 435v369h-123 v-369h123z" />
419 <glyph unicode="&#xf1a7;" d="M1046 516q0 -64 -38 -109t-91 -45q-43 0 -70 15v277q28 17 70 17q53 0 91 -45.5t38 -109.5zM703 944q0 -64 -38 -109.5t-91 -45.5q-43 0 -70 15v277q28 17 70 17q53 0 91 -45t38 -109zM1265 513q0 134 -88 229t-213 95q-20 0 -39 -3q-23 -78 -78 -136q-87 -95 -211 -101 v-636l211 41v206q51 -19 117 -19q125 0 213 95t88 229zM922 940q0 134 -88.5 229t-213.5 95q-74 0 -141 -36h-186v-840l211 41v206q55 -19 116 -19q125 0 213.5 95t88.5 229zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
420 <glyph unicode="&#xf1a8;" horiz-adv-x="2038" d="M1222 607q75 3 143.5 -20.5t118 -58.5t101 -94.5t84 -108t75.5 -120.5q33 -56 78.5 -109t75.5 -80.5t99 -88.5q-48 -30 -108.5 -57.5t-138.5 -59t-114 -47.5q-44 37 -74 115t-43.5 164.5t-33 180.5t-42.5 168.5t-72.5 123t-122.5 48.5l-10 -2l-6 -4q4 -5 13 -14 q6 -5 28 -23.5t25.5 -22t19 -18t18 -20.5t11.5 -21t10.5 -27.5t4.5 -31t4 -40.5l1 -33q1 -26 -2.5 -57.5t-7.5 -52t-12.5 -58.5t-11.5 -53q-35 1 -101 -9.5t-98 -10.5q-39 0 -72 10q-2 16 -2 47q0 74 3 96q2 13 31.5 41.5t57 59t26.5 51.5q-24 2 -43 -24 q-36 -53 -111.5 -99.5t-136.5 -46.5q-25 0 -75.5 63t-106.5 139.5t-84 96.5q-6 4 -27 30q-482 -112 -513 -112q-16 0 -28 11t-12 27q0 15 8.5 26.5t22.5 14.5l486 106q-8 14 -8 25t5.5 17.5t16 11.5t20 7t23 4.5t18.5 4.5q4 1 15.5 7.5t17.5 6.5q15 0 28 -16t20 -33 q163 37 172 37q17 0 29.5 -11t12.5 -28q0 -15 -8.5 -26t-23.5 -14l-182 -40l-1 -16q-1 -26 81.5 -117.5t104.5 -91.5q47 0 119 80t72 129q0 36 -23.5 53t-51 18.5t-51 11.5t-23.5 34q0 16 10 34l-68 19q43 44 43 117q0 26 -5 58q82 16 144 16q44 0 71.5 -1.5t48.5 -8.5 t31 -13.5t20.5 -24.5t15.5 -33.5t17 -47.5t24 -60l50 25q-3 -40 -23 -60t-42.5 -21t-40 -6.5t-16.5 -20.5zM1282 842q-5 5 -13.5 15.5t-12 14.5t-10.5 11.5t-10 10.5l-8 8t-8.5 7.5t-8 5t-8.5 4.5q-7 3 -14.5 5t-20.5 2.5t-22 0.5h-32.5h-37.5q-126 0 -217 -43 q16 30 36 46.5t54 29.5t65.5 36t46 36.5t50 55t43.5 50.5q12 -9 28 -31.5t32 -36.5t38 -13l12 1v-76l22 -1q247 95 371 190q28 21 50 39t42.5 37.5t33 31t29.5 34t24 31t24.5 37t23 38t27 47.5t29.5 53l7 9q-2 -53 -43 -139q-79 -165 -205 -264t-306 -142q-14 -3 -42 -7.5 t-50 -9.5t-39 -14q3 -19 24.5 -46t21.5 -34q0 -11 -26 -30zM1061 -79q39 26 131.5 47.5t146.5 21.5q9 0 22.5 -15.5t28 -42.5t26 -50t24 -51t14.5 -33q-121 -45 -244 -45q-61 0 -125 11zM822 568l48 12l109 -177l-73 -48zM1323 51q3 -15 3 -16q0 -7 -17.5 -14.5t-46 -13 t-54 -9.5t-53.5 -7.5t-32 -4.5l-7 43q21 2 60.5 8.5t72 10t60.5 3.5h14zM866 679l-96 -20l-6 17q10 1 32.5 7t34.5 6q19 0 35 -10zM1061 45h31l10 -83l-41 -12v95zM1950 1535v1v-1zM1950 1535l-1 -5l-2 -2l1 3zM1950 1535l1 1z" />
421 <glyph unicode="&#xf1a9;" d="M1167 -50q-5 19 -24 5q-30 -22 -87 -39t-131 -17q-129 0 -193 49q-5 4 -13 4q-11 0 -26 -12q-7 -6 -7.5 -16t7.5 -20q34 -32 87.5 -46t102.5 -12.5t99 4.5q41 4 84.5 20.5t65 30t28.5 20.5q12 12 7 29zM1128 65q-19 47 -39 61q-23 15 -76 15q-47 0 -71 -10 q-29 -12 -78 -56q-26 -24 -12 -44q9 -8 17.5 -4.5t31.5 23.5q3 2 10.5 8.5t10.5 8.5t10 7t11.5 7t12.5 5t15 4.5t16.5 2.5t20.5 1q27 0 44.5 -7.5t23 -14.5t13.5 -22q10 -17 12.5 -20t12.5 1q23 12 14 34zM1483 346q0 22 -5 44.5t-16.5 45t-34 36.5t-52.5 14 q-33 0 -97 -41.5t-129 -83.5t-101 -42q-27 -1 -63.5 19t-76 49t-83.5 58t-100 49t-111 19q-115 -1 -197 -78.5t-84 -178.5q-2 -112 74 -164q29 -20 62.5 -28.5t103.5 -8.5q57 0 132 32.5t134 71t120 70.5t93 31q26 -1 65 -31.5t71.5 -67t68 -67.5t55.5 -32q35 -3 58.5 14 t55.5 63q28 41 42.5 101t14.5 106zM1536 506q0 -164 -62 -304.5t-166 -236t-242.5 -149.5t-290.5 -54t-293 57.5t-247.5 157t-170.5 241.5t-64 302q0 89 19.5 172.5t49 145.5t70.5 118.5t78.5 94t78.5 69.5t64.5 46.5t42.5 24.5q14 8 51 26.5t54.5 28.5t48 30t60.5 44 q36 28 58 72.5t30 125.5q129 -155 186 -193q44 -29 130 -68t129 -66q21 -13 39 -25t60.5 -46.5t76 -70.5t75 -95t69 -122t47 -148.5t19.5 -177.5z" />
422 <glyph unicode="&#xf1aa;" d="M1070 463l-160 -160l-151 -152l-30 -30q-65 -64 -151.5 -87t-171.5 -2q-16 -70 -72 -115t-129 -45q-85 0 -145 60.5t-60 145.5q0 72 44.5 128t113.5 72q-22 86 1 173t88 152l12 12l151 -152l-11 -11q-37 -37 -37 -89t37 -90q37 -37 89 -37t89 37l30 30l151 152l161 160z M729 1145l12 -12l-152 -152l-12 12q-37 37 -89 37t-89 -37t-37 -89.5t37 -89.5l29 -29l152 -152l160 -160l-151 -152l-161 160l-151 152l-30 30q-68 67 -90 159.5t5 179.5q-70 15 -115 71t-45 129q0 85 60 145.5t145 60.5q76 0 133.5 -49t69.5 -123q84 20 169.5 -3.5 t149.5 -87.5zM1536 78q0 -85 -60 -145.5t-145 -60.5q-74 0 -131 47t-71 118q-86 -28 -179.5 -6t-161.5 90l-11 12l151 152l12 -12q37 -37 89 -37t89 37t37 89t-37 89l-30 30l-152 152l-160 160l152 152l160 -160l152 -152l29 -30q64 -64 87.5 -150.5t2.5 -171.5 q76 -11 126.5 -68.5t50.5 -134.5zM1534 1202q0 -77 -51 -135t-127 -69q26 -85 3 -176.5t-90 -158.5l-12 -12l-151 152l12 12q37 37 37 89t-37 89t-89 37t-89 -37l-30 -30l-152 -152l-160 -160l-152 152l161 160l152 152l29 30q67 67 159 89.5t178 -3.5q11 75 68.5 126 t135.5 51q85 0 145 -60.5t60 -145.5z" />
423 <glyph unicode="&#xf1ab;" d="M654 458q-1 -3 -12.5 0.5t-31.5 11.5l-20 9q-44 20 -87 49q-7 5 -41 31.5t-38 28.5q-67 -103 -134 -181q-81 -95 -105 -110q-4 -2 -19.5 -4t-18.5 0q6 4 82 92q21 24 85.5 115t78.5 118q17 30 51 98.5t36 77.5q-8 1 -110 -33q-8 -2 -27.5 -7.5t-34.5 -9.5t-17 -5 q-2 -2 -2 -10.5t-1 -9.5q-5 -10 -31 -15q-23 -7 -47 0q-18 4 -28 21q-4 6 -5 23q6 2 24.5 5t29.5 6q58 16 105 32q100 35 102 35q10 2 43 19.5t44 21.5q9 3 21.5 8t14.5 5.5t6 -0.5q2 -12 -1 -33q0 -2 -12.5 -27t-26.5 -53.5t-17 -33.5q-25 -50 -77 -131l64 -28 q12 -6 74.5 -32t67.5 -28q4 -1 10.5 -25.5t4.5 -30.5zM449 944q3 -15 -4 -28q-12 -23 -50 -38q-30 -12 -60 -12q-26 3 -49 26q-14 15 -18 41l1 3q3 -3 19.5 -5t26.5 0t58 16q36 12 55 14q17 0 21 -17zM1147 815l63 -227l-139 42zM39 15l694 232v1032l-694 -233v-1031z M1280 332l102 -31l-181 657l-100 31l-216 -536l102 -31l45 110l211 -65zM777 1294l573 -184v380zM1088 -29l158 -13l-54 -160l-40 66q-130 -83 -276 -108q-58 -12 -91 -12h-84q-79 0 -199.5 39t-183.5 85q-8 7 -8 16q0 8 5 13.5t13 5.5q4 0 18 -7.5t30.5 -16.5t20.5 -11 q73 -37 159.5 -61.5t157.5 -24.5q95 0 167 14.5t157 50.5q15 7 30.5 15.5t34 19t28.5 16.5zM1536 1050v-1079l-774 246q-14 -6 -375 -127.5t-368 -121.5q-13 0 -18 13q0 1 -1 3v1078q3 9 4 10q5 6 20 11q106 35 149 50v384l558 -198q2 0 160.5 55t316 108.5t161.5 53.5 q20 0 20 -21v-418z" />
424 <glyph unicode="&#xf1ac;" horiz-adv-x="1792" d="M288 1152q66 0 113 -47t47 -113v-1088q0 -66 -47 -113t-113 -47h-128q-66 0 -113 47t-47 113v1088q0 66 47 113t113 47h128zM1664 989q58 -34 93 -93t35 -128v-768q0 -106 -75 -181t-181 -75h-864q-66 0 -113 47t-47 113v1536q0 40 28 68t68 28h672q40 0 88 -20t76 -48 l152 -152q28 -28 48 -76t20 -88v-163zM928 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM928 512v128q0 14 -9 23 t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1184 256v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128 q14 0 23 9t9 23zM1184 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 0v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 256v128q0 14 -9 23t-23 9h-128 q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1440 512v128q0 14 -9 23t-23 9h-128q-14 0 -23 -9t-9 -23v-128q0 -14 9 -23t23 -9h128q14 0 23 9t9 23zM1536 896v256h-160q-40 0 -68 28t-28 68v160h-640v-512h896z" />
425 <glyph unicode="&#xf1ad;" d="M1344 1536q26 0 45 -19t19 -45v-1664q0 -26 -19 -45t-45 -19h-1280q-26 0 -45 19t-19 45v1664q0 26 19 45t45 19h1280zM512 1248v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 992v-64q0 -14 9 -23t23 -9h64q14 0 23 9 t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 736v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM512 480v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23zM384 160v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM384 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM384 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 -96v192q0 14 -9 23t-23 9h-320q-14 0 -23 -9 t-9 -23v-192q0 -14 9 -23t23 -9h320q14 0 23 9t9 23zM896 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 928v64 q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM896 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 160v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64 q14 0 23 9t9 23zM1152 416v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 672v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 928v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9 t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1152 1184v64q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-64q0 -14 9 -23t23 -9h64q14 0 23 9t9 23z" />
426 <glyph unicode="&#xf1ae;" horiz-adv-x="1280" d="M1188 988l-292 -292v-824q0 -46 -33 -79t-79 -33t-79 33t-33 79v384h-64v-384q0 -46 -33 -79t-79 -33t-79 33t-33 79v824l-292 292q-28 28 -28 68t28 68t68 28t68 -28l228 -228h368l228 228q28 28 68 28t68 -28t28 -68t-28 -68zM864 1152q0 -93 -65.5 -158.5 t-158.5 -65.5t-158.5 65.5t-65.5 158.5t65.5 158.5t158.5 65.5t158.5 -65.5t65.5 -158.5z" />
427 <glyph unicode="&#xf1b0;" horiz-adv-x="1664" d="M780 1064q0 -60 -19 -113.5t-63 -92.5t-105 -39q-76 0 -138 57.5t-92 135.5t-30 151q0 60 19 113.5t63 92.5t105 39q77 0 138.5 -57.5t91.5 -135t30 -151.5zM438 581q0 -80 -42 -139t-119 -59q-76 0 -141.5 55.5t-100.5 133.5t-35 152q0 80 42 139.5t119 59.5 q76 0 141.5 -55.5t100.5 -134t35 -152.5zM832 608q118 0 255 -97.5t229 -237t92 -254.5q0 -46 -17 -76.5t-48.5 -45t-64.5 -20t-76 -5.5q-68 0 -187.5 45t-182.5 45q-66 0 -192.5 -44.5t-200.5 -44.5q-183 0 -183 146q0 86 56 191.5t139.5 192.5t187.5 146t193 59zM1071 819 q-61 0 -105 39t-63 92.5t-19 113.5q0 74 30 151.5t91.5 135t138.5 57.5q61 0 105 -39t63 -92.5t19 -113.5q0 -73 -30 -151t-92 -135.5t-138 -57.5zM1503 923q77 0 119 -59.5t42 -139.5q0 -74 -35 -152t-100.5 -133.5t-141.5 -55.5q-77 0 -119 59t-42 139q0 74 35 152.5 t100.5 134t141.5 55.5z" />
428 <glyph unicode="&#xf1b1;" horiz-adv-x="768" d="M704 1008q0 -145 -57 -243.5t-152 -135.5l45 -821q2 -26 -16 -45t-44 -19h-192q-26 0 -44 19t-16 45l45 821q-95 37 -152 135.5t-57 243.5q0 128 42.5 249.5t117.5 200t160 78.5t160 -78.5t117.5 -200t42.5 -249.5z" />
429 <glyph unicode="&#xf1b2;" horiz-adv-x="1792" d="M896 -93l640 349v636l-640 -233v-752zM832 772l698 254l-698 254l-698 -254zM1664 1024v-768q0 -35 -18 -65t-49 -47l-704 -384q-28 -16 -61 -16t-61 16l-704 384q-31 17 -49 47t-18 65v768q0 40 23 73t61 47l704 256q22 8 44 8t44 -8l704 -256q38 -14 61 -47t23 -73z " />
430 <glyph unicode="&#xf1b3;" horiz-adv-x="2304" d="M640 -96l384 192v314l-384 -164v-342zM576 358l404 173l-404 173l-404 -173zM1664 -96l384 192v314l-384 -164v-342zM1600 358l404 173l-404 173l-404 -173zM1152 651l384 165v266l-384 -164v-267zM1088 1030l441 189l-441 189l-441 -189zM2176 512v-416q0 -36 -19 -67 t-52 -47l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-5 2 -7 4q-2 -2 -7 -4l-448 -224q-25 -14 -57 -14t-57 14l-448 224q-33 16 -52 47t-19 67v416q0 38 21.5 70t56.5 48l434 186v400q0 38 21.5 70t56.5 48l448 192q23 10 50 10t50 -10l448 -192q35 -16 56.5 -48t21.5 -70 v-400l434 -186q36 -16 57 -48t21 -70z" />
431 <glyph unicode="&#xf1b4;" horiz-adv-x="2048" d="M1848 1197h-511v-124h511v124zM1596 771q-90 0 -146 -52.5t-62 -142.5h408q-18 195 -200 195zM1612 186q63 0 122 32t76 87h221q-100 -307 -427 -307q-214 0 -340.5 132t-126.5 347q0 208 130.5 345.5t336.5 137.5q138 0 240.5 -68t153 -179t50.5 -248q0 -17 -2 -47h-658 q0 -111 57.5 -171.5t166.5 -60.5zM277 236h296q205 0 205 167q0 180 -199 180h-302v-347zM277 773h281q78 0 123.5 36.5t45.5 113.5q0 144 -190 144h-260v-294zM0 1282h594q87 0 155 -14t126.5 -47.5t90 -96.5t31.5 -154q0 -181 -172 -263q114 -32 172 -115t58 -204 q0 -75 -24.5 -136.5t-66 -103.5t-98.5 -71t-121 -42t-134 -13h-611v1260z" />
432 <glyph unicode="&#xf1b5;" d="M1248 1408q119 0 203.5 -84.5t84.5 -203.5v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960zM499 1041h-371v-787h382q117 0 197 57.5t80 170.5q0 158 -143 200q107 52 107 164q0 57 -19.5 96.5 t-56.5 60.5t-79 29.5t-97 8.5zM477 723h-176v184h163q119 0 119 -90q0 -94 -106 -94zM486 388h-185v217h189q124 0 124 -113q0 -104 -128 -104zM1136 356q-68 0 -104 38t-36 107h411q1 10 1 30q0 132 -74.5 220.5t-203.5 88.5q-128 0 -210 -86t-82 -216q0 -135 79 -217 t213 -82q205 0 267 191h-138q-11 -34 -47.5 -54t-75.5 -20zM1126 722q113 0 124 -122h-254q4 56 39 89t91 33zM964 988h319v-77h-319v77z" />
433 <glyph unicode="&#xf1b6;" horiz-adv-x="1792" d="M1582 954q0 -101 -71.5 -172.5t-172.5 -71.5t-172.5 71.5t-71.5 172.5t71.5 172.5t172.5 71.5t172.5 -71.5t71.5 -172.5zM812 212q0 104 -73 177t-177 73q-27 0 -54 -6l104 -42q77 -31 109.5 -106.5t1.5 -151.5q-31 -77 -107 -109t-152 -1q-21 8 -62 24.5t-61 24.5 q32 -60 91 -96.5t130 -36.5q104 0 177 73t73 177zM1642 953q0 126 -89.5 215.5t-215.5 89.5q-127 0 -216.5 -89.5t-89.5 -215.5q0 -127 89.5 -216t216.5 -89q126 0 215.5 89t89.5 216zM1792 953q0 -189 -133.5 -322t-321.5 -133l-437 -319q-12 -129 -109 -218t-229 -89 q-121 0 -214 76t-118 192l-230 92v429l389 -157q79 48 173 48q13 0 35 -2l284 407q2 187 135.5 319t320.5 132q188 0 321.5 -133.5t133.5 -321.5z" />
434 <glyph unicode="&#xf1b7;" d="M1242 889q0 80 -57 136.5t-137 56.5t-136.5 -57t-56.5 -136q0 -80 56.5 -136.5t136.5 -56.5t137 56.5t57 136.5zM632 301q0 -83 -58 -140.5t-140 -57.5q-56 0 -103 29t-72 77q52 -20 98 -40q60 -24 120 1.5t85 86.5q24 60 -1.5 120t-86.5 84l-82 33q22 5 42 5 q82 0 140 -57.5t58 -140.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v153l172 -69q20 -92 93.5 -152t168.5 -60q104 0 181 70t87 173l345 252q150 0 255.5 105.5t105.5 254.5q0 150 -105.5 255.5t-255.5 105.5 q-148 0 -253 -104.5t-107 -252.5l-225 -322q-9 1 -28 1q-75 0 -137 -37l-297 119v468q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5zM1289 887q0 -100 -71 -170.5t-171 -70.5t-170.5 70.5t-70.5 170.5t70.5 171t170.5 71q101 0 171.5 -70.5t70.5 -171.5z " />
435 <glyph unicode="&#xf1b8;" horiz-adv-x="1792" d="M836 367l-15 -368l-2 -22l-420 29q-36 3 -67 31.5t-47 65.5q-11 27 -14.5 55t4 65t12 55t21.5 64t19 53q78 -12 509 -28zM449 953l180 -379l-147 92q-63 -72 -111.5 -144.5t-72.5 -125t-39.5 -94.5t-18.5 -63l-4 -21l-190 357q-17 26 -18 56t6 47l8 18q35 63 114 188 l-140 86zM1680 436l-188 -359q-12 -29 -36.5 -46.5t-43.5 -20.5l-18 -4q-71 -7 -219 -12l8 -164l-230 367l211 362l7 -173q170 -16 283 -5t170 33zM895 1360q-47 -63 -265 -435l-317 187l-19 12l225 356q20 31 60 45t80 10q24 -2 48.5 -12t42 -21t41.5 -33t36 -34.5 t36 -39.5t32 -35zM1550 1053l212 -363q18 -37 12.5 -76t-27.5 -74q-13 -20 -33 -37t-38 -28t-48.5 -22t-47 -16t-51.5 -14t-46 -12q-34 72 -265 436l313 195zM1407 1279l142 83l-220 -373l-419 20l151 86q-34 89 -75 166t-75.5 123.5t-64.5 80t-47 46.5l-17 13l405 -1 q31 3 58 -10.5t39 -28.5l11 -15q39 -61 112 -190z" />
436 <glyph unicode="&#xf1b9;" horiz-adv-x="2048" d="M480 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM516 768h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5zM1888 448q0 66 -47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47t113 47t47 113zM2048 544v-384 q0 -14 -9 -23t-23 -9h-96v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-1024v-128q0 -80 -56 -136t-136 -56t-136 56t-56 136v128h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5t179 63.5h768q98 0 179 -63.5t104 -157.5 l105 -419h28q93 0 158.5 -65.5t65.5 -158.5z" />
437 <glyph unicode="&#xf1ba;" horiz-adv-x="2048" d="M1824 640q93 0 158.5 -65.5t65.5 -158.5v-384q0 -14 -9 -23t-23 -9h-96v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-1024v-64q0 -80 -56 -136t-136 -56t-136 56t-56 136v64h-96q-14 0 -23 9t-9 23v384q0 93 65.5 158.5t158.5 65.5h28l105 419q23 94 104 157.5 t179 63.5h128v224q0 14 9 23t23 9h448q14 0 23 -9t9 -23v-224h128q98 0 179 -63.5t104 -157.5l105 -419h28zM320 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47zM516 640h1016l-89 357q-2 8 -14 17.5t-21 9.5h-768q-9 0 -21 -9.5t-14 -17.5z M1728 160q66 0 113 47t47 113t-47 113t-113 47t-113 -47t-47 -113t47 -113t113 -47z" />
438 <glyph unicode="&#xf1bb;" d="M1504 64q0 -26 -19 -45t-45 -19h-462q1 -17 6 -87.5t5 -108.5q0 -25 -18 -42.5t-43 -17.5h-320q-25 0 -43 17.5t-18 42.5q0 38 5 108.5t6 87.5h-462q-26 0 -45 19t-19 45t19 45l402 403h-229q-26 0 -45 19t-19 45t19 45l402 403h-197q-26 0 -45 19t-19 45t19 45l384 384 q19 19 45 19t45 -19l384 -384q19 -19 19 -45t-19 -45t-45 -19h-197l402 -403q19 -19 19 -45t-19 -45t-45 -19h-229l402 -403q19 -19 19 -45z" />
439 <glyph unicode="&#xf1bc;" d="M1127 326q0 32 -30 51q-193 115 -447 115q-133 0 -287 -34q-42 -9 -42 -52q0 -20 13.5 -34.5t35.5 -14.5q5 0 37 8q132 27 243 27q226 0 397 -103q19 -11 33 -11q19 0 33 13.5t14 34.5zM1223 541q0 40 -35 61q-237 141 -548 141q-153 0 -303 -42q-48 -13 -48 -64 q0 -25 17.5 -42.5t42.5 -17.5q7 0 37 8q122 33 251 33q279 0 488 -124q24 -13 38 -13q25 0 42.5 17.5t17.5 42.5zM1331 789q0 47 -40 70q-126 73 -293 110.5t-343 37.5q-204 0 -364 -47q-23 -7 -38.5 -25.5t-15.5 -48.5q0 -31 20.5 -52t51.5 -21q11 0 40 8q133 37 307 37 q159 0 309.5 -34t253.5 -95q21 -12 40 -12q29 0 50.5 20.5t21.5 51.5zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
440 <glyph unicode="&#xf1bd;" d="M1397 1408q58 0 98.5 -40.5t40.5 -98.5v-1258q0 -58 -40.5 -98.5t-98.5 -40.5h-1258q-58 0 -98.5 40.5t-40.5 98.5v1258q0 58 40.5 98.5t98.5 40.5h1258zM1465 11v1258q0 28 -20 48t-48 20h-1258q-28 0 -48 -20t-20 -48v-1258q0 -28 20 -48t48 -20h1258q28 0 48 20t20 48 zM694 749l188 -387l533 145v-496q0 -7 -5.5 -12.5t-12.5 -5.5h-1258q-7 0 -12.5 5.5t-5.5 12.5v141l711 195l-212 439q4 1 12 2.5t12 1.5q170 32 303.5 21.5t221 -46t143.5 -94.5q27 -28 -25 -42q-64 -16 -256 -62l-97 198q-111 7 -240 -16zM1397 1287q7 0 12.5 -5.5 t5.5 -12.5v-428q-85 30 -188 52q-294 64 -645 12l-18 -3l-65 134h-233l85 -190q-132 -51 -230 -137v560q0 7 5.5 12.5t12.5 5.5h1258zM286 387q-14 -3 -26 4.5t-14 21.5q-24 203 166 305l129 -270z" />
441 <glyph unicode="&#xf1be;" horiz-adv-x="2304" d="M784 164l16 241l-16 523q-1 10 -7.5 17t-16.5 7q-9 0 -16 -7t-7 -17l-14 -523l14 -241q1 -10 7.5 -16.5t15.5 -6.5q22 0 24 23zM1080 193l11 211l-12 586q0 16 -13 24q-8 5 -16 5t-16 -5q-13 -8 -13 -24l-1 -6l-10 -579q0 -1 11 -236v-1q0 -10 6 -17q9 -11 23 -11 q11 0 20 9q9 7 9 20zM35 533l20 -128l-20 -126q-2 -9 -9 -9t-9 9l-17 126l17 128q2 9 9 9t9 -9zM121 612l26 -207l-26 -203q-2 -9 -10 -9q-9 0 -9 10l-23 202l23 207q0 9 9 9q8 0 10 -9zM401 159zM213 650l25 -245l-25 -237q0 -11 -11 -11q-10 0 -12 11l-21 237l21 245 q2 12 12 12q11 0 11 -12zM307 657l23 -252l-23 -244q-2 -13 -14 -13q-13 0 -13 13l-21 244l21 252q0 13 13 13q12 0 14 -13zM401 639l21 -234l-21 -246q-2 -16 -16 -16q-6 0 -10.5 4.5t-4.5 11.5l-20 246l20 234q0 6 4.5 10.5t10.5 4.5q14 0 16 -15zM784 164zM495 785 l21 -380l-21 -246q0 -7 -5 -12.5t-12 -5.5q-16 0 -18 18l-18 246l18 380q2 18 18 18q7 0 12 -5.5t5 -12.5zM589 871l19 -468l-19 -244q0 -8 -5.5 -13.5t-13.5 -5.5q-18 0 -20 19l-16 244l16 468q2 19 20 19q8 0 13.5 -5.5t5.5 -13.5zM687 911l18 -506l-18 -242 q-2 -21 -22 -21q-19 0 -21 21l-16 242l16 506q0 9 6.5 15.5t14.5 6.5q9 0 15 -6.5t7 -15.5zM1079 169v0v0zM881 915l15 -510l-15 -239q0 -10 -7.5 -17.5t-17.5 -7.5t-17 7t-8 18l-14 239l14 510q0 11 7.5 18t17.5 7t17.5 -7t7.5 -18zM980 896l14 -492l-14 -236q0 -11 -8 -19 t-19 -8t-19 8t-9 19l-12 236l12 492q1 12 9 20t19 8t18.5 -8t8.5 -20zM1192 404l-14 -231v0q0 -13 -9 -22t-22 -9t-22 9t-10 22l-6 114l-6 117l12 636v3q2 15 12 24q9 7 20 7q8 0 15 -5q14 -8 16 -26zM2304 423q0 -117 -83 -199.5t-200 -82.5h-786q-13 2 -22 11t-9 22v899 q0 23 28 33q85 34 181 34q195 0 338 -131.5t160 -323.5q53 22 110 22q117 0 200 -83t83 -201z" />
442 <glyph unicode="&#xf1c0;" d="M768 768q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 0q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127 t443 -43zM768 384q237 0 443 43t325 127v-170q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5t-103 128v170q119 -84 325 -127t443 -43zM768 1536q208 0 385 -34.5t280 -93.5t103 -128v-128q0 -69 -103 -128t-280 -93.5t-385 -34.5t-385 34.5t-280 93.5 t-103 128v128q0 69 103 128t280 93.5t385 34.5z" />
443 <glyph unicode="&#xf1c1;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M894 465q33 -26 84 -56q59 7 117 7q147 0 177 -49q16 -22 2 -52q0 -1 -1 -2l-2 -2v-1q-6 -38 -71 -38q-48 0 -115 20t-130 53q-221 -24 -392 -83q-153 -262 -242 -262q-15 0 -28 7l-24 12q-1 1 -6 5q-10 10 -6 36q9 40 56 91.5t132 96.5q14 9 23 -6q2 -2 2 -4q52 85 107 197 q68 136 104 262q-24 82 -30.5 159.5t6.5 127.5q11 40 42 40h21h1q23 0 35 -15q18 -21 9 -68q-2 -6 -4 -8q1 -3 1 -8v-30q-2 -123 -14 -192q55 -164 146 -238zM318 54q52 24 137 158q-51 -40 -87.5 -84t-49.5 -74zM716 974q-15 -42 -2 -132q1 7 7 44q0 3 7 43q1 4 4 8 q-1 1 -1 2t-0.5 1.5t-0.5 1.5q-1 22 -13 36q0 -1 -1 -2v-2zM592 313q135 54 284 81q-2 1 -13 9.5t-16 13.5q-76 67 -127 176q-27 -86 -83 -197q-30 -56 -45 -83zM1238 329q-24 24 -140 24q76 -28 124 -28q14 0 18 1q0 1 -2 3z" />
444 <glyph unicode="&#xf1c2;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M233 768v-107h70l164 -661h159l128 485q7 20 10 46q2 16 2 24h4l3 -24q1 -3 3.5 -20t5.5 -26l128 -485h159l164 661h70v107h-300v-107h90l-99 -438q-5 -20 -7 -46l-2 -21h-4l-3 21q-1 5 -4 21t-5 25l-144 545h-114l-144 -545q-2 -9 -4.5 -24.5t-3.5 -21.5l-4 -21h-4l-2 21 q-2 26 -7 46l-99 438h90v107h-300z" />
445 <glyph unicode="&#xf1c3;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M429 106v-106h281v106h-75l103 161q5 7 10 16.5t7.5 13.5t3.5 4h2q1 -4 5 -10q2 -4 4.5 -7.5t6 -8t6.5 -8.5l107 -161h-76v-106h291v106h-68l-192 273l195 282h67v107h-279v-107h74l-103 -159q-4 -7 -10 -16.5t-9 -13.5l-2 -3h-2q-1 4 -5 10q-6 11 -17 23l-106 159h76v107 h-290v-107h68l189 -272l-194 -283h-68z" />
446 <glyph unicode="&#xf1c4;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M416 106v-106h327v106h-93v167h137q76 0 118 15q67 23 106.5 87t39.5 146q0 81 -37 141t-100 87q-48 19 -130 19h-368v-107h92v-555h-92zM769 386h-119v268h120q52 0 83 -18q56 -33 56 -115q0 -89 -62 -120q-31 -15 -78 -15z" />
447 <glyph unicode="&#xf1c5;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M1280 320v-320h-1024v192l192 192l128 -128l384 384zM448 512q-80 0 -136 56t-56 136t56 136t136 56t136 -56t56 -136t-56 -136t-136 -56z" />
448 <glyph unicode="&#xf1c6;" d="M640 1152v128h-128v-128h128zM768 1024v128h-128v-128h128zM640 896v128h-128v-128h128zM768 768v128h-128v-128h128zM1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400 v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-128v-128h-128v128h-512v-1536h1280zM781 593l107 -349q8 -27 8 -52q0 -83 -72.5 -137.5t-183.5 -54.5t-183.5 54.5t-72.5 137.5q0 25 8 52q21 63 120 396v128h128v-128h79 q22 0 39 -13t23 -34zM640 128q53 0 90.5 19t37.5 45t-37.5 45t-90.5 19t-90.5 -19t-37.5 -45t37.5 -45t90.5 -19z" />
449 <glyph unicode="&#xf1c7;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M620 686q20 -8 20 -30v-544q0 -22 -20 -30q-8 -2 -12 -2q-12 0 -23 9l-166 167h-131q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h131l166 167q16 15 35 7zM1037 -3q31 0 50 24q129 159 129 363t-129 363q-16 21 -43 24t-47 -14q-21 -17 -23.5 -43.5t14.5 -47.5 q100 -123 100 -282t-100 -282q-17 -21 -14.5 -47.5t23.5 -42.5q18 -15 40 -15zM826 145q27 0 47 20q87 93 87 219t-87 219q-18 19 -45 20t-46 -17t-20 -44.5t18 -46.5q52 -57 52 -131t-52 -131q-19 -20 -18 -46.5t20 -44.5q20 -17 44 -17z" />
450 <glyph unicode="&#xf1c8;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M768 768q52 0 90 -38t38 -90v-384q0 -52 -38 -90t-90 -38h-384q-52 0 -90 38t-38 90v384q0 52 38 90t90 38h384zM1260 766q20 -8 20 -30v-576q0 -22 -20 -30q-8 -2 -12 -2q-14 0 -23 9l-265 266v90l265 266q9 9 23 9q4 0 12 -2z" />
451 <glyph unicode="&#xf1c9;" d="M1468 1156q28 -28 48 -76t20 -88v-1152q0 -40 -28 -68t-68 -28h-1344q-40 0 -68 28t-28 68v1600q0 40 28 68t68 28h896q40 0 88 -20t76 -48zM1024 1400v-376h376q-10 29 -22 41l-313 313q-12 12 -41 22zM1408 -128v1024h-416q-40 0 -68 28t-28 68v416h-768v-1536h1280z M480 768q8 11 21 12.5t24 -6.5l51 -38q11 -8 12.5 -21t-6.5 -24l-182 -243l182 -243q8 -11 6.5 -24t-12.5 -21l-51 -38q-11 -8 -24 -6.5t-21 12.5l-226 301q-14 19 0 38zM1282 467q14 -19 0 -38l-226 -301q-8 -11 -21 -12.5t-24 6.5l-51 38q-11 8 -12.5 21t6.5 24l182 243 l-182 243q-8 11 -6.5 24t12.5 21l51 38q11 8 24 6.5t21 -12.5zM662 6q-13 2 -20.5 13t-5.5 24l138 831q2 13 13 20.5t24 5.5l63 -10q13 -2 20.5 -13t5.5 -24l-138 -831q-2 -13 -13 -20.5t-24 -5.5z" />
452 <glyph unicode="&#xf1ca;" d="M1497 709v-198q-101 -23 -198 -23q-65 -136 -165.5 -271t-181.5 -215.5t-128 -106.5q-80 -45 -162 3q-28 17 -60.5 43.5t-85 83.5t-102.5 128.5t-107.5 184t-105.5 244t-91.5 314.5t-70.5 390h283q26 -218 70 -398.5t104.5 -317t121.5 -235.5t140 -195q169 169 287 406 q-142 72 -223 220t-81 333q0 192 104 314.5t284 122.5q178 0 273 -105.5t95 -297.5q0 -159 -58 -286q-7 -1 -19.5 -3t-46 -2t-63 6t-62 25.5t-50.5 51.5q31 103 31 184q0 87 -29 132t-79 45q-53 0 -85 -49.5t-32 -140.5q0 -186 105 -293.5t267 -107.5q62 0 121 14z" />
453 <glyph unicode="&#xf1cb;" horiz-adv-x="1792" d="M216 367l603 -402v359l-334 223zM154 511l193 129l-193 129v-258zM973 -35l603 402l-269 180l-334 -223v-359zM896 458l272 182l-272 182l-272 -182zM485 733l334 223v359l-603 -402zM1445 640l193 -129v258zM1307 733l269 180l-603 402v-359zM1792 913v-546 q0 -41 -34 -64l-819 -546q-21 -13 -43 -13t-43 13l-819 546q-34 23 -34 64v546q0 41 34 64l819 546q21 13 43 13t43 -13l819 -546q34 -23 34 -64z" />
454 <glyph unicode="&#xf1cc;" horiz-adv-x="2048" d="M1800 764q111 -46 179.5 -145.5t68.5 -221.5q0 -164 -118 -280.5t-285 -116.5q-4 0 -11.5 0.5t-10.5 0.5h-1209h-1h-2h-5q-170 10 -288 125.5t-118 280.5q0 110 55 203t147 147q-12 39 -12 82q0 115 82 196t199 81q95 0 172 -58q75 154 222.5 248t326.5 94 q166 0 306 -80.5t221.5 -218.5t81.5 -301q0 -6 -0.5 -18t-0.5 -18zM468 498q0 -122 84 -193t208 -71q137 0 240 99q-16 20 -47.5 56.5t-43.5 50.5q-67 -65 -144 -65q-55 0 -93.5 33.5t-38.5 87.5q0 53 38.5 87t91.5 34q44 0 84.5 -21t73 -55t65 -75t69 -82t77 -75t97 -55 t121.5 -21q121 0 204.5 71.5t83.5 190.5q0 121 -84 192t-207 71q-143 0 -241 -97q14 -16 29.5 -34t34.5 -40t29 -34q66 64 142 64q52 0 92 -33t40 -84q0 -57 -37 -91.5t-94 -34.5q-43 0 -82.5 21t-72 55t-65.5 75t-69.5 82t-77.5 75t-96.5 55t-118.5 21q-122 0 -207 -70.5 t-85 -189.5z" />
455 <glyph unicode="&#xf1cd;" horiz-adv-x="1792" d="M896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM896 1408q-190 0 -361 -90l194 -194q82 28 167 28t167 -28l194 194q-171 90 -361 90zM218 279l194 194 q-28 82 -28 167t28 167l-194 194q-90 -171 -90 -361t90 -361zM896 -128q190 0 361 90l-194 194q-82 -28 -167 -28t-167 28l-194 -194q171 -90 361 -90zM896 256q159 0 271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5t112.5 -271.5 t271.5 -112.5zM1380 473l194 -194q90 171 90 361t-90 361l-194 -194q28 -82 28 -167t-28 -167z" />
456 <glyph unicode="&#xf1ce;" horiz-adv-x="1792" d="M1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348q0 222 101 414.5t276.5 317t390.5 155.5v-260q-221 -45 -366.5 -221t-145.5 -406q0 -130 51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 q0 230 -145.5 406t-366.5 221v260q215 -31 390.5 -155.5t276.5 -317t101 -414.5z" />
457 <glyph unicode="&#xf1d0;" horiz-adv-x="1792" d="M19 662q8 217 116 406t305 318h5q0 -1 -1 -3q-8 -8 -28 -33.5t-52 -76.5t-60 -110.5t-44.5 -135.5t-14 -150.5t39 -157.5t108.5 -154q50 -50 102 -69.5t90.5 -11.5t69.5 23.5t47 32.5l16 16q39 51 53 116.5t6.5 122.5t-21 107t-26.5 80l-14 29q-10 25 -30.5 49.5t-43 41 t-43.5 29.5t-35 19l-13 6l104 115q39 -17 78 -52t59 -61l19 -27q1 48 -18.5 103.5t-40.5 87.5l-20 31l161 183l160 -181q-33 -46 -52.5 -102.5t-22.5 -90.5l-4 -33q22 37 61.5 72.5t67.5 52.5l28 17l103 -115q-44 -14 -85 -50t-60 -65l-19 -29q-31 -56 -48 -133.5t-7 -170 t57 -156.5q33 -45 77.5 -60.5t85 -5.5t76 26.5t57.5 33.5l21 16q60 53 96.5 115t48.5 121.5t10 121.5t-18 118t-37 107.5t-45.5 93t-45 72t-34.5 47.5l-13 17q-14 13 -7 13l10 -3q40 -29 62.5 -46t62 -50t64 -58t58.5 -65t55.5 -77t45.5 -88t38 -103t23.5 -117t10.5 -136 q3 -259 -108 -465t-312 -321t-456 -115q-185 0 -351 74t-283.5 198t-184 293t-60.5 353z" />
458 <glyph unicode="&#xf1d1;" horiz-adv-x="1792" d="M874 -102v-66q-208 6 -385 109.5t-283 275.5l58 34q29 -49 73 -99l65 57q148 -168 368 -212l-17 -86q65 -12 121 -13zM276 428l-83 -28q22 -60 49 -112l-57 -33q-98 180 -98 385t98 385l57 -33q-30 -56 -49 -112l82 -28q-35 -100 -35 -212q0 -109 36 -212zM1528 251 l58 -34q-106 -172 -283 -275.5t-385 -109.5v66q56 1 121 13l-17 86q220 44 368 212l65 -57q44 50 73 99zM1377 805l-233 -80q14 -42 14 -85t-14 -85l232 -80q-31 -92 -98 -169l-185 162q-57 -67 -147 -85l48 -241q-52 -10 -98 -10t-98 10l48 241q-90 18 -147 85l-185 -162 q-67 77 -98 169l232 80q-14 42 -14 85t14 85l-233 80q33 93 99 169l185 -162q59 68 147 86l-48 240q44 10 98 10t98 -10l-48 -240q88 -18 147 -86l185 162q66 -76 99 -169zM874 1448v-66q-65 -2 -121 -13l17 -86q-220 -42 -368 -211l-65 56q-38 -42 -73 -98l-57 33 q106 172 282 275.5t385 109.5zM1705 640q0 -205 -98 -385l-57 33q27 52 49 112l-83 28q36 103 36 212q0 112 -35 212l82 28q-19 56 -49 112l57 33q98 -180 98 -385zM1585 1063l-57 -33q-35 56 -73 98l-65 -56q-148 169 -368 211l17 86q-56 11 -121 13v66q209 -6 385 -109.5 t282 -275.5zM1748 640q0 173 -67.5 331t-181.5 272t-272 181.5t-331 67.5t-331 -67.5t-272 -181.5t-181.5 -272t-67.5 -331t67.5 -331t181.5 -272t272 -181.5t331 -67.5t331 67.5t272 181.5t181.5 272t67.5 331zM1792 640q0 -182 -71 -348t-191 -286t-286 -191t-348 -71 t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348z" />
459 <glyph unicode="&#xf1d2;" d="M582 228q0 -66 -93 -66q-107 0 -107 63q0 64 98 64q102 0 102 -61zM546 694q0 -85 -74 -85q-77 0 -77 84q0 90 77 90q36 0 55 -25.5t19 -63.5zM712 769v125q-78 -29 -135 -29q-50 29 -110 29q-86 0 -145 -57t-59 -143q0 -50 29.5 -102t73.5 -67v-3q-38 -17 -38 -85 q0 -53 41 -77v-3q-113 -37 -113 -139q0 -45 20 -78.5t54 -51t72 -25.5t81 -8q224 0 224 188q0 67 -48 99t-126 46q-27 5 -51.5 20.5t-24.5 39.5q0 44 49 52q77 15 122 70t45 134q0 24 -10 52q37 9 49 13zM771 350h137q-2 27 -2 82v387q0 46 2 69h-137q3 -23 3 -71v-392 q0 -50 -3 -75zM1280 366v121q-30 -21 -68 -21q-53 0 -53 82v225h52q9 0 26.5 -1t26.5 -1v117h-105q0 82 3 102h-140q4 -24 4 -55v-47h-60v-117q36 3 37 3q3 0 11 -0.5t12 -0.5v-2h-2v-217q0 -37 2.5 -64t11.5 -56.5t24.5 -48.5t43.5 -31t66 -12q64 0 108 24zM924 1072 q0 36 -24 63.5t-60 27.5t-60.5 -27t-24.5 -64q0 -36 25 -62.5t60 -26.5t59.5 27t24.5 62zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
460 <glyph unicode="&#xf1d3;" horiz-adv-x="1792" d="M595 22q0 100 -165 100q-158 0 -158 -104q0 -101 172 -101q151 0 151 105zM536 777q0 61 -30 102t-89 41q-124 0 -124 -145q0 -135 124 -135q119 0 119 137zM805 1101v-202q-36 -12 -79 -22q16 -43 16 -84q0 -127 -73 -216.5t-197 -112.5q-40 -8 -59.5 -27t-19.5 -58 q0 -31 22.5 -51.5t58 -32t78.5 -22t86 -25.5t78.5 -37.5t58 -64t22.5 -98.5q0 -304 -363 -304q-69 0 -130 12.5t-116 41t-87.5 82t-32.5 127.5q0 165 182 225v4q-67 41 -67 126q0 109 63 137v4q-72 24 -119.5 108.5t-47.5 165.5q0 139 95 231.5t235 92.5q96 0 178 -47 q98 0 218 47zM1123 220h-222q4 45 4 134v609q0 94 -4 128h222q-4 -33 -4 -124v-613q0 -89 4 -134zM1724 442v-196q-71 -39 -174 -39q-62 0 -107 20t-70 50t-39.5 78t-18.5 92t-4 103v351h2v4q-7 0 -19 1t-18 1q-21 0 -59 -6v190h96v76q0 54 -6 89h227q-6 -41 -6 -165h171 v-190q-15 0 -43.5 2t-42.5 2h-85v-365q0 -131 87 -131q61 0 109 33zM1148 1389q0 -58 -39 -101.5t-96 -43.5q-58 0 -98 43.5t-40 101.5q0 59 39.5 103t98.5 44q58 0 96.5 -44.5t38.5 -102.5z" />
461 <glyph unicode="&#xf1d4;" d="M825 547l343 588h-150q-21 -39 -63.5 -118.5t-68 -128.5t-59.5 -118.5t-60 -128.5h-3q-21 48 -44.5 97t-52 105.5t-46.5 92t-54 104.5t-49 95h-150l323 -589v-435h134v436zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960 q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
462 <glyph unicode="&#xf1d5;" horiz-adv-x="1280" d="M842 964q0 -80 -57 -136.5t-136 -56.5q-60 0 -111 35q-62 -67 -115 -146q-247 -371 -202 -859q1 -22 -12.5 -38.5t-34.5 -18.5h-5q-20 0 -35 13.5t-17 33.5q-14 126 -3.5 247.5t29.5 217t54 186t69 155.5t74 125q61 90 132 165q-16 35 -16 77q0 80 56.5 136.5t136.5 56.5 t136.5 -56.5t56.5 -136.5zM1223 953q0 -158 -78 -292t-212.5 -212t-292.5 -78q-64 0 -131 14q-21 5 -32.5 23.5t-6.5 39.5q5 20 23 31.5t39 7.5q51 -13 108 -13q97 0 186 38t153 102t102 153t38 186t-38 186t-102 153t-153 102t-186 38t-186 -38t-153 -102t-102 -153 t-38 -186q0 -114 52 -218q10 -20 3.5 -40t-25.5 -30t-39.5 -3t-30.5 26q-64 123 -64 265q0 119 46.5 227t124.5 186t186 124t226 46q158 0 292.5 -78t212.5 -212.5t78 -292.5z" />
463 <glyph unicode="&#xf1d6;" horiz-adv-x="1792" d="M270 730q-8 19 -8 52q0 20 11 49t24 45q-1 22 7.5 53t22.5 43q0 139 92.5 288.5t217.5 209.5q139 66 324 66q133 0 266 -55q49 -21 90 -48t71 -56t55 -68t42 -74t32.5 -84.5t25.5 -89.5t22 -98l1 -5q55 -83 55 -150q0 -14 -9 -40t-9 -38q0 -1 1.5 -3.5t3.5 -5t2 -3.5 q77 -114 120.5 -214.5t43.5 -208.5q0 -43 -19.5 -100t-55.5 -57q-9 0 -19.5 7.5t-19 17.5t-19 26t-16 26.5t-13.5 26t-9 17.5q-1 1 -3 1l-5 -4q-59 -154 -132 -223q20 -20 61.5 -38.5t69 -41.5t35.5 -65q-2 -4 -4 -16t-7 -18q-64 -97 -302 -97q-53 0 -110.5 9t-98 20 t-104.5 30q-15 5 -23 7q-14 4 -46 4.5t-40 1.5q-41 -45 -127.5 -65t-168.5 -20q-35 0 -69 1.5t-93 9t-101 20.5t-74.5 40t-32.5 64q0 40 10 59.5t41 48.5q11 2 40.5 13t49.5 12q4 0 14 2q2 2 2 4l-2 3q-48 11 -108 105.5t-73 156.5l-5 3q-4 0 -12 -20q-18 -41 -54.5 -74.5 t-77.5 -37.5h-1q-4 0 -6 4.5t-5 5.5q-23 54 -23 100q0 275 252 466z" />
464 <glyph unicode="&#xf1d7;" horiz-adv-x="2048" d="M580 1075q0 41 -25 66t-66 25q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 66 24.5t25 65.5zM1323 568q0 28 -25.5 50t-65.5 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q40 0 65.5 22t25.5 51zM1087 1075q0 41 -24.5 66t-65.5 25 q-43 0 -76 -25.5t-33 -65.5q0 -39 33 -64.5t76 -25.5q41 0 65.5 24.5t24.5 65.5zM1722 568q0 28 -26 50t-65 22q-27 0 -49.5 -22.5t-22.5 -49.5q0 -28 22.5 -50.5t49.5 -22.5q39 0 65 22t26 51zM1456 965q-31 4 -70 4q-169 0 -311 -77t-223.5 -208.5t-81.5 -287.5 q0 -78 23 -152q-35 -3 -68 -3q-26 0 -50 1.5t-55 6.5t-44.5 7t-54.5 10.5t-50 10.5l-253 -127l72 218q-290 203 -290 490q0 169 97.5 311t264 223.5t363.5 81.5q176 0 332.5 -66t262 -182.5t136.5 -260.5zM2048 404q0 -117 -68.5 -223.5t-185.5 -193.5l55 -181l-199 109 q-150 -37 -218 -37q-169 0 -311 70.5t-223.5 191.5t-81.5 264t81.5 264t223.5 191.5t311 70.5q161 0 303 -70.5t227.5 -192t85.5 -263.5z" />
465 <glyph unicode="&#xf1d8;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-453 185l-242 -295q-18 -23 -49 -23q-13 0 -22 4q-19 7 -30.5 23.5t-11.5 36.5v349l864 1059l-1069 -925l-395 162q-37 14 -40 55q-2 40 32 59l1664 960q15 9 32 9q20 0 36 -11z" />
466 <glyph unicode="&#xf1d9;" horiz-adv-x="1792" d="M1764 1525q33 -24 27 -64l-256 -1536q-5 -29 -32 -45q-14 -8 -31 -8q-11 0 -24 5l-527 215l-298 -327q-18 -21 -47 -21q-14 0 -23 4q-19 7 -30 23.5t-11 36.5v452l-472 193q-37 14 -40 55q-3 39 32 59l1664 960q35 21 68 -2zM1422 26l221 1323l-1434 -827l336 -137 l863 639l-478 -797z" />
467 <glyph unicode="&#xf1da;" d="M1536 640q0 -156 -61 -298t-164 -245t-245 -164t-298 -61q-172 0 -327 72.5t-264 204.5q-7 10 -6.5 22.5t8.5 20.5l137 138q10 9 25 9q16 -2 23 -12q73 -95 179 -147t225 -52q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5 t-163.5 109.5t-198.5 40.5q-98 0 -188 -35.5t-160 -101.5l137 -138q31 -30 14 -69q-17 -40 -59 -40h-448q-26 0 -45 19t-19 45v448q0 42 40 59q39 17 69 -14l130 -129q107 101 244.5 156.5t284.5 55.5q156 0 298 -61t245 -164t164 -245t61 -298zM896 928v-448q0 -14 -9 -23 t-23 -9h-320q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h224v352q0 14 9 23t23 9h64q14 0 23 -9t9 -23z" />
468 <glyph unicode="&#xf1db;" d="M768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103 t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
469 <glyph unicode="&#xf1dc;" horiz-adv-x="1792" d="M1682 -128q-44 0 -132.5 3.5t-133.5 3.5q-44 0 -132 -3.5t-132 -3.5q-24 0 -37 20.5t-13 45.5q0 31 17 46t39 17t51 7t45 15q33 21 33 140l-1 391q0 21 -1 31q-13 4 -50 4h-675q-38 0 -51 -4q-1 -10 -1 -31l-1 -371q0 -142 37 -164q16 -10 48 -13t57 -3.5t45 -15 t20 -45.5q0 -26 -12.5 -48t-36.5 -22q-47 0 -139.5 3.5t-138.5 3.5q-43 0 -128 -3.5t-127 -3.5q-23 0 -35.5 21t-12.5 45q0 30 15.5 45t36 17.5t47.5 7.5t42 15q33 23 33 143l-1 57v813q0 3 0.5 26t0 36.5t-1.5 38.5t-3.5 42t-6.5 36.5t-11 31.5t-16 18q-15 10 -45 12t-53 2 t-41 14t-18 45q0 26 12 48t36 22q46 0 138.5 -3.5t138.5 -3.5q42 0 126.5 3.5t126.5 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17 -43.5t-38.5 -14.5t-49.5 -4t-43 -13q-35 -21 -35 -160l1 -320q0 -21 1 -32q13 -3 39 -3h699q25 0 38 3q1 11 1 32l1 320q0 139 -35 160 q-18 11 -58.5 12.5t-66 13t-25.5 49.5q0 26 12.5 48t37.5 22q44 0 132 -3.5t132 -3.5q43 0 129 3.5t129 3.5q25 0 37.5 -22t12.5 -48q0 -30 -17.5 -44t-40 -14.5t-51.5 -3t-44 -12.5q-35 -23 -35 -161l1 -943q0 -119 34 -140q16 -10 46 -13.5t53.5 -4.5t41.5 -15.5t18 -44.5 q0 -26 -12 -48t-36 -22z" />
470 <glyph unicode="&#xf1dd;" horiz-adv-x="1280" d="M1278 1347v-73q0 -29 -18.5 -61t-42.5 -32q-50 0 -54 -1q-26 -6 -32 -31q-3 -11 -3 -64v-1152q0 -25 -18 -43t-43 -18h-108q-25 0 -43 18t-18 43v1218h-143v-1218q0 -25 -17.5 -43t-43.5 -18h-108q-26 0 -43.5 18t-17.5 43v496q-147 12 -245 59q-126 58 -192 179 q-64 117 -64 259q0 166 88 286q88 118 209 159q111 37 417 37h479q25 0 43 -18t18 -43z" />
471 <glyph unicode="&#xf1de;" d="M352 128v-128h-352v128h352zM704 256q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM864 640v-128h-864v128h864zM224 1152v-128h-224v128h224zM1536 128v-128h-736v128h736zM576 1280q26 0 45 -19t19 -45v-256 q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1216 768q26 0 45 -19t19 -45v-256q0 -26 -19 -45t-45 -19h-256q-26 0 -45 19t-19 45v256q0 26 19 45t45 19h256zM1536 640v-128h-224v128h224zM1536 1152v-128h-864v128h864z" />
472 <glyph unicode="&#xf1e0;" d="M1216 512q133 0 226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5q0 12 2 34l-360 180q-92 -86 -218 -86q-133 0 -226.5 93.5t-93.5 226.5t93.5 226.5t226.5 93.5q126 0 218 -86l360 180q-2 22 -2 34q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5q-126 0 -218 86l-360 -180q2 -22 2 -34t-2 -34l360 -180q92 86 218 86z" />
473 <glyph unicode="&#xf1e1;" d="M1280 341q0 88 -62.5 151t-150.5 63q-84 0 -145 -58l-241 120q2 16 2 23t-2 23l241 120q61 -58 145 -58q88 0 150.5 63t62.5 151t-62.5 150.5t-150.5 62.5t-151 -62.5t-63 -150.5q0 -7 2 -23l-241 -120q-62 57 -145 57q-88 0 -150.5 -62.5t-62.5 -150.5t62.5 -150.5 t150.5 -62.5q83 0 145 57l241 -120q-2 -16 -2 -23q0 -88 63 -150.5t151 -62.5t150.5 62.5t62.5 150.5zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
474 <glyph unicode="&#xf1e2;" horiz-adv-x="1792" d="M571 947q-10 25 -34 35t-49 0q-108 -44 -191 -127t-127 -191q-10 -25 0 -49t35 -34q13 -5 24 -5q42 0 60 40q34 84 98.5 148.5t148.5 98.5q25 11 35 35t0 49zM1513 1303l46 -46l-244 -243l68 -68q19 -19 19 -45.5t-19 -45.5l-64 -64q89 -161 89 -343q0 -143 -55.5 -273.5 t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5t55.5 273.5t150 225t225 150t273.5 55.5q182 0 343 -89l64 64q19 19 45.5 19t45.5 -19l68 -68zM1521 1359q-10 -10 -22 -10q-13 0 -23 10l-91 90q-9 10 -9 23t9 23q10 9 23 9t23 -9l90 -91 q10 -9 10 -22.5t-10 -22.5zM1751 1129q-11 -9 -23 -9t-23 9l-90 91q-10 9 -10 22.5t10 22.5q9 10 22.5 10t22.5 -10l91 -90q9 -10 9 -23t-9 -23zM1792 1312q0 -14 -9 -23t-23 -9h-96q-14 0 -23 9t-9 23t9 23t23 9h96q14 0 23 -9t9 -23zM1600 1504v-96q0 -14 -9 -23t-23 -9 t-23 9t-9 23v96q0 14 9 23t23 9t23 -9t9 -23zM1751 1449l-91 -90q-10 -10 -22 -10q-13 0 -23 10q-10 9 -10 22.5t10 22.5l90 91q10 9 23 9t23 -9q9 -10 9 -23t-9 -23z" />
475 <glyph unicode="&#xf1e3;" horiz-adv-x="1792" d="M609 720l287 208l287 -208l-109 -336h-355zM896 1536q182 0 348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348t71 348t191 286t286 191t348 71zM1515 186q149 203 149 454v3l-102 -89l-240 224l63 323 l134 -12q-150 206 -389 282l53 -124l-287 -159l-287 159l53 124q-239 -76 -389 -282l135 12l62 -323l-240 -224l-102 89v-3q0 -251 149 -454l30 132l326 -40l139 -298l-116 -69q117 -39 240 -39t240 39l-116 69l139 298l326 40z" />
476 <glyph unicode="&#xf1e4;" horiz-adv-x="1792" d="M448 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM256 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM832 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23 v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM640 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM66 768q-28 0 -47 19t-19 46v129h514v-129q0 -27 -19 -46t-46 -19h-383zM1216 224v-192q0 -14 -9 -23t-23 -9h-192 q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1024 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1600 224v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23 zM1408 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 1016v-13h-514v10q0 104 -382 102q-382 -1 -382 -102v-10h-514v13q0 17 8.5 43t34 64t65.5 75.5t110.5 76t160 67.5t224 47.5t293.5 18.5t293 -18.5t224 -47.5 t160.5 -67.5t110.5 -76t65.5 -75.5t34 -64t8.5 -43zM1792 608v-192q0 -14 -9 -23t-23 -9h-192q-14 0 -23 9t-9 23v192q0 14 9 23t23 9h192q14 0 23 -9t9 -23zM1792 962v-129q0 -27 -19 -46t-46 -19h-384q-27 0 -46 19t-19 46v129h514z" />
477 <glyph unicode="&#xf1e5;" horiz-adv-x="1792" d="M704 1216v-768q0 -26 -19 -45t-45 -19v-576q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v512l249 873q7 23 31 23h424zM1024 1216v-704h-256v704h256zM1792 320v-512q0 -26 -19 -45t-45 -19h-512q-26 0 -45 19t-19 45v576q-26 0 -45 19t-19 45v768h424q24 0 31 -23z M736 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23zM1408 1504v-224h-352v224q0 14 9 23t23 9h288q14 0 23 -9t9 -23z" />
478 <glyph unicode="&#xf1e6;" horiz-adv-x="1792" d="M1755 1083q37 -37 37 -90t-37 -91l-401 -400l150 -150l-160 -160q-163 -163 -389.5 -186.5t-411.5 100.5l-362 -362h-181v181l362 362q-124 185 -100.5 411.5t186.5 389.5l160 160l150 -150l400 401q38 37 91 37t90 -37t37 -90.5t-37 -90.5l-400 -401l234 -234l401 400 q38 37 91 37t90 -37z" />
479 <glyph unicode="&#xf1e7;" horiz-adv-x="1792" d="M873 796q0 -83 -63.5 -142.5t-152.5 -59.5t-152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59t152.5 -59t63.5 -143zM1375 796q0 -83 -63 -142.5t-153 -59.5q-89 0 -152.5 59.5t-63.5 142.5q0 84 63.5 143t152.5 59q90 0 153 -59t63 -143zM1600 616v667q0 87 -32 123.5 t-111 36.5h-1112q-83 0 -112.5 -34t-29.5 -126v-673q43 -23 88.5 -40t81 -28t81 -18.5t71 -11t70 -4t58.5 -0.5t56.5 2t44.5 2q68 1 95 -27q6 -6 10 -9q26 -25 61 -51q7 91 118 87q5 0 36.5 -1.5t43 -2t45.5 -1t53 1t54.5 4.5t61 8.5t62 13.5t67 19.5t67.5 27t72 34.5z M1763 621q-121 -149 -372 -252q84 -285 -23 -465q-66 -113 -183 -148q-104 -32 -182 15q-86 51 -82 164l-1 326v1q-8 2 -24.5 6t-23.5 5l-1 -338q4 -114 -83 -164q-79 -47 -183 -15q-117 36 -182 150q-105 180 -22 463q-251 103 -372 252q-25 37 -4 63t60 -1q3 -2 11 -7 t11 -8v694q0 72 47 123t114 51h1257q67 0 114 -51t47 -123v-694l21 15q39 27 60 1t-4 -63z" />
480 <glyph unicode="&#xf1e8;" horiz-adv-x="1792" d="M896 1102v-434h-145v434h145zM1294 1102v-434h-145v434h145zM1294 342l253 254v795h-1194v-1049h326v-217l217 217h398zM1692 1536v-1013l-434 -434h-326l-217 -217h-217v217h-398v1158l109 289h1483z" />
481 <glyph unicode="&#xf1e9;" d="M773 217v-127q-1 -292 -6 -305q-12 -32 -51 -40q-54 -9 -181.5 38t-162.5 89q-13 15 -17 36q-1 12 4 26q4 10 34 47t181 216q1 0 60 70q15 19 39.5 24.5t49.5 -3.5q24 -10 37.5 -29t12.5 -42zM624 468q-3 -55 -52 -70l-120 -39q-275 -88 -292 -88q-35 2 -54 36 q-12 25 -17 75q-8 76 1 166.5t30 124.5t56 32q13 0 202 -77q70 -29 115 -47l84 -34q23 -9 35.5 -30.5t11.5 -48.5zM1450 171q-7 -54 -91.5 -161t-135.5 -127q-37 -14 -63 7q-14 10 -184 287l-47 77q-14 21 -11.5 46t19.5 46q35 43 83 26q1 -1 119 -40q203 -66 242 -79.5 t47 -20.5q28 -22 22 -61zM778 803q5 -102 -54 -122q-58 -17 -114 71l-378 598q-8 35 19 62q41 43 207.5 89.5t224.5 31.5q40 -10 49 -45q3 -18 22 -305.5t24 -379.5zM1440 695q3 -39 -26 -59q-15 -10 -329 -86q-67 -15 -91 -23l1 2q-23 -6 -46 4t-37 32q-30 47 0 87 q1 1 75 102q125 171 150 204t34 39q28 19 65 2q48 -23 123 -133.5t81 -167.5v-3z" />
482 <glyph unicode="&#xf1ea;" horiz-adv-x="2048" d="M1024 1024h-384v-384h384v384zM1152 384v-128h-640v128h640zM1152 1152v-640h-640v640h640zM1792 384v-128h-512v128h512zM1792 640v-128h-512v128h512zM1792 896v-128h-512v128h512zM1792 1152v-128h-512v128h512zM256 192v960h-128v-960q0 -26 19 -45t45 -19t45 19 t19 45zM1920 192v1088h-1536v-1088q0 -33 -11 -64h1483q26 0 45 19t19 45zM2048 1408v-1216q0 -80 -56 -136t-136 -56h-1664q-80 0 -136 56t-56 136v1088h256v128h1792z" />
483 <glyph unicode="&#xf1eb;" horiz-adv-x="2048" d="M1024 13q-20 0 -93 73.5t-73 93.5q0 32 62.5 54t103.5 22t103.5 -22t62.5 -54q0 -20 -73 -93.5t-93 -73.5zM1294 284q-2 0 -40 25t-101.5 50t-128.5 25t-128.5 -25t-101 -50t-40.5 -25q-18 0 -93.5 75t-75.5 93q0 13 10 23q78 77 196 121t233 44t233 -44t196 -121 q10 -10 10 -23q0 -18 -75.5 -93t-93.5 -75zM1567 556q-11 0 -23 8q-136 105 -252 154.5t-268 49.5q-85 0 -170.5 -22t-149 -53t-113.5 -62t-79 -53t-31 -22q-17 0 -92 75t-75 93q0 12 10 22q132 132 320 205t380 73t380 -73t320 -205q10 -10 10 -22q0 -18 -75 -93t-92 -75z M1838 827q-11 0 -22 9q-179 157 -371.5 236.5t-420.5 79.5t-420.5 -79.5t-371.5 -236.5q-11 -9 -22 -9q-17 0 -92.5 75t-75.5 93q0 13 10 23q187 186 445 288t527 102t527 -102t445 -288q10 -10 10 -23q0 -18 -75.5 -93t-92.5 -75z" />
484 <glyph unicode="&#xf1ec;" horiz-adv-x="1792" d="M384 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM384 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 0q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5 t37.5 90.5zM384 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1152 384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM768 768q0 53 -37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1536 0v384q0 52 -38 90t-90 38t-90 -38t-38 -90v-384q0 -52 38 -90t90 -38t90 38t38 90zM1152 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5z M1536 1088v256q0 26 -19 45t-45 19h-1280q-26 0 -45 -19t-19 -45v-256q0 -26 19 -45t45 -19h1280q26 0 45 19t19 45zM1536 768q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1664 1408v-1536q0 -52 -38 -90t-90 -38 h-1408q-52 0 -90 38t-38 90v1536q0 52 38 90t90 38h1408q52 0 90 -38t38 -90z" />
485 <glyph unicode="&#xf1ed;" horiz-adv-x="1792" d="M1112 1090q0 159 -237 159h-70q-32 0 -59.5 -21.5t-34.5 -52.5l-63 -276q-2 -5 -2 -16q0 -24 17 -39.5t41 -15.5h53q69 0 128.5 13t112.5 41t83.5 81.5t30.5 126.5zM1716 938q0 -265 -220 -428q-219 -161 -612 -161h-61q-32 0 -59 -21.5t-34 -52.5l-73 -316 q-8 -36 -40.5 -61.5t-69.5 -25.5h-213q-31 0 -53 20t-22 51q0 10 13 65h151q34 0 64 23.5t38 56.5l73 316q8 33 37.5 57t63.5 24h61q390 0 607 160t217 421q0 129 -51 207q183 -92 183 -335zM1533 1123q0 -264 -221 -428q-218 -161 -612 -161h-60q-32 0 -59.5 -22t-34.5 -53 l-73 -315q-8 -36 -40 -61.5t-69 -25.5h-214q-31 0 -52.5 19.5t-21.5 51.5q0 8 2 20l300 1301q8 36 40.5 61.5t69.5 25.5h444q68 0 125 -4t120.5 -15t113.5 -30t96.5 -50.5t77.5 -74t49.5 -103.5t18.5 -136z" />
486 <glyph unicode="&#xf1ee;" horiz-adv-x="1792" d="M602 949q19 -61 31 -123.5t17 -141.5t-14 -159t-62 -145q-21 81 -67 157t-95.5 127t-99 90.5t-78.5 57.5t-33 19q-62 34 -81.5 100t14.5 128t101 81.5t129 -14.5q138 -83 238 -177zM927 1236q11 -25 20.5 -46t36.5 -100.5t42.5 -150.5t25.5 -179.5t0 -205.5t-47.5 -209.5 t-105.5 -208.5q-51 -72 -138 -72q-54 0 -98 31q-57 40 -69 109t28 127q60 85 81 195t13 199.5t-32 180.5t-39 128t-22 52q-31 63 -8.5 129.5t85.5 97.5q34 17 75 17q47 0 88.5 -25t63.5 -69zM1248 567q-17 -160 -72 -311q-17 131 -63 246q25 174 -5 361q-27 178 -94 342 q114 -90 212 -211q9 -37 15 -80q26 -179 7 -347zM1520 1440q9 -17 23.5 -49.5t43.5 -117.5t50.5 -178t34 -227.5t5 -269t-47 -300t-112.5 -323.5q-22 -48 -66 -75.5t-95 -27.5q-39 0 -74 16q-67 31 -92.5 100t4.5 136q58 126 90 257.5t37.5 239.5t-3.5 213.5t-26.5 180.5 t-38.5 138.5t-32.5 90t-15.5 32.5q-34 65 -11.5 135.5t87.5 104.5q37 20 81 20q49 0 91.5 -25.5t66.5 -70.5z" />
487 <glyph unicode="&#xf1f0;" horiz-adv-x="2304" d="M1975 546h-138q14 37 66 179l3 9q4 10 10 26t9 26l12 -55zM531 611l-58 295q-11 54 -75 54h-268l-2 -13q311 -79 403 -336zM710 960l-162 -438l-17 89q-26 70 -85 129.5t-131 88.5l135 -510h175l261 641h-176zM849 318h166l104 642h-166zM1617 944q-69 27 -149 27 q-123 0 -201 -59t-79 -153q-1 -102 145 -174q48 -23 67 -41t19 -39q0 -30 -30 -46t-69 -16q-86 0 -156 33l-22 11l-23 -144q74 -34 185 -34q130 -1 208.5 59t80.5 160q0 106 -140 174q-49 25 -71 42t-22 38q0 22 24.5 38.5t70.5 16.5q70 1 124 -24l15 -8zM2042 960h-128 q-65 0 -87 -54l-246 -588h174l35 96h212q5 -22 20 -96h154zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
488 <glyph unicode="&#xf1f1;" horiz-adv-x="2304" d="M671 603h-13q-47 0 -47 -32q0 -22 20 -22q17 0 28 15t12 39zM1066 639h62v3q1 4 0.5 6.5t-1 7t-2 8t-4.5 6.5t-7.5 5t-11.5 2q-28 0 -36 -38zM1606 603h-12q-48 0 -48 -32q0 -22 20 -22q17 0 28 15t12 39zM1925 629q0 41 -30 41q-19 0 -31 -20t-12 -51q0 -42 28 -42 q20 0 32.5 20t12.5 52zM480 770h87l-44 -262h-56l32 201l-71 -201h-39l-4 200l-34 -200h-53l44 262h81l2 -163zM733 663q0 -6 -4 -42q-16 -101 -17 -113h-47l1 22q-20 -26 -58 -26q-23 0 -37.5 16t-14.5 42q0 39 26 60.5t73 21.5q14 0 23 -1q0 3 0.5 5.5t1 4.5t0.5 3 q0 20 -36 20q-29 0 -59 -10q0 4 7 48q38 11 67 11q74 0 74 -62zM889 721l-8 -49q-22 3 -41 3q-27 0 -27 -17q0 -8 4.5 -12t21.5 -11q40 -19 40 -60q0 -72 -87 -71q-34 0 -58 6q0 2 7 49q29 -8 51 -8q32 0 32 19q0 7 -4.5 11.5t-21.5 12.5q-43 20 -43 59q0 72 84 72 q30 0 50 -4zM977 721h28l-7 -52h-29q-2 -17 -6.5 -40.5t-7 -38.5t-2.5 -18q0 -16 19 -16q8 0 16 2l-8 -47q-21 -7 -40 -7q-43 0 -45 47q0 12 8 56q3 20 25 146h55zM1180 648q0 -23 -7 -52h-111q-3 -22 10 -33t38 -11q30 0 58 14l-9 -54q-30 -8 -57 -8q-95 0 -95 95 q0 55 27.5 90.5t69.5 35.5q35 0 55.5 -21t20.5 -56zM1319 722q-13 -23 -22 -62q-22 2 -31 -24t-25 -128h-56l3 14q22 130 29 199h51l-3 -33q14 21 25.5 29.5t28.5 4.5zM1506 763l-9 -57q-28 14 -50 14q-31 0 -51 -27.5t-20 -70.5q0 -30 13.5 -47t38.5 -17q21 0 48 13 l-10 -59q-28 -8 -50 -8q-45 0 -71.5 30.5t-26.5 82.5q0 70 35.5 114.5t91.5 44.5q26 0 61 -13zM1668 663q0 -18 -4 -42q-13 -79 -17 -113h-46l1 22q-20 -26 -59 -26q-23 0 -37 16t-14 42q0 39 25.5 60.5t72.5 21.5q15 0 23 -1q2 7 2 13q0 20 -36 20q-29 0 -59 -10q0 4 8 48 q38 11 67 11q73 0 73 -62zM1809 722q-14 -24 -21 -62q-23 2 -31.5 -23t-25.5 -129h-56l3 14q19 104 29 199h52q0 -11 -4 -33q15 21 26.5 29.5t27.5 4.5zM1950 770h56l-43 -262h-53l3 19q-23 -23 -52 -23q-31 0 -49.5 24t-18.5 64q0 53 27.5 92t64.5 39q31 0 53 -29z M2061 640q0 148 -72.5 273t-198 198t-273.5 73q-181 0 -328 -110q127 -116 171 -284h-50q-44 150 -158 253q-114 -103 -158 -253h-50q44 168 171 284q-147 110 -328 110q-148 0 -273.5 -73t-198 -198t-72.5 -273t72.5 -273t198 -198t273.5 -73q181 0 328 110 q-120 111 -165 264h50q46 -138 152 -233q106 95 152 233h50q-45 -153 -165 -264q147 -110 328 -110q148 0 273.5 73t198 198t72.5 273zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
489 <glyph unicode="&#xf1f2;" horiz-adv-x="2304" d="M313 759q0 -51 -36 -84q-29 -26 -89 -26h-17v220h17q61 0 89 -27q36 -31 36 -83zM2089 824q0 -52 -64 -52h-19v101h20q63 0 63 -49zM380 759q0 74 -50 120.5t-129 46.5h-95v-333h95q74 0 119 38q60 51 60 128zM410 593h65v333h-65v-333zM730 694q0 40 -20.5 62t-75.5 42 q-29 10 -39.5 19t-10.5 23q0 16 13.5 26.5t34.5 10.5q29 0 53 -27l34 44q-41 37 -98 37q-44 0 -74 -27.5t-30 -67.5q0 -35 18 -55.5t64 -36.5q37 -13 45 -19q19 -12 19 -34q0 -20 -14 -33.5t-36 -13.5q-48 0 -71 44l-42 -40q44 -64 115 -64q51 0 83 30.5t32 79.5zM1008 604 v77q-37 -37 -78 -37q-49 0 -80.5 32.5t-31.5 82.5q0 48 31.5 81.5t77.5 33.5q43 0 81 -38v77q-40 20 -80 20q-74 0 -125.5 -50.5t-51.5 -123.5t51 -123.5t125 -50.5q42 0 81 19zM2240 0v527q-65 -40 -144.5 -84t-237.5 -117t-329.5 -137.5t-417.5 -134.5t-504 -118h1569 q26 0 45 19t19 45zM1389 757q0 75 -53 128t-128 53t-128 -53t-53 -128t53 -128t128 -53t128 53t53 128zM1541 584l144 342h-71l-90 -224l-89 224h-71l142 -342h35zM1714 593h184v56h-119v90h115v56h-115v74h119v57h-184v-333zM2105 593h80l-105 140q76 16 76 94q0 47 -31 73 t-87 26h-97v-333h65v133h9zM2304 1274v-1268q0 -56 -38.5 -95t-93.5 -39h-2040q-55 0 -93.5 39t-38.5 95v1268q0 56 38.5 95t93.5 39h2040q55 0 93.5 -39t38.5 -95z" />
490 <glyph unicode="&#xf1f3;" horiz-adv-x="2304" d="M119 854h89l-45 108zM740 328l74 79l-70 79h-163v-49h142v-55h-142v-54h159zM898 406l99 -110v217zM1186 453q0 33 -40 33h-84v-69h83q41 0 41 36zM1475 457q0 29 -42 29h-82v-61h81q43 0 43 32zM1197 923q0 29 -42 29h-82v-60h81q43 0 43 31zM1656 854h89l-44 108z M699 1009v-271h-66v212l-94 -212h-57l-94 212v-212h-132l-25 60h-135l-25 -60h-70l116 271h96l110 -257v257h106l85 -184l77 184h108zM1255 453q0 -20 -5.5 -35t-14 -25t-22.5 -16.5t-26 -10t-31.5 -4.5t-31.5 -1t-32.5 0.5t-29.5 0.5v-91h-126l-80 90l-83 -90h-256v271h260 l80 -89l82 89h207q109 0 109 -89zM964 794v-56h-217v271h217v-57h-152v-49h148v-55h-148v-54h152zM2304 235v-229q0 -55 -38.5 -94.5t-93.5 -39.5h-2040q-55 0 -93.5 39.5t-38.5 94.5v678h111l25 61h55l25 -61h218v46l19 -46h113l20 47v-47h541v99l10 1q10 0 10 -14v-86h279 v23q23 -12 55 -18t52.5 -6.5t63 0.5t51.5 1l25 61h56l25 -61h227v58l34 -58h182v378h-180v-44l-25 44h-185v-44l-23 44h-249q-69 0 -109 -22v22h-172v-22q-24 22 -73 22h-628l-43 -97l-43 97h-198v-44l-22 44h-169l-78 -179v391q0 55 38.5 94.5t93.5 39.5h2040 q55 0 93.5 -39.5t38.5 -94.5v-678h-120q-51 0 -81 -22v22h-177q-55 0 -78 -22v22h-316v-22q-31 22 -87 22h-209v-22q-23 22 -91 22h-234l-54 -58l-50 58h-349v-378h343l55 59l52 -59h211v89h21q59 0 90 13v-102h174v99h8q8 0 10 -2t2 -10v-87h529q57 0 88 24v-24h168 q60 0 95 17zM1546 469q0 -23 -12 -43t-34 -29q25 -9 34 -26t9 -46v-54h-65v45q0 33 -12 43.5t-46 10.5h-69v-99h-65v271h154q48 0 77 -15t29 -58zM1269 936q0 -24 -12.5 -44t-33.5 -29q26 -9 34.5 -25.5t8.5 -46.5v-53h-65q0 9 0.5 26.5t0 25t-3 18.5t-8.5 16t-17.5 8.5 t-29.5 3.5h-70v-98h-64v271l153 -1q49 0 78 -14.5t29 -57.5zM1798 327v-56h-216v271h216v-56h-151v-49h148v-55h-148v-54zM1372 1009v-271h-66v271h66zM2065 357q0 -86 -102 -86h-126v58h126q34 0 34 25q0 16 -17 21t-41.5 5t-49.5 3.5t-42 22.5t-17 55q0 39 26 60t66 21 h130v-57h-119q-36 0 -36 -25q0 -16 17.5 -20.5t42 -4t49 -2.5t42 -21.5t17.5 -54.5zM2304 407v-101q-24 -35 -88 -35h-125v58h125q33 0 33 25q0 13 -12.5 19t-31 5.5t-40 2t-40 8t-31 24t-12.5 48.5q0 39 26.5 60t66.5 21h129v-57h-118q-36 0 -36 -25q0 -20 29 -22t68.5 -5 t56.5 -26zM2139 1008v-270h-92l-122 203v-203h-132l-26 60h-134l-25 -60h-75q-129 0 -129 133q0 138 133 138h63v-59q-7 0 -28 1t-28.5 0.5t-23 -2t-21.5 -6.5t-14.5 -13.5t-11.5 -23t-3 -33.5q0 -38 13.5 -58t49.5 -20h29l92 213h97l109 -256v256h99l114 -188v188h66z" />
491 <glyph unicode="&#xf1f4;" horiz-adv-x="2304" d="M322 689h-15q-19 0 -19 18q0 28 19 85q5 15 15 19.5t28 4.5q77 0 77 -49q0 -41 -30.5 -59.5t-74.5 -18.5zM664 528q-47 0 -47 29q0 62 123 62l3 -3q-5 -88 -79 -88zM1438 687h-15q-19 0 -19 19q0 28 19 85q5 15 14.5 19t28.5 4q77 0 77 -49q0 -41 -30.5 -59.5 t-74.5 -18.5zM1780 527q-47 0 -47 30q0 62 123 62l3 -3q-5 -89 -79 -89zM373 894h-128q-8 0 -14.5 -4t-8.5 -7.5t-7 -12.5q-3 -7 -45 -190t-42 -192q0 -7 5.5 -12.5t13.5 -5.5h62q25 0 32.5 34.5l15 69t32.5 34.5q47 0 87.5 7.5t80.5 24.5t63.5 52.5t23.5 84.5 q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM719 798q-38 0 -74 -6q-2 0 -8.5 -1t-9 -1.5l-7.5 -1.5t-7.5 -2t-6.5 -3t-6.5 -4t-5 -5t-4.5 -7t-4 -9q-9 -29 -9 -39t9 -10q5 0 21.5 5t19.5 6q30 8 58 8q74 0 74 -36q0 -11 -10 -14q-8 -2 -18 -3t-21.5 -1.5t-17.5 -1.5 q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5q0 -38 26 -59.5t64 -21.5q24 0 45.5 6.5t33 13t38.5 23.5q-3 -7 -3 -15t5.5 -13.5t12.5 -5.5h56q1 1 7 3.5t7.5 3.5t5 3.5t5 5.5t2.5 8l45 194q4 13 4 30q0 81 -145 81zM1247 793h-74q-22 0 -39 -23q-5 -7 -29.5 -51 t-46.5 -81.5t-26 -38.5l-5 4q0 77 -27 166q-1 5 -3.5 8.5t-6 6.5t-6.5 5t-8.5 3t-8.5 1.5t-9.5 1t-9 0.5h-10h-8.5q-38 0 -38 -21l1 -5q5 -53 25 -151t25 -143q2 -16 2 -24q0 -19 -30.5 -61.5t-30.5 -58.5q0 -13 40 -13q61 0 76 25l245 415q10 20 10 26q0 9 -8 9zM1489 892 h-129q-18 0 -29 -23q-6 -13 -46.5 -191.5t-40.5 -190.5q0 -20 43 -20h7.5h9h9t9.5 1t8.5 2t8.5 3t6.5 4.5t5.5 6t3 8.5l21 91q2 10 10.5 17t19.5 7q47 0 87.5 7t80.5 24.5t63.5 52.5t23.5 84q0 36 -14.5 61t-41 36.5t-53.5 15.5t-62 4zM1835 798q-26 0 -74 -6 q-38 -6 -48 -16q-7 -8 -11 -19q-8 -24 -8 -39q0 -10 8 -10q1 0 41 12q30 8 58 8q74 0 74 -36q0 -12 -10 -14q-4 -1 -57 -7q-38 -4 -64.5 -10t-56.5 -19.5t-45.5 -39t-15.5 -62.5t26 -58.5t64 -21.5q24 0 45 6t34 13t38 24q-3 -15 -3 -16q0 -5 2 -8.5t6.5 -5.5t8 -3.5 t10.5 -2t9.5 -0.5h9.5h8q42 0 48 25l45 194q3 15 3 31q0 81 -145 81zM2157 889h-55q-25 0 -33 -40q-10 -44 -36.5 -167t-42.5 -190v-5q0 -16 16 -18h1h57q10 0 18.5 6.5t10.5 16.5l83 374h-1l1 5q0 7 -5.5 12.5t-13.5 5.5zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048 q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
492 <glyph unicode="&#xf1f5;" horiz-adv-x="2304" d="M1597 633q0 -69 -21 -106q-19 -35 -52 -35q-23 0 -41 9v224q29 30 57 30q57 0 57 -122zM2035 669h-110q6 98 56 98q51 0 54 -98zM476 534q0 59 -33 91.5t-101 57.5q-36 13 -52 24t-16 25q0 26 38 26q58 0 124 -33l18 112q-67 32 -149 32q-77 0 -123 -38q-48 -39 -48 -109 q0 -58 32.5 -90.5t99.5 -56.5q39 -14 54.5 -25.5t15.5 -27.5q0 -31 -48 -31q-29 0 -70 12.5t-72 30.5l-18 -113q72 -41 168 -41q81 0 129 37q51 41 51 117zM771 749l19 111h-96v135l-129 -21l-18 -114l-46 -8l-17 -103h62v-219q0 -84 44 -120q38 -30 111 -30q32 0 79 11v118 q-32 -7 -44 -7q-42 0 -42 50v197h77zM1087 724v139q-15 3 -28 3q-32 0 -55.5 -16t-33.5 -46l-10 56h-131v-471h150v306q26 31 82 31q16 0 26 -2zM1124 389h150v471h-150v-471zM1746 638q0 122 -45 179q-40 52 -111 52q-64 0 -117 -56l-8 47h-132v-645l150 25v151 q36 -11 68 -11q83 0 134 56q61 65 61 202zM1278 986q0 33 -23 56t-56 23t-56 -23t-23 -56t23 -56.5t56 -23.5t56 23.5t23 56.5zM2176 629q0 113 -48 176q-50 64 -144 64q-96 0 -151.5 -66t-55.5 -180q0 -128 63 -188q55 -55 161 -55q101 0 160 40l-16 103q-57 -31 -128 -31 q-43 0 -63 19q-23 19 -28 66h248q2 14 2 52zM2304 1280v-1280q0 -52 -38 -90t-90 -38h-2048q-52 0 -90 38t-38 90v1280q0 52 38 90t90 38h2048q52 0 90 -38t38 -90z" />
493 <glyph unicode="&#xf1f6;" horiz-adv-x="2048" d="M1558 684q61 -356 298 -556q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5zM1024 -176q16 0 16 16t-16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5zM2026 1424q8 -10 7.5 -23.5t-10.5 -22.5 l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5 l418 363q10 8 23.5 7t21.5 -11z" />
494 <glyph unicode="&#xf1f7;" horiz-adv-x="2048" d="M1040 -160q0 16 -16 16q-59 0 -101.5 42.5t-42.5 101.5q0 16 -16 16t-16 -16q0 -73 51.5 -124.5t124.5 -51.5q16 0 16 16zM503 315l877 760q-42 88 -132.5 146.5t-223.5 58.5q-93 0 -169.5 -31.5t-121.5 -80.5t-69 -103t-24 -105q0 -384 -137 -645zM1856 128 q0 -52 -38 -90t-90 -38h-448q0 -106 -75 -181t-181 -75t-180.5 74.5t-75.5 180.5l149 129h757q-166 187 -227 459l111 97q61 -356 298 -556zM1942 1520l84 -96q8 -10 7.5 -23.5t-10.5 -22.5l-1872 -1622q-10 -8 -23.5 -7t-21.5 11l-84 96q-8 10 -7.5 23.5t10.5 21.5l186 161 q-19 32 -19 66q50 42 91 88t85 119.5t74.5 158.5t50 206t19.5 260q0 152 117 282.5t307 158.5q-8 19 -8 39q0 40 28 68t68 28t68 -28t28 -68q0 -20 -8 -39q124 -18 219 -82.5t148 -157.5l418 363q10 8 23.5 7t21.5 -11z" />
495 <glyph unicode="&#xf1f8;" horiz-adv-x="1408" d="M512 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM768 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM1024 160v704q0 14 -9 23t-23 9h-64q-14 0 -23 -9t-9 -23v-704 q0 -14 9 -23t23 -9h64q14 0 23 9t9 23zM480 1152h448l-48 117q-7 9 -17 11h-317q-10 -2 -17 -11zM1408 1120v-64q0 -14 -9 -23t-23 -9h-96v-948q0 -83 -47 -143.5t-113 -60.5h-832q-66 0 -113 58.5t-47 141.5v952h-96q-14 0 -23 9t-9 23v64q0 14 9 23t23 9h309l70 167 q15 37 54 63t79 26h320q40 0 79 -26t54 -63l70 -167h309q14 0 23 -9t9 -23z" />
496 <glyph unicode="&#xf1f9;" d="M1150 462v-109q0 -50 -36.5 -89t-94 -60.5t-118 -32.5t-117.5 -11q-205 0 -342.5 139t-137.5 346q0 203 136 339t339 136q34 0 75.5 -4.5t93 -18t92.5 -34t69 -56.5t28 -81v-109q0 -16 -16 -16h-118q-16 0 -16 16v70q0 43 -65.5 67.5t-137.5 24.5q-140 0 -228.5 -91.5 t-88.5 -237.5q0 -151 91.5 -249.5t233.5 -98.5q68 0 138 24t70 66v70q0 7 4.5 11.5t10.5 4.5h119q6 0 11 -4.5t5 -11.5zM768 1280q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51t248.5 51t204 136.5t136.5 204t51 248.5 t-51 248.5t-136.5 204t-204 136.5t-248.5 51zM1536 640q0 -209 -103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5z" />
497 <glyph unicode="&#xf1fa;" d="M972 761q0 108 -53.5 169t-147.5 61q-63 0 -124 -30.5t-110 -84.5t-79.5 -137t-30.5 -180q0 -112 53.5 -173t150.5 -61q96 0 176 66.5t122.5 166t42.5 203.5zM1536 640q0 -111 -37 -197t-98.5 -135t-131.5 -74.5t-145 -27.5q-6 0 -15.5 -0.5t-16.5 -0.5q-95 0 -142 53 q-28 33 -33 83q-52 -66 -131.5 -110t-173.5 -44q-161 0 -249.5 95.5t-88.5 269.5q0 157 66 290t179 210.5t246 77.5q87 0 155 -35.5t106 -99.5l2 19l11 56q1 6 5.5 12t9.5 6h118q5 0 13 -11q5 -5 3 -16l-120 -614q-5 -24 -5 -48q0 -39 12.5 -52t44.5 -13q28 1 57 5.5t73 24 t77 50t57 89.5t24 137q0 292 -174 466t-466 174q-130 0 -248.5 -51t-204 -136.5t-136.5 -204t-51 -248.5t51 -248.5t136.5 -204t204 -136.5t248.5 -51q228 0 405 144q11 9 24 8t21 -12l41 -49q8 -12 7 -24q-2 -13 -12 -22q-102 -83 -227.5 -128t-258.5 -45q-156 0 -298 61 t-245 164t-164 245t-61 298t61 298t164 245t245 164t298 61q344 0 556 -212t212 -556z" />
498 <glyph unicode="&#xf1fb;" horiz-adv-x="1792" d="M1698 1442q94 -94 94 -226.5t-94 -225.5l-225 -223l104 -104q10 -10 10 -23t-10 -23l-210 -210q-10 -10 -23 -10t-23 10l-105 105l-603 -603q-37 -37 -90 -37h-203l-256 -128l-64 64l128 256v203q0 53 37 90l603 603l-105 105q-10 10 -10 23t10 23l210 210q10 10 23 10 t23 -10l104 -104l223 225q93 94 225.5 94t226.5 -94zM512 64l576 576l-192 192l-576 -576v-192h192z" />
499 <glyph unicode="&#xf1fc;" horiz-adv-x="1792" d="M1615 1536q70 0 122.5 -46.5t52.5 -116.5q0 -63 -45 -151q-332 -629 -465 -752q-97 -91 -218 -91q-126 0 -216.5 92.5t-90.5 219.5q0 128 92 212l638 579q59 54 130 54zM706 502q39 -76 106.5 -130t150.5 -76l1 -71q4 -213 -129.5 -347t-348.5 -134q-123 0 -218 46.5 t-152.5 127.5t-86.5 183t-29 220q7 -5 41 -30t62 -44.5t59 -36.5t46 -17q41 0 55 37q25 66 57.5 112.5t69.5 76t88 47.5t103 25.5t125 10.5z" />
500 <glyph unicode="&#xf1fd;" horiz-adv-x="1792" d="M1792 128v-384h-1792v384q45 0 85 14t59 27.5t47 37.5q30 27 51.5 38t56.5 11t55.5 -11t52.5 -38q29 -25 47 -38t58 -27t86 -14q45 0 85 14.5t58 27t48 37.5q21 19 32.5 27t31 15t43.5 7q35 0 56.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14t85 14t59 27.5t47 37.5 q30 27 51.5 38t56.5 11q34 0 55.5 -11t51.5 -38q28 -24 47 -37.5t59 -27.5t85 -14zM1792 448v-192q-35 0 -55.5 11t-52.5 38q-29 25 -47 38t-58 27t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-22 -19 -33 -27t-31 -15t-44 -7q-35 0 -56.5 11t-51.5 38q-29 25 -47 38t-58 27 t-86 14q-45 0 -85 -14.5t-58 -27t-48 -37.5q-21 -19 -32.5 -27t-31 -15t-43.5 -7q-35 0 -56.5 11t-51.5 38q-28 24 -47 37.5t-59 27.5t-85 14q-46 0 -86 -14t-58 -27t-47 -38q-30 -27 -51.5 -38t-56.5 -11v192q0 80 56 136t136 56h64v448h256v-448h256v448h256v-448h256v448 h256v-448h64q80 0 136 -56t56 -136zM512 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1024 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51 t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150zM1536 1312q0 -77 -36 -118.5t-92 -41.5q-53 0 -90.5 37.5t-37.5 90.5q0 29 9.5 51t23.5 34t31 28t31 31.5t23.5 44.5t9.5 67q38 0 83 -74t45 -150z" />
501 <glyph unicode="&#xf1fe;" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1664 1024l256 -896h-1664v576l448 576l576 -576z" />
502 <glyph unicode="&#xf200;" horiz-adv-x="1792" d="M768 646l546 -546q-106 -108 -247.5 -168t-298.5 -60q-209 0 -385.5 103t-279.5 279.5t-103 385.5t103 385.5t279.5 279.5t385.5 103v-762zM955 640h773q0 -157 -60 -298.5t-168 -247.5zM1664 768h-768v768q209 0 385.5 -103t279.5 -279.5t103 -385.5z" />
503 <glyph unicode="&#xf201;" horiz-adv-x="2048" d="M2048 0v-128h-2048v1536h128v-1408h1920zM1920 1248v-435q0 -21 -19.5 -29.5t-35.5 7.5l-121 121l-633 -633q-10 -10 -23 -10t-23 10l-233 233l-416 -416l-192 192l585 585q10 10 23 10t23 -10l233 -233l464 464l-121 121q-16 16 -7.5 35.5t29.5 19.5h435q14 0 23 -9 t9 -23z" />
504 <glyph unicode="&#xf202;" horiz-adv-x="1792" d="M1292 832q0 -6 10 -41q10 -29 25 -49.5t41 -34t44 -20t55 -16.5q325 -91 325 -332q0 -146 -105.5 -242.5t-254.5 -96.5q-59 0 -111.5 18.5t-91.5 45.5t-77 74.5t-63 87.5t-53.5 103.5t-43.5 103t-39.5 106.5t-35.5 95q-32 81 -61.5 133.5t-73.5 96.5t-104 64t-142 20 q-96 0 -183 -55.5t-138 -144.5t-51 -185q0 -160 106.5 -279.5t263.5 -119.5q177 0 258 95q56 63 83 116l84 -152q-15 -34 -44 -70l1 -1q-131 -152 -388 -152q-147 0 -269.5 79t-190.5 207.5t-68 274.5q0 105 43.5 206t116 176.5t172 121.5t204.5 46q87 0 159 -19t123.5 -50 t95 -80t72.5 -99t58.5 -117t50.5 -124.5t50 -130.5t55 -127q96 -200 233 -200q81 0 138.5 48.5t57.5 128.5q0 42 -19 72t-50.5 46t-72.5 31.5t-84.5 27t-87.5 34t-81 52t-65 82t-39 122.5q-3 16 -3 33q0 110 87.5 192t198.5 78q78 -3 120.5 -14.5t90.5 -53.5h-1 q12 -11 23 -24.5t26 -36t19 -27.5l-129 -99q-26 49 -54 70v1q-23 21 -97 21q-49 0 -84 -33t-35 -83z" />
505 <glyph unicode="&#xf203;" d="M1432 484q0 173 -234 239q-35 10 -53 16.5t-38 25t-29 46.5q0 2 -2 8.5t-3 12t-1 7.5q0 36 24.5 59.5t60.5 23.5q54 0 71 -15h-1q20 -15 39 -51l93 71q-39 54 -49 64q-33 29 -67.5 39t-85.5 10q-80 0 -142 -57.5t-62 -137.5q0 -7 2 -23q16 -96 64.5 -140t148.5 -73 q29 -8 49 -15.5t45 -21.5t38.5 -34.5t13.5 -46.5v-5q1 -58 -40.5 -93t-100.5 -35q-97 0 -167 144q-23 47 -51.5 121.5t-48 125.5t-54 110.5t-74 95.5t-103.5 60.5t-147 24.5q-101 0 -192 -56t-144 -148t-50 -192v-1q4 -108 50.5 -199t133.5 -147.5t196 -56.5q186 0 279 110 q20 27 31 51l-60 109q-42 -80 -99 -116t-146 -36q-115 0 -191 87t-76 204q0 105 82 189t186 84q112 0 170 -53.5t104 -172.5q8 -21 25.5 -68.5t28.5 -76.5t31.5 -74.5t38.5 -74t45.5 -62.5t55.5 -53.5t66 -33t80 -13.5q107 0 183 69.5t76 174.5zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z" />
506 <glyph unicode="&#xf204;" horiz-adv-x="2048" d="M1152 640q0 104 -40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5t198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM1920 640q0 104 -40.5 198.5 t-109.5 163.5t-163.5 109.5t-198.5 40.5h-386q119 -90 188.5 -224t69.5 -288t-69.5 -288t-188.5 -224h386q104 0 198.5 40.5t163.5 109.5t109.5 163.5t40.5 198.5zM2048 640q0 -130 -51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5 t-136.5 204t-51 248.5t51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5z" />
507 <glyph unicode="&#xf205;" horiz-adv-x="2048" d="M0 640q0 130 51 248.5t136.5 204t204 136.5t248.5 51h768q130 0 248.5 -51t204 -136.5t136.5 -204t51 -248.5t-51 -248.5t-136.5 -204t-204 -136.5t-248.5 -51h-768q-130 0 -248.5 51t-204 136.5t-136.5 204t-51 248.5zM1408 128q104 0 198.5 40.5t163.5 109.5 t109.5 163.5t40.5 198.5t-40.5 198.5t-109.5 163.5t-163.5 109.5t-198.5 40.5t-198.5 -40.5t-163.5 -109.5t-109.5 -163.5t-40.5 -198.5t40.5 -198.5t109.5 -163.5t163.5 -109.5t198.5 -40.5z" />
508 <glyph unicode="&#xf206;" horiz-adv-x="2304" d="M762 384h-314q-40 0 -57.5 35t6.5 67l188 251q-65 31 -137 31q-132 0 -226 -94t-94 -226t94 -226t226 -94q115 0 203 72.5t111 183.5zM576 512h186q-18 85 -75 148zM1056 512l288 384h-480l-99 -132q105 -103 126 -252h165zM2176 448q0 132 -94 226t-226 94 q-60 0 -121 -24l174 -260q15 -23 10 -49t-27 -40q-15 -11 -36 -11q-35 0 -53 29l-174 260q-93 -95 -93 -225q0 -132 94 -226t226 -94t226 94t94 226zM2304 448q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5q0 97 39.5 183.5t109.5 149.5l-65 98l-353 -469 q-18 -26 -51 -26h-197q-23 -164 -149 -274t-294 -110q-185 0 -316.5 131.5t-131.5 316.5t131.5 316.5t316.5 131.5q114 0 215 -55l137 183h-224q-26 0 -45 19t-19 45t19 45t45 19h384v-128h435l-85 128h-222q-26 0 -45 19t-19 45t19 45t45 19h256q33 0 53 -28l267 -400 q91 44 192 44q185 0 316.5 -131.5t131.5 -316.5z" />
509 <glyph unicode="&#xf207;" d="M384 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1408 320q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5zM1362 716l-72 384q-5 23 -22.5 37.5t-40.5 14.5 h-918q-23 0 -40.5 -14.5t-22.5 -37.5l-72 -384q-5 -30 14 -53t49 -23h1062q30 0 49 23t14 53zM1136 1328q0 20 -14 34t-34 14h-640q-20 0 -34 -14t-14 -34t14 -34t34 -14h640q20 0 34 14t14 34zM1536 603v-603h-128v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5 t-37.5 90.5v128h-768v-128q0 -53 -37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5v128h-128v603q0 112 25 223l103 454q9 78 97.5 137t230 89t312.5 30t312.5 -30t230 -89t97.5 -137l105 -454q23 -102 23 -223z" />
510 <glyph unicode="&#xf208;" horiz-adv-x="2048" d="M1463 704q0 -35 -25 -60.5t-61 -25.5h-702q-36 0 -61 25.5t-25 60.5t25 60.5t61 25.5h702q36 0 61 -25.5t25 -60.5zM1677 704q0 86 -23 170h-982q-36 0 -61 25t-25 60q0 36 25 61t61 25h908q-88 143 -235 227t-320 84q-177 0 -327.5 -87.5t-238 -237.5t-87.5 -327 q0 -86 23 -170h982q36 0 61 -25t25 -60q0 -36 -25 -61t-61 -25h-908q88 -143 235.5 -227t320.5 -84q132 0 253 51.5t208 139t139 208t52 253.5zM2048 959q0 -35 -25 -60t-61 -25h-131q17 -85 17 -170q0 -167 -65.5 -319.5t-175.5 -263t-262.5 -176t-319.5 -65.5 q-246 0 -448.5 133t-301.5 350h-189q-36 0 -61 25t-25 61q0 35 25 60t61 25h132q-17 85 -17 170q0 167 65.5 319.5t175.5 263t262.5 176t320.5 65.5q245 0 447.5 -133t301.5 -350h188q36 0 61 -25t25 -61z" />
511 <glyph unicode="&#xf209;" horiz-adv-x="1280" d="M953 1158l-114 -328l117 -21q165 451 165 518q0 56 -38 56q-57 0 -130 -225zM654 471l33 -88q37 42 71 67l-33 5.5t-38.5 7t-32.5 8.5zM362 1367q0 -98 159 -521q18 10 49 10q15 0 75 -5l-121 351q-75 220 -123 220q-19 0 -29 -17.5t-10 -37.5zM283 608q0 -36 51.5 -119 t117.5 -153t100 -70q14 0 25.5 13t11.5 27q0 24 -32 102q-13 32 -32 72t-47.5 89t-61.5 81t-62 32q-20 0 -45.5 -27t-25.5 -47zM125 273q0 -41 25 -104q59 -145 183.5 -227t281.5 -82q227 0 382 170q152 169 152 427q0 43 -1 67t-11.5 62t-30.5 56q-56 49 -211.5 75.5 t-270.5 26.5q-37 0 -49 -11q-12 -5 -12 -35q0 -34 21.5 -60t55.5 -40t77.5 -23.5t87.5 -11.5t85 -4t70 0h23q24 0 40 -19q15 -19 19 -55q-28 -28 -96 -54q-61 -22 -93 -46q-64 -46 -108.5 -114t-44.5 -137q0 -31 18.5 -88.5t18.5 -87.5l-3 -12q-4 -12 -4 -14 q-137 10 -146 216q-8 -2 -41 -2q2 -7 2 -21q0 -53 -40.5 -89.5t-94.5 -36.5q-82 0 -166.5 78t-84.5 159q0 34 33 67q52 -64 60 -76q77 -104 133 -104q12 0 26.5 8.5t14.5 20.5q0 34 -87.5 145t-116.5 111q-43 0 -70 -44.5t-27 -90.5zM11 264q0 101 42.5 163t136.5 88 q-28 74 -28 104q0 62 61 123t122 61q29 0 70 -15q-163 462 -163 567q0 80 41 130.5t119 50.5q131 0 325 -581q6 -17 8 -23q6 16 29 79.5t43.5 118.5t54 127.5t64.5 123t70.5 86.5t76.5 36q71 0 112 -49t41 -122q0 -108 -159 -550q61 -15 100.5 -46t58.5 -78t26 -93.5 t7 -110.5q0 -150 -47 -280t-132 -225t-211 -150t-278 -55q-111 0 -223 42q-149 57 -258 191.5t-109 286.5z" />
512 <glyph unicode="&#xf20a;" horiz-adv-x="2048" d="M785 528h207q-14 -158 -98.5 -248.5t-214.5 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-203q-5 64 -35.5 99t-81.5 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t40 -51.5t66 -18q95 0 109 139zM1497 528h206 q-14 -158 -98 -248.5t-214 -90.5q-162 0 -254.5 116t-92.5 316q0 194 93 311.5t233 117.5q148 0 232 -87t97 -247h-204q-4 64 -35 99t-81 35q-57 0 -88.5 -60.5t-31.5 -177.5q0 -48 5 -84t18 -69.5t39.5 -51.5t65.5 -18q49 0 76.5 38t33.5 101zM1856 647q0 207 -15.5 307 t-60.5 161q-6 8 -13.5 14t-21.5 15t-16 11q-86 63 -697 63q-625 0 -710 -63q-5 -4 -17.5 -11.5t-21 -14t-14.5 -14.5q-45 -60 -60 -159.5t-15 -308.5q0 -208 15 -307.5t60 -160.5q6 -8 15 -15t20.5 -14t17.5 -12q44 -33 239.5 -49t470.5 -16q610 0 697 65q5 4 17 11t20.5 14 t13.5 16q46 60 61 159t15 309zM2048 1408v-1536h-2048v1536h2048z" />
513 <glyph unicode="&#xf20b;" d="M992 912v-496q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v496q0 112 -80 192t-192 80h-272v-1152q0 -14 -9 -23t-23 -9h-160q-14 0 -23 9t-9 23v1344q0 14 9 23t23 9h464q135 0 249 -66.5t180.5 -180.5t66.5 -249zM1376 1376v-880q0 -135 -66.5 -249t-180.5 -180.5 t-249 -66.5h-464q-14 0 -23 9t-9 23v960q0 14 9 23t23 9h160q14 0 23 -9t9 -23v-768h272q112 0 192 80t80 192v880q0 14 9 23t23 9h160q14 0 23 -9t9 -23z" />
514 <glyph unicode="&#xf20c;" d="M1311 694v-114q0 -24 -13.5 -38t-37.5 -14h-202q-24 0 -38 14t-14 38v114q0 24 14 38t38 14h202q24 0 37.5 -14t13.5 -38zM821 464v250q0 53 -32.5 85.5t-85.5 32.5h-133q-68 0 -96 -52q-28 52 -96 52h-130q-53 0 -85.5 -32.5t-32.5 -85.5v-250q0 -22 21 -22h55 q22 0 22 22v230q0 24 13.5 38t38.5 14h94q24 0 38 -14t14 -38v-230q0 -22 21 -22h54q22 0 22 22v230q0 24 14 38t38 14h97q24 0 37.5 -14t13.5 -38v-230q0 -22 22 -22h55q21 0 21 22zM1410 560v154q0 53 -33 85.5t-86 32.5h-264q-53 0 -86 -32.5t-33 -85.5v-410 q0 -21 22 -21h55q21 0 21 21v180q31 -42 94 -42h191q53 0 86 32.5t33 85.5zM1536 1176v-1072q0 -96 -68 -164t-164 -68h-1072q-96 0 -164 68t-68 164v1072q0 96 68 164t164 68h1072q96 0 164 -68t68 -164z" />
515 <glyph unicode="&#xf20d;" horiz-adv-x="1792" />
516 <glyph unicode="&#xf20e;" horiz-adv-x="1792" />
517 <glyph unicode="&#xf500;" horiz-adv-x="1792" />
518 </font>
519 </defs></svg>
0 /*!
1 * jQuery JavaScript Library v1.11.1
2 * http://jquery.com/
3 *
4 * Includes Sizzle.js
5 * http://sizzlejs.com/
6 *
7 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
8 * Released under the MIT license
9 * http://jquery.org/license
10 *
11 * Date: 2014-05-01T17:42Z
12 */
13
14 (function( global, factory ) {
15
16 if ( typeof module === "object" && typeof module.exports === "object" ) {
17 // For CommonJS and CommonJS-like environments where a proper window is present,
18 // execute the factory and get jQuery
19 // For environments that do not inherently posses a window with a document
20 // (such as Node.js), expose a jQuery-making factory as module.exports
21 // This accentuates the need for the creation of a real window
22 // e.g. var jQuery = require("jquery")(window);
23 // See ticket #14549 for more info
24 module.exports = global.document ?
25 factory( global, true ) :
26 function( w ) {
27 if ( !w.document ) {
28 throw new Error( "jQuery requires a window with a document" );
29 }
30 return factory( w );
31 };
32 } else {
33 factory( global );
34 }
35
36 // Pass this if window is not defined yet
37 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
38
39 // Can't do this because several apps including ASP.NET trace
40 // the stack via arguments.caller.callee and Firefox dies if
41 // you try to trace through "use strict" call chains. (#13335)
42 // Support: Firefox 18+
43 //
44
45 var deletedIds = [];
46
47 var slice = deletedIds.slice;
48
49 var concat = deletedIds.concat;
50
51 var push = deletedIds.push;
52
53 var indexOf = deletedIds.indexOf;
54
55 var class2type = {};
56
57 var toString = class2type.toString;
58
59 var hasOwn = class2type.hasOwnProperty;
60
61 var support = {};
62
63
64
65 var
66 version = "1.11.1",
67
68 // Define a local copy of jQuery
69 jQuery = function( selector, context ) {
70 // The jQuery object is actually just the init constructor 'enhanced'
71 // Need init if jQuery is called (just allow error to be thrown if not included)
72 return new jQuery.fn.init( selector, context );
73 },
74
75 // Support: Android<4.1, IE<9
76 // Make sure we trim BOM and NBSP
77 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
78
79 // Matches dashed string for camelizing
80 rmsPrefix = /^-ms-/,
81 rdashAlpha = /-([\da-z])/gi,
82
83 // Used by jQuery.camelCase as callback to replace()
84 fcamelCase = function( all, letter ) {
85 return letter.toUpperCase();
86 };
87
88 jQuery.fn = jQuery.prototype = {
89 // The current version of jQuery being used
90 jquery: version,
91
92 constructor: jQuery,
93
94 // Start with an empty selector
95 selector: "",
96
97 // The default length of a jQuery object is 0
98 length: 0,
99
100 toArray: function() {
101 return slice.call( this );
102 },
103
104 // Get the Nth element in the matched element set OR
105 // Get the whole matched element set as a clean array
106 get: function( num ) {
107 return num != null ?
108
109 // Return just the one element from the set
110 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
111
112 // Return all the elements in a clean array
113 slice.call( this );
114 },
115
116 // Take an array of elements and push it onto the stack
117 // (returning the new matched element set)
118 pushStack: function( elems ) {
119
120 // Build a new jQuery matched element set
121 var ret = jQuery.merge( this.constructor(), elems );
122
123 // Add the old object onto the stack (as a reference)
124 ret.prevObject = this;
125 ret.context = this.context;
126
127 // Return the newly-formed element set
128 return ret;
129 },
130
131 // Execute a callback for every element in the matched set.
132 // (You can seed the arguments with an array of args, but this is
133 // only used internally.)
134 each: function( callback, args ) {
135 return jQuery.each( this, callback, args );
136 },
137
138 map: function( callback ) {
139 return this.pushStack( jQuery.map(this, function( elem, i ) {
140 return callback.call( elem, i, elem );
141 }));
142 },
143
144 slice: function() {
145 return this.pushStack( slice.apply( this, arguments ) );
146 },
147
148 first: function() {
149 return this.eq( 0 );
150 },
151
152 last: function() {
153 return this.eq( -1 );
154 },
155
156 eq: function( i ) {
157 var len = this.length,
158 j = +i + ( i < 0 ? len : 0 );
159 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
160 },
161
162 end: function() {
163 return this.prevObject || this.constructor(null);
164 },
165
166 // For internal use only.
167 // Behaves like an Array's method, not like a jQuery method.
168 push: push,
169 sort: deletedIds.sort,
170 splice: deletedIds.splice
171 };
172
173 jQuery.extend = jQuery.fn.extend = function() {
174 var src, copyIsArray, copy, name, options, clone,
175 target = arguments[0] || {},
176 i = 1,
177 length = arguments.length,
178 deep = false;
179
180 // Handle a deep copy situation
181 if ( typeof target === "boolean" ) {
182 deep = target;
183
184 // skip the boolean and the target
185 target = arguments[ i ] || {};
186 i++;
187 }
188
189 // Handle case when target is a string or something (possible in deep copy)
190 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
191 target = {};
192 }
193
194 // extend jQuery itself if only one argument is passed
195 if ( i === length ) {
196 target = this;
197 i--;
198 }
199
200 for ( ; i < length; i++ ) {
201 // Only deal with non-null/undefined values
202 if ( (options = arguments[ i ]) != null ) {
203 // Extend the base object
204 for ( name in options ) {
205 src = target[ name ];
206 copy = options[ name ];
207
208 // Prevent never-ending loop
209 if ( target === copy ) {
210 continue;
211 }
212
213 // Recurse if we're merging plain objects or arrays
214 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
215 if ( copyIsArray ) {
216 copyIsArray = false;
217 clone = src && jQuery.isArray(src) ? src : [];
218
219 } else {
220 clone = src && jQuery.isPlainObject(src) ? src : {};
221 }
222
223 // Never move original objects, clone them
224 target[ name ] = jQuery.extend( deep, clone, copy );
225
226 // Don't bring in undefined values
227 } else if ( copy !== undefined ) {
228 target[ name ] = copy;
229 }
230 }
231 }
232 }
233
234 // Return the modified object
235 return target;
236 };
237
238 jQuery.extend({
239 // Unique for each copy of jQuery on the page
240 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
241
242 // Assume jQuery is ready without the ready module
243 isReady: true,
244
245 error: function( msg ) {
246 throw new Error( msg );
247 },
248
249 noop: function() {},
250
251 // See test/unit/core.js for details concerning isFunction.
252 // Since version 1.3, DOM methods and functions like alert
253 // aren't supported. They return false on IE (#2968).
254 isFunction: function( obj ) {
255 return jQuery.type(obj) === "function";
256 },
257
258 isArray: Array.isArray || function( obj ) {
259 return jQuery.type(obj) === "array";
260 },
261
262 isWindow: function( obj ) {
263 /* jshint eqeqeq: false */
264 return obj != null && obj == obj.window;
265 },
266
267 isNumeric: function( obj ) {
268 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
269 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
270 // subtraction forces infinities to NaN
271 return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
272 },
273
274 isEmptyObject: function( obj ) {
275 var name;
276 for ( name in obj ) {
277 return false;
278 }
279 return true;
280 },
281
282 isPlainObject: function( obj ) {
283 var key;
284
285 // Must be an Object.
286 // Because of IE, we also have to check the presence of the constructor property.
287 // Make sure that DOM nodes and window objects don't pass through, as well
288 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
289 return false;
290 }
291
292 try {
293 // Not own constructor property must be Object
294 if ( obj.constructor &&
295 !hasOwn.call(obj, "constructor") &&
296 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
297 return false;
298 }
299 } catch ( e ) {
300 // IE8,9 Will throw exceptions on certain host objects #9897
301 return false;
302 }
303
304 // Support: IE<9
305 // Handle iteration over inherited properties before own properties.
306 if ( support.ownLast ) {
307 for ( key in obj ) {
308 return hasOwn.call( obj, key );
309 }
310 }
311
312 // Own properties are enumerated firstly, so to speed up,
313 // if last one is own, then all properties are own.
314 for ( key in obj ) {}
315
316 return key === undefined || hasOwn.call( obj, key );
317 },
318
319 type: function( obj ) {
320 if ( obj == null ) {
321 return obj + "";
322 }
323 return typeof obj === "object" || typeof obj === "function" ?
324 class2type[ toString.call(obj) ] || "object" :
325 typeof obj;
326 },
327
328 // Evaluates a script in a global context
329 // Workarounds based on findings by Jim Driscoll
330 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
331 globalEval: function( data ) {
332 if ( data && jQuery.trim( data ) ) {
333 // We use execScript on Internet Explorer
334 // We use an anonymous function so that context is window
335 // rather than jQuery in Firefox
336 ( window.execScript || function( data ) {
337 window[ "eval" ].call( window, data );
338 } )( data );
339 }
340 },
341
342 // Convert dashed to camelCase; used by the css and data modules
343 // Microsoft forgot to hump their vendor prefix (#9572)
344 camelCase: function( string ) {
345 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
346 },
347
348 nodeName: function( elem, name ) {
349 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
350 },
351
352 // args is for internal usage only
353 each: function( obj, callback, args ) {
354 var value,
355 i = 0,
356 length = obj.length,
357 isArray = isArraylike( obj );
358
359 if ( args ) {
360 if ( isArray ) {
361 for ( ; i < length; i++ ) {
362 value = callback.apply( obj[ i ], args );
363
364 if ( value === false ) {
365 break;
366 }
367 }
368 } else {
369 for ( i in obj ) {
370 value = callback.apply( obj[ i ], args );
371
372 if ( value === false ) {
373 break;
374 }
375 }
376 }
377
378 // A special, fast, case for the most common use of each
379 } else {
380 if ( isArray ) {
381 for ( ; i < length; i++ ) {
382 value = callback.call( obj[ i ], i, obj[ i ] );
383
384 if ( value === false ) {
385 break;
386 }
387 }
388 } else {
389 for ( i in obj ) {
390 value = callback.call( obj[ i ], i, obj[ i ] );
391
392 if ( value === false ) {
393 break;
394 }
395 }
396 }
397 }
398
399 return obj;
400 },
401
402 // Support: Android<4.1, IE<9
403 trim: function( text ) {
404 return text == null ?
405 "" :
406 ( text + "" ).replace( rtrim, "" );
407 },
408
409 // results is for internal usage only
410 makeArray: function( arr, results ) {
411 var ret = results || [];
412
413 if ( arr != null ) {
414 if ( isArraylike( Object(arr) ) ) {
415 jQuery.merge( ret,
416 typeof arr === "string" ?
417 [ arr ] : arr
418 );
419 } else {
420 push.call( ret, arr );
421 }
422 }
423
424 return ret;
425 },
426
427 inArray: function( elem, arr, i ) {
428 var len;
429
430 if ( arr ) {
431 if ( indexOf ) {
432 return indexOf.call( arr, elem, i );
433 }
434
435 len = arr.length;
436 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
437
438 for ( ; i < len; i++ ) {
439 // Skip accessing in sparse arrays
440 if ( i in arr && arr[ i ] === elem ) {
441 return i;
442 }
443 }
444 }
445
446 return -1;
447 },
448
449 merge: function( first, second ) {
450 var len = +second.length,
451 j = 0,
452 i = first.length;
453
454 while ( j < len ) {
455 first[ i++ ] = second[ j++ ];
456 }
457
458 // Support: IE<9
459 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
460 if ( len !== len ) {
461 while ( second[j] !== undefined ) {
462 first[ i++ ] = second[ j++ ];
463 }
464 }
465
466 first.length = i;
467
468 return first;
469 },
470
471 grep: function( elems, callback, invert ) {
472 var callbackInverse,
473 matches = [],
474 i = 0,
475 length = elems.length,
476 callbackExpect = !invert;
477
478 // Go through the array, only saving the items
479 // that pass the validator function
480 for ( ; i < length; i++ ) {
481 callbackInverse = !callback( elems[ i ], i );
482 if ( callbackInverse !== callbackExpect ) {
483 matches.push( elems[ i ] );
484 }
485 }
486
487 return matches;
488 },
489
490 // arg is for internal usage only
491 map: function( elems, callback, arg ) {
492 var value,
493 i = 0,
494 length = elems.length,
495 isArray = isArraylike( elems ),
496 ret = [];
497
498 // Go through the array, translating each of the items to their new values
499 if ( isArray ) {
500 for ( ; i < length; i++ ) {
501 value = callback( elems[ i ], i, arg );
502
503 if ( value != null ) {
504 ret.push( value );
505 }
506 }
507
508 // Go through every key on the object,
509 } else {
510 for ( i in elems ) {
511 value = callback( elems[ i ], i, arg );
512
513 if ( value != null ) {
514 ret.push( value );
515 }
516 }
517 }
518
519 // Flatten any nested arrays
520 return concat.apply( [], ret );
521 },
522
523 // A global GUID counter for objects
524 guid: 1,
525
526 // Bind a function to a context, optionally partially applying any
527 // arguments.
528 proxy: function( fn, context ) {
529 var args, proxy, tmp;
530
531 if ( typeof context === "string" ) {
532 tmp = fn[ context ];
533 context = fn;
534 fn = tmp;
535 }
536
537 // Quick check to determine if target is callable, in the spec
538 // this throws a TypeError, but we will just return undefined.
539 if ( !jQuery.isFunction( fn ) ) {
540 return undefined;
541 }
542
543 // Simulated bind
544 args = slice.call( arguments, 2 );
545 proxy = function() {
546 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
547 };
548
549 // Set the guid of unique handler to the same of original handler, so it can be removed
550 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
551
552 return proxy;
553 },
554
555 now: function() {
556 return +( new Date() );
557 },
558
559 // jQuery.support is not used in Core but other projects attach their
560 // properties to it so it needs to exist.
561 support: support
562 });
563
564 // Populate the class2type map
565 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
566 class2type[ "[object " + name + "]" ] = name.toLowerCase();
567 });
568
569 function isArraylike( obj ) {
570 var length = obj.length,
571 type = jQuery.type( obj );
572
573 if ( type === "function" || jQuery.isWindow( obj ) ) {
574 return false;
575 }
576
577 if ( obj.nodeType === 1 && length ) {
578 return true;
579 }
580
581 return type === "array" || length === 0 ||
582 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
583 }
584 var Sizzle =
585 /*!
586 * Sizzle CSS Selector Engine v1.10.19
587 * http://sizzlejs.com/
588 *
589 * Copyright 2013 jQuery Foundation, Inc. and other contributors
590 * Released under the MIT license
591 * http://jquery.org/license
592 *
593 * Date: 2014-04-18
594 */
595 (function( window ) {
596
597 var i,
598 support,
599 Expr,
600 getText,
601 isXML,
602 tokenize,
603 compile,
604 select,
605 outermostContext,
606 sortInput,
607 hasDuplicate,
608
609 // Local document vars
610 setDocument,
611 document,
612 docElem,
613 documentIsHTML,
614 rbuggyQSA,
615 rbuggyMatches,
616 matches,
617 contains,
618
619 // Instance-specific data
620 expando = "sizzle" + -(new Date()),
621 preferredDoc = window.document,
622 dirruns = 0,
623 done = 0,
624 classCache = createCache(),
625 tokenCache = createCache(),
626 compilerCache = createCache(),
627 sortOrder = function( a, b ) {
628 if ( a === b ) {
629 hasDuplicate = true;
630 }
631 return 0;
632 },
633
634 // General-purpose constants
635 strundefined = typeof undefined,
636 MAX_NEGATIVE = 1 << 31,
637
638 // Instance methods
639 hasOwn = ({}).hasOwnProperty,
640 arr = [],
641 pop = arr.pop,
642 push_native = arr.push,
643 push = arr.push,
644 slice = arr.slice,
645 // Use a stripped-down indexOf if we can't use a native one
646 indexOf = arr.indexOf || function( elem ) {
647 var i = 0,
648 len = this.length;
649 for ( ; i < len; i++ ) {
650 if ( this[i] === elem ) {
651 return i;
652 }
653 }
654 return -1;
655 },
656
657 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
658
659 // Regular expressions
660
661 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
662 whitespace = "[\\x20\\t\\r\\n\\f]",
663 // http://www.w3.org/TR/css3-syntax/#characters
664 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
665
666 // Loosely modeled on CSS identifier characters
667 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
668 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
669 identifier = characterEncoding.replace( "w", "w#" ),
670
671 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
672 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
673 // Operator (capture 2)
674 "*([*^$|!~]?=)" + whitespace +
675 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
676 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
677 "*\\]",
678
679 pseudos = ":(" + characterEncoding + ")(?:\\((" +
680 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
681 // 1. quoted (capture 3; capture 4 or capture 5)
682 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
683 // 2. simple (capture 6)
684 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
685 // 3. anything else (capture 2)
686 ".*" +
687 ")\\)|)",
688
689 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
690 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
691
692 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
693 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
694
695 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
696
697 rpseudo = new RegExp( pseudos ),
698 ridentifier = new RegExp( "^" + identifier + "$" ),
699
700 matchExpr = {
701 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
702 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
703 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
704 "ATTR": new RegExp( "^" + attributes ),
705 "PSEUDO": new RegExp( "^" + pseudos ),
706 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
707 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
708 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
709 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
710 // For use in libraries implementing .is()
711 // We use this for POS matching in `select`
712 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
713 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
714 },
715
716 rinputs = /^(?:input|select|textarea|button)$/i,
717 rheader = /^h\d$/i,
718
719 rnative = /^[^{]+\{\s*\[native \w/,
720
721 // Easily-parseable/retrievable ID or TAG or CLASS selectors
722 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
723
724 rsibling = /[+~]/,
725 rescape = /'|\\/g,
726
727 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
728 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
729 funescape = function( _, escaped, escapedWhitespace ) {
730 var high = "0x" + escaped - 0x10000;
731 // NaN means non-codepoint
732 // Support: Firefox<24
733 // Workaround erroneous numeric interpretation of +"0x"
734 return high !== high || escapedWhitespace ?
735 escaped :
736 high < 0 ?
737 // BMP codepoint
738 String.fromCharCode( high + 0x10000 ) :
739 // Supplemental Plane codepoint (surrogate pair)
740 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
741 };
742
743 // Optimize for push.apply( _, NodeList )
744 try {
745 push.apply(
746 (arr = slice.call( preferredDoc.childNodes )),
747 preferredDoc.childNodes
748 );
749 // Support: Android<4.0
750 // Detect silently failing push.apply
751 arr[ preferredDoc.childNodes.length ].nodeType;
752 } catch ( e ) {
753 push = { apply: arr.length ?
754
755 // Leverage slice if possible
756 function( target, els ) {
757 push_native.apply( target, slice.call(els) );
758 } :
759
760 // Support: IE<9
761 // Otherwise append directly
762 function( target, els ) {
763 var j = target.length,
764 i = 0;
765 // Can't trust NodeList.length
766 while ( (target[j++] = els[i++]) ) {}
767 target.length = j - 1;
768 }
769 };
770 }
771
772 function Sizzle( selector, context, results, seed ) {
773 var match, elem, m, nodeType,
774 // QSA vars
775 i, groups, old, nid, newContext, newSelector;
776
777 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
778 setDocument( context );
779 }
780
781 context = context || document;
782 results = results || [];
783
784 if ( !selector || typeof selector !== "string" ) {
785 return results;
786 }
787
788 if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
789 return [];
790 }
791
792 if ( documentIsHTML && !seed ) {
793
794 // Shortcuts
795 if ( (match = rquickExpr.exec( selector )) ) {
796 // Speed-up: Sizzle("#ID")
797 if ( (m = match[1]) ) {
798 if ( nodeType === 9 ) {
799 elem = context.getElementById( m );
800 // Check parentNode to catch when Blackberry 4.6 returns
801 // nodes that are no longer in the document (jQuery #6963)
802 if ( elem && elem.parentNode ) {
803 // Handle the case where IE, Opera, and Webkit return items
804 // by name instead of ID
805 if ( elem.id === m ) {
806 results.push( elem );
807 return results;
808 }
809 } else {
810 return results;
811 }
812 } else {
813 // Context is not a document
814 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
815 contains( context, elem ) && elem.id === m ) {
816 results.push( elem );
817 return results;
818 }
819 }
820
821 // Speed-up: Sizzle("TAG")
822 } else if ( match[2] ) {
823 push.apply( results, context.getElementsByTagName( selector ) );
824 return results;
825
826 // Speed-up: Sizzle(".CLASS")
827 } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
828 push.apply( results, context.getElementsByClassName( m ) );
829 return results;
830 }
831 }
832
833 // QSA path
834 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
835 nid = old = expando;
836 newContext = context;
837 newSelector = nodeType === 9 && selector;
838
839 // qSA works strangely on Element-rooted queries
840 // We can work around this by specifying an extra ID on the root
841 // and working up from there (Thanks to Andrew Dupont for the technique)
842 // IE 8 doesn't work on object elements
843 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
844 groups = tokenize( selector );
845
846 if ( (old = context.getAttribute("id")) ) {
847 nid = old.replace( rescape, "\\$&" );
848 } else {
849 context.setAttribute( "id", nid );
850 }
851 nid = "[id='" + nid + "'] ";
852
853 i = groups.length;
854 while ( i-- ) {
855 groups[i] = nid + toSelector( groups[i] );
856 }
857 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
858 newSelector = groups.join(",");
859 }
860
861 if ( newSelector ) {
862 try {
863 push.apply( results,
864 newContext.querySelectorAll( newSelector )
865 );
866 return results;
867 } catch(qsaError) {
868 } finally {
869 if ( !old ) {
870 context.removeAttribute("id");
871 }
872 }
873 }
874 }
875 }
876
877 // All others
878 return select( selector.replace( rtrim, "$1" ), context, results, seed );
879 }
880
881 /**
882 * Create key-value caches of limited size
883 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
884 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
885 * deleting the oldest entry
886 */
887 function createCache() {
888 var keys = [];
889
890 function cache( key, value ) {
891 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
892 if ( keys.push( key + " " ) > Expr.cacheLength ) {
893 // Only keep the most recent entries
894 delete cache[ keys.shift() ];
895 }
896 return (cache[ key + " " ] = value);
897 }
898 return cache;
899 }
900
901 /**
902 * Mark a function for special use by Sizzle
903 * @param {Function} fn The function to mark
904 */
905 function markFunction( fn ) {
906 fn[ expando ] = true;
907 return fn;
908 }
909
910 /**
911 * Support testing using an element
912 * @param {Function} fn Passed the created div and expects a boolean result
913 */
914 function assert( fn ) {
915 var div = document.createElement("div");
916
917 try {
918 return !!fn( div );
919 } catch (e) {
920 return false;
921 } finally {
922 // Remove from its parent by default
923 if ( div.parentNode ) {
924 div.parentNode.removeChild( div );
925 }
926 // release memory in IE
927 div = null;
928 }
929 }
930
931 /**
932 * Adds the same handler for all of the specified attrs
933 * @param {String} attrs Pipe-separated list of attributes
934 * @param {Function} handler The method that will be applied
935 */
936 function addHandle( attrs, handler ) {
937 var arr = attrs.split("|"),
938 i = attrs.length;
939
940 while ( i-- ) {
941 Expr.attrHandle[ arr[i] ] = handler;
942 }
943 }
944
945 /**
946 * Checks document order of two siblings
947 * @param {Element} a
948 * @param {Element} b
949 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
950 */
951 function siblingCheck( a, b ) {
952 var cur = b && a,
953 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
954 ( ~b.sourceIndex || MAX_NEGATIVE ) -
955 ( ~a.sourceIndex || MAX_NEGATIVE );
956
957 // Use IE sourceIndex if available on both nodes
958 if ( diff ) {
959 return diff;
960 }
961
962 // Check if b follows a
963 if ( cur ) {
964 while ( (cur = cur.nextSibling) ) {
965 if ( cur === b ) {
966 return -1;
967 }
968 }
969 }
970
971 return a ? 1 : -1;
972 }
973
974 /**
975 * Returns a function to use in pseudos for input types
976 * @param {String} type
977 */
978 function createInputPseudo( type ) {
979 return function( elem ) {
980 var name = elem.nodeName.toLowerCase();
981 return name === "input" && elem.type === type;
982 };
983 }
984
985 /**
986 * Returns a function to use in pseudos for buttons
987 * @param {String} type
988 */
989 function createButtonPseudo( type ) {
990 return function( elem ) {
991 var name = elem.nodeName.toLowerCase();
992 return (name === "input" || name === "button") && elem.type === type;
993 };
994 }
995
996 /**
997 * Returns a function to use in pseudos for positionals
998 * @param {Function} fn
999 */
1000 function createPositionalPseudo( fn ) {
1001 return markFunction(function( argument ) {
1002 argument = +argument;
1003 return markFunction(function( seed, matches ) {
1004 var j,
1005 matchIndexes = fn( [], seed.length, argument ),
1006 i = matchIndexes.length;
1007
1008 // Match elements found at the specified indexes
1009 while ( i-- ) {
1010 if ( seed[ (j = matchIndexes[i]) ] ) {
1011 seed[j] = !(matches[j] = seed[j]);
1012 }
1013 }
1014 });
1015 });
1016 }
1017
1018 /**
1019 * Checks a node for validity as a Sizzle context
1020 * @param {Element|Object=} context
1021 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1022 */
1023 function testContext( context ) {
1024 return context && typeof context.getElementsByTagName !== strundefined && context;
1025 }
1026
1027 // Expose support vars for convenience
1028 support = Sizzle.support = {};
1029
1030 /**
1031 * Detects XML nodes
1032 * @param {Element|Object} elem An element or a document
1033 * @returns {Boolean} True iff elem is a non-HTML XML node
1034 */
1035 isXML = Sizzle.isXML = function( elem ) {
1036 // documentElement is verified for cases where it doesn't yet exist
1037 // (such as loading iframes in IE - #4833)
1038 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1039 return documentElement ? documentElement.nodeName !== "HTML" : false;
1040 };
1041
1042 /**
1043 * Sets document-related variables once based on the current document
1044 * @param {Element|Object} [doc] An element or document object to use to set the document
1045 * @returns {Object} Returns the current document
1046 */
1047 setDocument = Sizzle.setDocument = function( node ) {
1048 var hasCompare,
1049 doc = node ? node.ownerDocument || node : preferredDoc,
1050 parent = doc.defaultView;
1051
1052 // If no document and documentElement is available, return
1053 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1054 return document;
1055 }
1056
1057 // Set our document
1058 document = doc;
1059 docElem = doc.documentElement;
1060
1061 // Support tests
1062 documentIsHTML = !isXML( doc );
1063
1064 // Support: IE>8
1065 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1066 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1067 // IE6-8 do not support the defaultView property so parent will be undefined
1068 if ( parent && parent !== parent.top ) {
1069 // IE11 does not have attachEvent, so all must suffer
1070 if ( parent.addEventListener ) {
1071 parent.addEventListener( "unload", function() {
1072 setDocument();
1073 }, false );
1074 } else if ( parent.attachEvent ) {
1075 parent.attachEvent( "onunload", function() {
1076 setDocument();
1077 });
1078 }
1079 }
1080
1081 /* Attributes
1082 ---------------------------------------------------------------------- */
1083
1084 // Support: IE<8
1085 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1086 support.attributes = assert(function( div ) {
1087 div.className = "i";
1088 return !div.getAttribute("className");
1089 });
1090
1091 /* getElement(s)By*
1092 ---------------------------------------------------------------------- */
1093
1094 // Check if getElementsByTagName("*") returns only elements
1095 support.getElementsByTagName = assert(function( div ) {
1096 div.appendChild( doc.createComment("") );
1097 return !div.getElementsByTagName("*").length;
1098 });
1099
1100 // Check if getElementsByClassName can be trusted
1101 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
1102 div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1103
1104 // Support: Safari<4
1105 // Catch class over-caching
1106 div.firstChild.className = "i";
1107 // Support: Opera<10
1108 // Catch gEBCN failure to find non-leading classes
1109 return div.getElementsByClassName("i").length === 2;
1110 });
1111
1112 // Support: IE<10
1113 // Check if getElementById returns elements by name
1114 // The broken getElementById methods don't pick up programatically-set names,
1115 // so use a roundabout getElementsByName test
1116 support.getById = assert(function( div ) {
1117 docElem.appendChild( div ).id = expando;
1118 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1119 });
1120
1121 // ID find and filter
1122 if ( support.getById ) {
1123 Expr.find["ID"] = function( id, context ) {
1124 if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1125 var m = context.getElementById( id );
1126 // Check parentNode to catch when Blackberry 4.6 returns
1127 // nodes that are no longer in the document #6963
1128 return m && m.parentNode ? [ m ] : [];
1129 }
1130 };
1131 Expr.filter["ID"] = function( id ) {
1132 var attrId = id.replace( runescape, funescape );
1133 return function( elem ) {
1134 return elem.getAttribute("id") === attrId;
1135 };
1136 };
1137 } else {
1138 // Support: IE6/7
1139 // getElementById is not reliable as a find shortcut
1140 delete Expr.find["ID"];
1141
1142 Expr.filter["ID"] = function( id ) {
1143 var attrId = id.replace( runescape, funescape );
1144 return function( elem ) {
1145 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1146 return node && node.value === attrId;
1147 };
1148 };
1149 }
1150
1151 // Tag
1152 Expr.find["TAG"] = support.getElementsByTagName ?
1153 function( tag, context ) {
1154 if ( typeof context.getElementsByTagName !== strundefined ) {
1155 return context.getElementsByTagName( tag );
1156 }
1157 } :
1158 function( tag, context ) {
1159 var elem,
1160 tmp = [],
1161 i = 0,
1162 results = context.getElementsByTagName( tag );
1163
1164 // Filter out possible comments
1165 if ( tag === "*" ) {
1166 while ( (elem = results[i++]) ) {
1167 if ( elem.nodeType === 1 ) {
1168 tmp.push( elem );
1169 }
1170 }
1171
1172 return tmp;
1173 }
1174 return results;
1175 };
1176
1177 // Class
1178 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1179 if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1180 return context.getElementsByClassName( className );
1181 }
1182 };
1183
1184 /* QSA/matchesSelector
1185 ---------------------------------------------------------------------- */
1186
1187 // QSA and matchesSelector support
1188
1189 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1190 rbuggyMatches = [];
1191
1192 // qSa(:focus) reports false when true (Chrome 21)
1193 // We allow this because of a bug in IE8/9 that throws an error
1194 // whenever `document.activeElement` is accessed on an iframe
1195 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1196 // See http://bugs.jquery.com/ticket/13378
1197 rbuggyQSA = [];
1198
1199 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1200 // Build QSA regex
1201 // Regex strategy adopted from Diego Perini
1202 assert(function( div ) {
1203 // Select is set to empty string on purpose
1204 // This is to test IE's treatment of not explicitly
1205 // setting a boolean content attribute,
1206 // since its presence should be enough
1207 // http://bugs.jquery.com/ticket/12359
1208 div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
1209
1210 // Support: IE8, Opera 11-12.16
1211 // Nothing should be selected when empty strings follow ^= or $= or *=
1212 // The test attribute must be unknown in Opera but "safe" for WinRT
1213 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1214 if ( div.querySelectorAll("[msallowclip^='']").length ) {
1215 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1216 }
1217
1218 // Support: IE8
1219 // Boolean attributes and "value" are not treated correctly
1220 if ( !div.querySelectorAll("[selected]").length ) {
1221 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1222 }
1223
1224 // Webkit/Opera - :checked should return selected option elements
1225 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1226 // IE8 throws error here and will not see later tests
1227 if ( !div.querySelectorAll(":checked").length ) {
1228 rbuggyQSA.push(":checked");
1229 }
1230 });
1231
1232 assert(function( div ) {
1233 // Support: Windows 8 Native Apps
1234 // The type and name attributes are restricted during .innerHTML assignment
1235 var input = doc.createElement("input");
1236 input.setAttribute( "type", "hidden" );
1237 div.appendChild( input ).setAttribute( "name", "D" );
1238
1239 // Support: IE8
1240 // Enforce case-sensitivity of name attribute
1241 if ( div.querySelectorAll("[name=d]").length ) {
1242 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1243 }
1244
1245 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1246 // IE8 throws error here and will not see later tests
1247 if ( !div.querySelectorAll(":enabled").length ) {
1248 rbuggyQSA.push( ":enabled", ":disabled" );
1249 }
1250
1251 // Opera 10-11 does not throw on post-comma invalid pseudos
1252 div.querySelectorAll("*,:x");
1253 rbuggyQSA.push(",.*:");
1254 });
1255 }
1256
1257 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1258 docElem.webkitMatchesSelector ||
1259 docElem.mozMatchesSelector ||
1260 docElem.oMatchesSelector ||
1261 docElem.msMatchesSelector) )) ) {
1262
1263 assert(function( div ) {
1264 // Check to see if it's possible to do matchesSelector
1265 // on a disconnected node (IE 9)
1266 support.disconnectedMatch = matches.call( div, "div" );
1267
1268 // This should fail with an exception
1269 // Gecko does not error, returns false instead
1270 matches.call( div, "[s!='']:x" );
1271 rbuggyMatches.push( "!=", pseudos );
1272 });
1273 }
1274
1275 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1276 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1277
1278 /* Contains
1279 ---------------------------------------------------------------------- */
1280 hasCompare = rnative.test( docElem.compareDocumentPosition );
1281
1282 // Element contains another
1283 // Purposefully does not implement inclusive descendent
1284 // As in, an element does not contain itself
1285 contains = hasCompare || rnative.test( docElem.contains ) ?
1286 function( a, b ) {
1287 var adown = a.nodeType === 9 ? a.documentElement : a,
1288 bup = b && b.parentNode;
1289 return a === bup || !!( bup && bup.nodeType === 1 && (
1290 adown.contains ?
1291 adown.contains( bup ) :
1292 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1293 ));
1294 } :
1295 function( a, b ) {
1296 if ( b ) {
1297 while ( (b = b.parentNode) ) {
1298 if ( b === a ) {
1299 return true;
1300 }
1301 }
1302 }
1303 return false;
1304 };
1305
1306 /* Sorting
1307 ---------------------------------------------------------------------- */
1308
1309 // Document order sorting
1310 sortOrder = hasCompare ?
1311 function( a, b ) {
1312
1313 // Flag for duplicate removal
1314 if ( a === b ) {
1315 hasDuplicate = true;
1316 return 0;
1317 }
1318
1319 // Sort on method existence if only one input has compareDocumentPosition
1320 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1321 if ( compare ) {
1322 return compare;
1323 }
1324
1325 // Calculate position if both inputs belong to the same document
1326 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1327 a.compareDocumentPosition( b ) :
1328
1329 // Otherwise we know they are disconnected
1330 1;
1331
1332 // Disconnected nodes
1333 if ( compare & 1 ||
1334 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1335
1336 // Choose the first element that is related to our preferred document
1337 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1338 return -1;
1339 }
1340 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1341 return 1;
1342 }
1343
1344 // Maintain original order
1345 return sortInput ?
1346 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1347 0;
1348 }
1349
1350 return compare & 4 ? -1 : 1;
1351 } :
1352 function( a, b ) {
1353 // Exit early if the nodes are identical
1354 if ( a === b ) {
1355 hasDuplicate = true;
1356 return 0;
1357 }
1358
1359 var cur,
1360 i = 0,
1361 aup = a.parentNode,
1362 bup = b.parentNode,
1363 ap = [ a ],
1364 bp = [ b ];
1365
1366 // Parentless nodes are either documents or disconnected
1367 if ( !aup || !bup ) {
1368 return a === doc ? -1 :
1369 b === doc ? 1 :
1370 aup ? -1 :
1371 bup ? 1 :
1372 sortInput ?
1373 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1374 0;
1375
1376 // If the nodes are siblings, we can do a quick check
1377 } else if ( aup === bup ) {
1378 return siblingCheck( a, b );
1379 }
1380
1381 // Otherwise we need full lists of their ancestors for comparison
1382 cur = a;
1383 while ( (cur = cur.parentNode) ) {
1384 ap.unshift( cur );
1385 }
1386 cur = b;
1387 while ( (cur = cur.parentNode) ) {
1388 bp.unshift( cur );
1389 }
1390
1391 // Walk down the tree looking for a discrepancy
1392 while ( ap[i] === bp[i] ) {
1393 i++;
1394 }
1395
1396 return i ?
1397 // Do a sibling check if the nodes have a common ancestor
1398 siblingCheck( ap[i], bp[i] ) :
1399
1400 // Otherwise nodes in our document sort first
1401 ap[i] === preferredDoc ? -1 :
1402 bp[i] === preferredDoc ? 1 :
1403 0;
1404 };
1405
1406 return doc;
1407 };
1408
1409 Sizzle.matches = function( expr, elements ) {
1410 return Sizzle( expr, null, null, elements );
1411 };
1412
1413 Sizzle.matchesSelector = function( elem, expr ) {
1414 // Set document vars if needed
1415 if ( ( elem.ownerDocument || elem ) !== document ) {
1416 setDocument( elem );
1417 }
1418
1419 // Make sure that attribute selectors are quoted
1420 expr = expr.replace( rattributeQuotes, "='$1']" );
1421
1422 if ( support.matchesSelector && documentIsHTML &&
1423 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1424 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1425
1426 try {
1427 var ret = matches.call( elem, expr );
1428
1429 // IE 9's matchesSelector returns false on disconnected nodes
1430 if ( ret || support.disconnectedMatch ||
1431 // As well, disconnected nodes are said to be in a document
1432 // fragment in IE 9
1433 elem.document && elem.document.nodeType !== 11 ) {
1434 return ret;
1435 }
1436 } catch(e) {}
1437 }
1438
1439 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1440 };
1441
1442 Sizzle.contains = function( context, elem ) {
1443 // Set document vars if needed
1444 if ( ( context.ownerDocument || context ) !== document ) {
1445 setDocument( context );
1446 }
1447 return contains( context, elem );
1448 };
1449
1450 Sizzle.attr = function( elem, name ) {
1451 // Set document vars if needed
1452 if ( ( elem.ownerDocument || elem ) !== document ) {
1453 setDocument( elem );
1454 }
1455
1456 var fn = Expr.attrHandle[ name.toLowerCase() ],
1457 // Don't get fooled by Object.prototype properties (jQuery #13807)
1458 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1459 fn( elem, name, !documentIsHTML ) :
1460 undefined;
1461
1462 return val !== undefined ?
1463 val :
1464 support.attributes || !documentIsHTML ?
1465 elem.getAttribute( name ) :
1466 (val = elem.getAttributeNode(name)) && val.specified ?
1467 val.value :
1468 null;
1469 };
1470
1471 Sizzle.error = function( msg ) {
1472 throw new Error( "Syntax error, unrecognized expression: " + msg );
1473 };
1474
1475 /**
1476 * Document sorting and removing duplicates
1477 * @param {ArrayLike} results
1478 */
1479 Sizzle.uniqueSort = function( results ) {
1480 var elem,
1481 duplicates = [],
1482 j = 0,
1483 i = 0;
1484
1485 // Unless we *know* we can detect duplicates, assume their presence
1486 hasDuplicate = !support.detectDuplicates;
1487 sortInput = !support.sortStable && results.slice( 0 );
1488 results.sort( sortOrder );
1489
1490 if ( hasDuplicate ) {
1491 while ( (elem = results[i++]) ) {
1492 if ( elem === results[ i ] ) {
1493 j = duplicates.push( i );
1494 }
1495 }
1496 while ( j-- ) {
1497 results.splice( duplicates[ j ], 1 );
1498 }
1499 }
1500
1501 // Clear input after sorting to release objects
1502 // See https://github.com/jquery/sizzle/pull/225
1503 sortInput = null;
1504
1505 return results;
1506 };
1507
1508 /**
1509 * Utility function for retrieving the text value of an array of DOM nodes
1510 * @param {Array|Element} elem
1511 */
1512 getText = Sizzle.getText = function( elem ) {
1513 var node,
1514 ret = "",
1515 i = 0,
1516 nodeType = elem.nodeType;
1517
1518 if ( !nodeType ) {
1519 // If no nodeType, this is expected to be an array
1520 while ( (node = elem[i++]) ) {
1521 // Do not traverse comment nodes
1522 ret += getText( node );
1523 }
1524 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1525 // Use textContent for elements
1526 // innerText usage removed for consistency of new lines (jQuery #11153)
1527 if ( typeof elem.textContent === "string" ) {
1528 return elem.textContent;
1529 } else {
1530 // Traverse its children
1531 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1532 ret += getText( elem );
1533 }
1534 }
1535 } else if ( nodeType === 3 || nodeType === 4 ) {
1536 return elem.nodeValue;
1537 }
1538 // Do not include comment or processing instruction nodes
1539
1540 return ret;
1541 };
1542
1543 Expr = Sizzle.selectors = {
1544
1545 // Can be adjusted by the user
1546 cacheLength: 50,
1547
1548 createPseudo: markFunction,
1549
1550 match: matchExpr,
1551
1552 attrHandle: {},
1553
1554 find: {},
1555
1556 relative: {
1557 ">": { dir: "parentNode", first: true },
1558 " ": { dir: "parentNode" },
1559 "+": { dir: "previousSibling", first: true },
1560 "~": { dir: "previousSibling" }
1561 },
1562
1563 preFilter: {
1564 "ATTR": function( match ) {
1565 match[1] = match[1].replace( runescape, funescape );
1566
1567 // Move the given value to match[3] whether quoted or unquoted
1568 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1569
1570 if ( match[2] === "~=" ) {
1571 match[3] = " " + match[3] + " ";
1572 }
1573
1574 return match.slice( 0, 4 );
1575 },
1576
1577 "CHILD": function( match ) {
1578 /* matches from matchExpr["CHILD"]
1579 1 type (only|nth|...)
1580 2 what (child|of-type)
1581 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1582 4 xn-component of xn+y argument ([+-]?\d*n|)
1583 5 sign of xn-component
1584 6 x of xn-component
1585 7 sign of y-component
1586 8 y of y-component
1587 */
1588 match[1] = match[1].toLowerCase();
1589
1590 if ( match[1].slice( 0, 3 ) === "nth" ) {
1591 // nth-* requires argument
1592 if ( !match[3] ) {
1593 Sizzle.error( match[0] );
1594 }
1595
1596 // numeric x and y parameters for Expr.filter.CHILD
1597 // remember that false/true cast respectively to 0/1
1598 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1599 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1600
1601 // other types prohibit arguments
1602 } else if ( match[3] ) {
1603 Sizzle.error( match[0] );
1604 }
1605
1606 return match;
1607 },
1608
1609 "PSEUDO": function( match ) {
1610 var excess,
1611 unquoted = !match[6] && match[2];
1612
1613 if ( matchExpr["CHILD"].test( match[0] ) ) {
1614 return null;
1615 }
1616
1617 // Accept quoted arguments as-is
1618 if ( match[3] ) {
1619 match[2] = match[4] || match[5] || "";
1620
1621 // Strip excess characters from unquoted arguments
1622 } else if ( unquoted && rpseudo.test( unquoted ) &&
1623 // Get excess from tokenize (recursively)
1624 (excess = tokenize( unquoted, true )) &&
1625 // advance to the next closing parenthesis
1626 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1627
1628 // excess is a negative index
1629 match[0] = match[0].slice( 0, excess );
1630 match[2] = unquoted.slice( 0, excess );
1631 }
1632
1633 // Return only captures needed by the pseudo filter method (type and argument)
1634 return match.slice( 0, 3 );
1635 }
1636 },
1637
1638 filter: {
1639
1640 "TAG": function( nodeNameSelector ) {
1641 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1642 return nodeNameSelector === "*" ?
1643 function() { return true; } :
1644 function( elem ) {
1645 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1646 };
1647 },
1648
1649 "CLASS": function( className ) {
1650 var pattern = classCache[ className + " " ];
1651
1652 return pattern ||
1653 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1654 classCache( className, function( elem ) {
1655 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
1656 });
1657 },
1658
1659 "ATTR": function( name, operator, check ) {
1660 return function( elem ) {
1661 var result = Sizzle.attr( elem, name );
1662
1663 if ( result == null ) {
1664 return operator === "!=";
1665 }
1666 if ( !operator ) {
1667 return true;
1668 }
1669
1670 result += "";
1671
1672 return operator === "=" ? result === check :
1673 operator === "!=" ? result !== check :
1674 operator === "^=" ? check && result.indexOf( check ) === 0 :
1675 operator === "*=" ? check && result.indexOf( check ) > -1 :
1676 operator === "$=" ? check && result.slice( -check.length ) === check :
1677 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
1678 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1679 false;
1680 };
1681 },
1682
1683 "CHILD": function( type, what, argument, first, last ) {
1684 var simple = type.slice( 0, 3 ) !== "nth",
1685 forward = type.slice( -4 ) !== "last",
1686 ofType = what === "of-type";
1687
1688 return first === 1 && last === 0 ?
1689
1690 // Shortcut for :nth-*(n)
1691 function( elem ) {
1692 return !!elem.parentNode;
1693 } :
1694
1695 function( elem, context, xml ) {
1696 var cache, outerCache, node, diff, nodeIndex, start,
1697 dir = simple !== forward ? "nextSibling" : "previousSibling",
1698 parent = elem.parentNode,
1699 name = ofType && elem.nodeName.toLowerCase(),
1700 useCache = !xml && !ofType;
1701
1702 if ( parent ) {
1703
1704 // :(first|last|only)-(child|of-type)
1705 if ( simple ) {
1706 while ( dir ) {
1707 node = elem;
1708 while ( (node = node[ dir ]) ) {
1709 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1710 return false;
1711 }
1712 }
1713 // Reverse direction for :only-* (if we haven't yet done so)
1714 start = dir = type === "only" && !start && "nextSibling";
1715 }
1716 return true;
1717 }
1718
1719 start = [ forward ? parent.firstChild : parent.lastChild ];
1720
1721 // non-xml :nth-child(...) stores cache data on `parent`
1722 if ( forward && useCache ) {
1723 // Seek `elem` from a previously-cached index
1724 outerCache = parent[ expando ] || (parent[ expando ] = {});
1725 cache = outerCache[ type ] || [];
1726 nodeIndex = cache[0] === dirruns && cache[1];
1727 diff = cache[0] === dirruns && cache[2];
1728 node = nodeIndex && parent.childNodes[ nodeIndex ];
1729
1730 while ( (node = ++nodeIndex && node && node[ dir ] ||
1731
1732 // Fallback to seeking `elem` from the start
1733 (diff = nodeIndex = 0) || start.pop()) ) {
1734
1735 // When found, cache indexes on `parent` and break
1736 if ( node.nodeType === 1 && ++diff && node === elem ) {
1737 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1738 break;
1739 }
1740 }
1741
1742 // Use previously-cached element index if available
1743 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1744 diff = cache[1];
1745
1746 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1747 } else {
1748 // Use the same loop as above to seek `elem` from the start
1749 while ( (node = ++nodeIndex && node && node[ dir ] ||
1750 (diff = nodeIndex = 0) || start.pop()) ) {
1751
1752 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1753 // Cache the index of each encountered element
1754 if ( useCache ) {
1755 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1756 }
1757
1758 if ( node === elem ) {
1759 break;
1760 }
1761 }
1762 }
1763 }
1764
1765 // Incorporate the offset, then check against cycle size
1766 diff -= last;
1767 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1768 }
1769 };
1770 },
1771
1772 "PSEUDO": function( pseudo, argument ) {
1773 // pseudo-class names are case-insensitive
1774 // http://www.w3.org/TR/selectors/#pseudo-classes
1775 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1776 // Remember that setFilters inherits from pseudos
1777 var args,
1778 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1779 Sizzle.error( "unsupported pseudo: " + pseudo );
1780
1781 // The user may use createPseudo to indicate that
1782 // arguments are needed to create the filter function
1783 // just as Sizzle does
1784 if ( fn[ expando ] ) {
1785 return fn( argument );
1786 }
1787
1788 // But maintain support for old signatures
1789 if ( fn.length > 1 ) {
1790 args = [ pseudo, pseudo, "", argument ];
1791 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1792 markFunction(function( seed, matches ) {
1793 var idx,
1794 matched = fn( seed, argument ),
1795 i = matched.length;
1796 while ( i-- ) {
1797 idx = indexOf.call( seed, matched[i] );
1798 seed[ idx ] = !( matches[ idx ] = matched[i] );
1799 }
1800 }) :
1801 function( elem ) {
1802 return fn( elem, 0, args );
1803 };
1804 }
1805
1806 return fn;
1807 }
1808 },
1809
1810 pseudos: {
1811 // Potentially complex pseudos
1812 "not": markFunction(function( selector ) {
1813 // Trim the selector passed to compile
1814 // to avoid treating leading and trailing
1815 // spaces as combinators
1816 var input = [],
1817 results = [],
1818 matcher = compile( selector.replace( rtrim, "$1" ) );
1819
1820 return matcher[ expando ] ?
1821 markFunction(function( seed, matches, context, xml ) {
1822 var elem,
1823 unmatched = matcher( seed, null, xml, [] ),
1824 i = seed.length;
1825
1826 // Match elements unmatched by `matcher`
1827 while ( i-- ) {
1828 if ( (elem = unmatched[i]) ) {
1829 seed[i] = !(matches[i] = elem);
1830 }
1831 }
1832 }) :
1833 function( elem, context, xml ) {
1834 input[0] = elem;
1835 matcher( input, null, xml, results );
1836 return !results.pop();
1837 };
1838 }),
1839
1840 "has": markFunction(function( selector ) {
1841 return function( elem ) {
1842 return Sizzle( selector, elem ).length > 0;
1843 };
1844 }),
1845
1846 "contains": markFunction(function( text ) {
1847 return function( elem ) {
1848 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1849 };
1850 }),
1851
1852 // "Whether an element is represented by a :lang() selector
1853 // is based solely on the element's language value
1854 // being equal to the identifier C,
1855 // or beginning with the identifier C immediately followed by "-".
1856 // The matching of C against the element's language value is performed case-insensitively.
1857 // The identifier C does not have to be a valid language name."
1858 // http://www.w3.org/TR/selectors/#lang-pseudo
1859 "lang": markFunction( function( lang ) {
1860 // lang value must be a valid identifier
1861 if ( !ridentifier.test(lang || "") ) {
1862 Sizzle.error( "unsupported lang: " + lang );
1863 }
1864 lang = lang.replace( runescape, funescape ).toLowerCase();
1865 return function( elem ) {
1866 var elemLang;
1867 do {
1868 if ( (elemLang = documentIsHTML ?
1869 elem.lang :
1870 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1871
1872 elemLang = elemLang.toLowerCase();
1873 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1874 }
1875 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1876 return false;
1877 };
1878 }),
1879
1880 // Miscellaneous
1881 "target": function( elem ) {
1882 var hash = window.location && window.location.hash;
1883 return hash && hash.slice( 1 ) === elem.id;
1884 },
1885
1886 "root": function( elem ) {
1887 return elem === docElem;
1888 },
1889
1890 "focus": function( elem ) {
1891 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1892 },
1893
1894 // Boolean properties
1895 "enabled": function( elem ) {
1896 return elem.disabled === false;
1897 },
1898
1899 "disabled": function( elem ) {
1900 return elem.disabled === true;
1901 },
1902
1903 "checked": function( elem ) {
1904 // In CSS3, :checked should return both checked and selected elements
1905 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1906 var nodeName = elem.nodeName.toLowerCase();
1907 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1908 },
1909
1910 "selected": function( elem ) {
1911 // Accessing this property makes selected-by-default
1912 // options in Safari work properly
1913 if ( elem.parentNode ) {
1914 elem.parentNode.selectedIndex;
1915 }
1916
1917 return elem.selected === true;
1918 },
1919
1920 // Contents
1921 "empty": function( elem ) {
1922 // http://www.w3.org/TR/selectors/#empty-pseudo
1923 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1924 // but not by others (comment: 8; processing instruction: 7; etc.)
1925 // nodeType < 6 works because attributes (2) do not appear as children
1926 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1927 if ( elem.nodeType < 6 ) {
1928 return false;
1929 }
1930 }
1931 return true;
1932 },
1933
1934 "parent": function( elem ) {
1935 return !Expr.pseudos["empty"]( elem );
1936 },
1937
1938 // Element/input types
1939 "header": function( elem ) {
1940 return rheader.test( elem.nodeName );
1941 },
1942
1943 "input": function( elem ) {
1944 return rinputs.test( elem.nodeName );
1945 },
1946
1947 "button": function( elem ) {
1948 var name = elem.nodeName.toLowerCase();
1949 return name === "input" && elem.type === "button" || name === "button";
1950 },
1951
1952 "text": function( elem ) {
1953 var attr;
1954 return elem.nodeName.toLowerCase() === "input" &&
1955 elem.type === "text" &&
1956
1957 // Support: IE<8
1958 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1959 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1960 },
1961
1962 // Position-in-collection
1963 "first": createPositionalPseudo(function() {
1964 return [ 0 ];
1965 }),
1966
1967 "last": createPositionalPseudo(function( matchIndexes, length ) {
1968 return [ length - 1 ];
1969 }),
1970
1971 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1972 return [ argument < 0 ? argument + length : argument ];
1973 }),
1974
1975 "even": createPositionalPseudo(function( matchIndexes, length ) {
1976 var i = 0;
1977 for ( ; i < length; i += 2 ) {
1978 matchIndexes.push( i );
1979 }
1980 return matchIndexes;
1981 }),
1982
1983 "odd": createPositionalPseudo(function( matchIndexes, length ) {
1984 var i = 1;
1985 for ( ; i < length; i += 2 ) {
1986 matchIndexes.push( i );
1987 }
1988 return matchIndexes;
1989 }),
1990
1991 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1992 var i = argument < 0 ? argument + length : argument;
1993 for ( ; --i >= 0; ) {
1994 matchIndexes.push( i );
1995 }
1996 return matchIndexes;
1997 }),
1998
1999 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2000 var i = argument < 0 ? argument + length : argument;
2001 for ( ; ++i < length; ) {
2002 matchIndexes.push( i );
2003 }
2004 return matchIndexes;
2005 })
2006 }
2007 };
2008
2009 Expr.pseudos["nth"] = Expr.pseudos["eq"];
2010
2011 // Add button/input type pseudos
2012 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2013 Expr.pseudos[ i ] = createInputPseudo( i );
2014 }
2015 for ( i in { submit: true, reset: true } ) {
2016 Expr.pseudos[ i ] = createButtonPseudo( i );
2017 }
2018
2019 // Easy API for creating new setFilters
2020 function setFilters() {}
2021 setFilters.prototype = Expr.filters = Expr.pseudos;
2022 Expr.setFilters = new setFilters();
2023
2024 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2025 var matched, match, tokens, type,
2026 soFar, groups, preFilters,
2027 cached = tokenCache[ selector + " " ];
2028
2029 if ( cached ) {
2030 return parseOnly ? 0 : cached.slice( 0 );
2031 }
2032
2033 soFar = selector;
2034 groups = [];
2035 preFilters = Expr.preFilter;
2036
2037 while ( soFar ) {
2038
2039 // Comma and first run
2040 if ( !matched || (match = rcomma.exec( soFar )) ) {
2041 if ( match ) {
2042 // Don't consume trailing commas as valid
2043 soFar = soFar.slice( match[0].length ) || soFar;
2044 }
2045 groups.push( (tokens = []) );
2046 }
2047
2048 matched = false;
2049
2050 // Combinators
2051 if ( (match = rcombinators.exec( soFar )) ) {
2052 matched = match.shift();
2053 tokens.push({
2054 value: matched,
2055 // Cast descendant combinators to space
2056 type: match[0].replace( rtrim, " " )
2057 });
2058 soFar = soFar.slice( matched.length );
2059 }
2060
2061 // Filters
2062 for ( type in Expr.filter ) {
2063 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2064 (match = preFilters[ type ]( match ))) ) {
2065 matched = match.shift();
2066 tokens.push({
2067 value: matched,
2068 type: type,
2069 matches: match
2070 });
2071 soFar = soFar.slice( matched.length );
2072 }
2073 }
2074
2075 if ( !matched ) {
2076 break;
2077 }
2078 }
2079
2080 // Return the length of the invalid excess
2081 // if we're just parsing
2082 // Otherwise, throw an error or return tokens
2083 return parseOnly ?
2084 soFar.length :
2085 soFar ?
2086 Sizzle.error( selector ) :
2087 // Cache the tokens
2088 tokenCache( selector, groups ).slice( 0 );
2089 };
2090
2091 function toSelector( tokens ) {
2092 var i = 0,
2093 len = tokens.length,
2094 selector = "";
2095 for ( ; i < len; i++ ) {
2096 selector += tokens[i].value;
2097 }
2098 return selector;
2099 }
2100
2101 function addCombinator( matcher, combinator, base ) {
2102 var dir = combinator.dir,
2103 checkNonElements = base && dir === "parentNode",
2104 doneName = done++;
2105
2106 return combinator.first ?
2107 // Check against closest ancestor/preceding element
2108 function( elem, context, xml ) {
2109 while ( (elem = elem[ dir ]) ) {
2110 if ( elem.nodeType === 1 || checkNonElements ) {
2111 return matcher( elem, context, xml );
2112 }
2113 }
2114 } :
2115
2116 // Check against all ancestor/preceding elements
2117 function( elem, context, xml ) {
2118 var oldCache, outerCache,
2119 newCache = [ dirruns, doneName ];
2120
2121 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2122 if ( xml ) {
2123 while ( (elem = elem[ dir ]) ) {
2124 if ( elem.nodeType === 1 || checkNonElements ) {
2125 if ( matcher( elem, context, xml ) ) {
2126 return true;
2127 }
2128 }
2129 }
2130 } else {
2131 while ( (elem = elem[ dir ]) ) {
2132 if ( elem.nodeType === 1 || checkNonElements ) {
2133 outerCache = elem[ expando ] || (elem[ expando ] = {});
2134 if ( (oldCache = outerCache[ dir ]) &&
2135 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2136
2137 // Assign to newCache so results back-propagate to previous elements
2138 return (newCache[ 2 ] = oldCache[ 2 ]);
2139 } else {
2140 // Reuse newcache so results back-propagate to previous elements
2141 outerCache[ dir ] = newCache;
2142
2143 // A match means we're done; a fail means we have to keep checking
2144 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2145 return true;
2146 }
2147 }
2148 }
2149 }
2150 }
2151 };
2152 }
2153
2154 function elementMatcher( matchers ) {
2155 return matchers.length > 1 ?
2156 function( elem, context, xml ) {
2157 var i = matchers.length;
2158 while ( i-- ) {
2159 if ( !matchers[i]( elem, context, xml ) ) {
2160 return false;
2161 }
2162 }
2163 return true;
2164 } :
2165 matchers[0];
2166 }
2167
2168 function multipleContexts( selector, contexts, results ) {
2169 var i = 0,
2170 len = contexts.length;
2171 for ( ; i < len; i++ ) {
2172 Sizzle( selector, contexts[i], results );
2173 }
2174 return results;
2175 }
2176
2177 function condense( unmatched, map, filter, context, xml ) {
2178 var elem,
2179 newUnmatched = [],
2180 i = 0,
2181 len = unmatched.length,
2182 mapped = map != null;
2183
2184 for ( ; i < len; i++ ) {
2185 if ( (elem = unmatched[i]) ) {
2186 if ( !filter || filter( elem, context, xml ) ) {
2187 newUnmatched.push( elem );
2188 if ( mapped ) {
2189 map.push( i );
2190 }
2191 }
2192 }
2193 }
2194
2195 return newUnmatched;
2196 }
2197
2198 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2199 if ( postFilter && !postFilter[ expando ] ) {
2200 postFilter = setMatcher( postFilter );
2201 }
2202 if ( postFinder && !postFinder[ expando ] ) {
2203 postFinder = setMatcher( postFinder, postSelector );
2204 }
2205 return markFunction(function( seed, results, context, xml ) {
2206 var temp, i, elem,
2207 preMap = [],
2208 postMap = [],
2209 preexisting = results.length,
2210
2211 // Get initial elements from seed or context
2212 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2213
2214 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2215 matcherIn = preFilter && ( seed || !selector ) ?
2216 condense( elems, preMap, preFilter, context, xml ) :
2217 elems,
2218
2219 matcherOut = matcher ?
2220 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2221 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2222
2223 // ...intermediate processing is necessary
2224 [] :
2225
2226 // ...otherwise use results directly
2227 results :
2228 matcherIn;
2229
2230 // Find primary matches
2231 if ( matcher ) {
2232 matcher( matcherIn, matcherOut, context, xml );
2233 }
2234
2235 // Apply postFilter
2236 if ( postFilter ) {
2237 temp = condense( matcherOut, postMap );
2238 postFilter( temp, [], context, xml );
2239
2240 // Un-match failing elements by moving them back to matcherIn
2241 i = temp.length;
2242 while ( i-- ) {
2243 if ( (elem = temp[i]) ) {
2244 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2245 }
2246 }
2247 }
2248
2249 if ( seed ) {
2250 if ( postFinder || preFilter ) {
2251 if ( postFinder ) {
2252 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2253 temp = [];
2254 i = matcherOut.length;
2255 while ( i-- ) {
2256 if ( (elem = matcherOut[i]) ) {
2257 // Restore matcherIn since elem is not yet a final match
2258 temp.push( (matcherIn[i] = elem) );
2259 }
2260 }
2261 postFinder( null, (matcherOut = []), temp, xml );
2262 }
2263
2264 // Move matched elements from seed to results to keep them synchronized
2265 i = matcherOut.length;
2266 while ( i-- ) {
2267 if ( (elem = matcherOut[i]) &&
2268 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2269
2270 seed[temp] = !(results[temp] = elem);
2271 }
2272 }
2273 }
2274
2275 // Add elements to results, through postFinder if defined
2276 } else {
2277 matcherOut = condense(
2278 matcherOut === results ?
2279 matcherOut.splice( preexisting, matcherOut.length ) :
2280 matcherOut
2281 );
2282 if ( postFinder ) {
2283 postFinder( null, results, matcherOut, xml );
2284 } else {
2285 push.apply( results, matcherOut );
2286 }
2287 }
2288 });
2289 }
2290
2291 function matcherFromTokens( tokens ) {
2292 var checkContext, matcher, j,
2293 len = tokens.length,
2294 leadingRelative = Expr.relative[ tokens[0].type ],
2295 implicitRelative = leadingRelative || Expr.relative[" "],
2296 i = leadingRelative ? 1 : 0,
2297
2298 // The foundational matcher ensures that elements are reachable from top-level context(s)
2299 matchContext = addCombinator( function( elem ) {
2300 return elem === checkContext;
2301 }, implicitRelative, true ),
2302 matchAnyContext = addCombinator( function( elem ) {
2303 return indexOf.call( checkContext, elem ) > -1;
2304 }, implicitRelative, true ),
2305 matchers = [ function( elem, context, xml ) {
2306 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2307 (checkContext = context).nodeType ?
2308 matchContext( elem, context, xml ) :
2309 matchAnyContext( elem, context, xml ) );
2310 } ];
2311
2312 for ( ; i < len; i++ ) {
2313 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2314 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2315 } else {
2316 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2317
2318 // Return special upon seeing a positional matcher
2319 if ( matcher[ expando ] ) {
2320 // Find the next relative operator (if any) for proper handling
2321 j = ++i;
2322 for ( ; j < len; j++ ) {
2323 if ( Expr.relative[ tokens[j].type ] ) {
2324 break;
2325 }
2326 }
2327 return setMatcher(
2328 i > 1 && elementMatcher( matchers ),
2329 i > 1 && toSelector(
2330 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2331 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2332 ).replace( rtrim, "$1" ),
2333 matcher,
2334 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2335 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2336 j < len && toSelector( tokens )
2337 );
2338 }
2339 matchers.push( matcher );
2340 }
2341 }
2342
2343 return elementMatcher( matchers );
2344 }
2345
2346 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2347 var bySet = setMatchers.length > 0,
2348 byElement = elementMatchers.length > 0,
2349 superMatcher = function( seed, context, xml, results, outermost ) {
2350 var elem, j, matcher,
2351 matchedCount = 0,
2352 i = "0",
2353 unmatched = seed && [],
2354 setMatched = [],
2355 contextBackup = outermostContext,
2356 // We must always have either seed elements or outermost context
2357 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2358 // Use integer dirruns iff this is the outermost matcher
2359 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2360 len = elems.length;
2361
2362 if ( outermost ) {
2363 outermostContext = context !== document && context;
2364 }
2365
2366 // Add elements passing elementMatchers directly to results
2367 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2368 // Support: IE<9, Safari
2369 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2370 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2371 if ( byElement && elem ) {
2372 j = 0;
2373 while ( (matcher = elementMatchers[j++]) ) {
2374 if ( matcher( elem, context, xml ) ) {
2375 results.push( elem );
2376 break;
2377 }
2378 }
2379 if ( outermost ) {
2380 dirruns = dirrunsUnique;
2381 }
2382 }
2383
2384 // Track unmatched elements for set filters
2385 if ( bySet ) {
2386 // They will have gone through all possible matchers
2387 if ( (elem = !matcher && elem) ) {
2388 matchedCount--;
2389 }
2390
2391 // Lengthen the array for every element, matched or not
2392 if ( seed ) {
2393 unmatched.push( elem );
2394 }
2395 }
2396 }
2397
2398 // Apply set filters to unmatched elements
2399 matchedCount += i;
2400 if ( bySet && i !== matchedCount ) {
2401 j = 0;
2402 while ( (matcher = setMatchers[j++]) ) {
2403 matcher( unmatched, setMatched, context, xml );
2404 }
2405
2406 if ( seed ) {
2407 // Reintegrate element matches to eliminate the need for sorting
2408 if ( matchedCount > 0 ) {
2409 while ( i-- ) {
2410 if ( !(unmatched[i] || setMatched[i]) ) {
2411 setMatched[i] = pop.call( results );
2412 }
2413 }
2414 }
2415
2416 // Discard index placeholder values to get only actual matches
2417 setMatched = condense( setMatched );
2418 }
2419
2420 // Add matches to results
2421 push.apply( results, setMatched );
2422
2423 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2424 if ( outermost && !seed && setMatched.length > 0 &&
2425 ( matchedCount + setMatchers.length ) > 1 ) {
2426
2427 Sizzle.uniqueSort( results );
2428 }
2429 }
2430
2431 // Override manipulation of globals by nested matchers
2432 if ( outermost ) {
2433 dirruns = dirrunsUnique;
2434 outermostContext = contextBackup;
2435 }
2436
2437 return unmatched;
2438 };
2439
2440 return bySet ?
2441 markFunction( superMatcher ) :
2442 superMatcher;
2443 }
2444
2445 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2446 var i,
2447 setMatchers = [],
2448 elementMatchers = [],
2449 cached = compilerCache[ selector + " " ];
2450
2451 if ( !cached ) {
2452 // Generate a function of recursive functions that can be used to check each element
2453 if ( !match ) {
2454 match = tokenize( selector );
2455 }
2456 i = match.length;
2457 while ( i-- ) {
2458 cached = matcherFromTokens( match[i] );
2459 if ( cached[ expando ] ) {
2460 setMatchers.push( cached );
2461 } else {
2462 elementMatchers.push( cached );
2463 }
2464 }
2465
2466 // Cache the compiled function
2467 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2468
2469 // Save selector and tokenization
2470 cached.selector = selector;
2471 }
2472 return cached;
2473 };
2474
2475 /**
2476 * A low-level selection function that works with Sizzle's compiled
2477 * selector functions
2478 * @param {String|Function} selector A selector or a pre-compiled
2479 * selector function built with Sizzle.compile
2480 * @param {Element} context
2481 * @param {Array} [results]
2482 * @param {Array} [seed] A set of elements to match against
2483 */
2484 select = Sizzle.select = function( selector, context, results, seed ) {
2485 var i, tokens, token, type, find,
2486 compiled = typeof selector === "function" && selector,
2487 match = !seed && tokenize( (selector = compiled.selector || selector) );
2488
2489 results = results || [];
2490
2491 // Try to minimize operations if there is no seed and only one group
2492 if ( match.length === 1 ) {
2493
2494 // Take a shortcut and set the context if the root selector is an ID
2495 tokens = match[0] = match[0].slice( 0 );
2496 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2497 support.getById && context.nodeType === 9 && documentIsHTML &&
2498 Expr.relative[ tokens[1].type ] ) {
2499
2500 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2501 if ( !context ) {
2502 return results;
2503
2504 // Precompiled matchers will still verify ancestry, so step up a level
2505 } else if ( compiled ) {
2506 context = context.parentNode;
2507 }
2508
2509 selector = selector.slice( tokens.shift().value.length );
2510 }
2511
2512 // Fetch a seed set for right-to-left matching
2513 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2514 while ( i-- ) {
2515 token = tokens[i];
2516
2517 // Abort if we hit a combinator
2518 if ( Expr.relative[ (type = token.type) ] ) {
2519 break;
2520 }
2521 if ( (find = Expr.find[ type ]) ) {
2522 // Search, expanding context for leading sibling combinators
2523 if ( (seed = find(
2524 token.matches[0].replace( runescape, funescape ),
2525 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2526 )) ) {
2527
2528 // If seed is empty or no tokens remain, we can return early
2529 tokens.splice( i, 1 );
2530 selector = seed.length && toSelector( tokens );
2531 if ( !selector ) {
2532 push.apply( results, seed );
2533 return results;
2534 }
2535
2536 break;
2537 }
2538 }
2539 }
2540 }
2541
2542 // Compile and execute a filtering function if one is not provided
2543 // Provide `match` to avoid retokenization if we modified the selector above
2544 ( compiled || compile( selector, match ) )(
2545 seed,
2546 context,
2547 !documentIsHTML,
2548 results,
2549 rsibling.test( selector ) && testContext( context.parentNode ) || context
2550 );
2551 return results;
2552 };
2553
2554 // One-time assignments
2555
2556 // Sort stability
2557 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2558
2559 // Support: Chrome<14
2560 // Always assume duplicates if they aren't passed to the comparison function
2561 support.detectDuplicates = !!hasDuplicate;
2562
2563 // Initialize against the default document
2564 setDocument();
2565
2566 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2567 // Detached nodes confoundingly follow *each other*
2568 support.sortDetached = assert(function( div1 ) {
2569 // Should return 1, but returns 4 (following)
2570 return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2571 });
2572
2573 // Support: IE<8
2574 // Prevent attribute/property "interpolation"
2575 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2576 if ( !assert(function( div ) {
2577 div.innerHTML = "<a href='#'></a>";
2578 return div.firstChild.getAttribute("href") === "#" ;
2579 }) ) {
2580 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2581 if ( !isXML ) {
2582 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2583 }
2584 });
2585 }
2586
2587 // Support: IE<9
2588 // Use defaultValue in place of getAttribute("value")
2589 if ( !support.attributes || !assert(function( div ) {
2590 div.innerHTML = "<input/>";
2591 div.firstChild.setAttribute( "value", "" );
2592 return div.firstChild.getAttribute( "value" ) === "";
2593 }) ) {
2594 addHandle( "value", function( elem, name, isXML ) {
2595 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2596 return elem.defaultValue;
2597 }
2598 });
2599 }
2600
2601 // Support: IE<9
2602 // Use getAttributeNode to fetch booleans when getAttribute lies
2603 if ( !assert(function( div ) {
2604 return div.getAttribute("disabled") == null;
2605 }) ) {
2606 addHandle( booleans, function( elem, name, isXML ) {
2607 var val;
2608 if ( !isXML ) {
2609 return elem[ name ] === true ? name.toLowerCase() :
2610 (val = elem.getAttributeNode( name )) && val.specified ?
2611 val.value :
2612 null;
2613 }
2614 });
2615 }
2616
2617 return Sizzle;
2618
2619 })( window );
2620
2621
2622
2623 jQuery.find = Sizzle;
2624 jQuery.expr = Sizzle.selectors;
2625 jQuery.expr[":"] = jQuery.expr.pseudos;
2626 jQuery.unique = Sizzle.uniqueSort;
2627 jQuery.text = Sizzle.getText;
2628 jQuery.isXMLDoc = Sizzle.isXML;
2629 jQuery.contains = Sizzle.contains;
2630
2631
2632
2633 var rneedsContext = jQuery.expr.match.needsContext;
2634
2635 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2636
2637
2638
2639 var risSimple = /^.[^:#\[\.,]*$/;
2640
2641 // Implement the identical functionality for filter and not
2642 function winnow( elements, qualifier, not ) {
2643 if ( jQuery.isFunction( qualifier ) ) {
2644 return jQuery.grep( elements, function( elem, i ) {
2645 /* jshint -W018 */
2646 return !!qualifier.call( elem, i, elem ) !== not;
2647 });
2648
2649 }
2650
2651 if ( qualifier.nodeType ) {
2652 return jQuery.grep( elements, function( elem ) {
2653 return ( elem === qualifier ) !== not;
2654 });
2655
2656 }
2657
2658 if ( typeof qualifier === "string" ) {
2659 if ( risSimple.test( qualifier ) ) {
2660 return jQuery.filter( qualifier, elements, not );
2661 }
2662
2663 qualifier = jQuery.filter( qualifier, elements );
2664 }
2665
2666 return jQuery.grep( elements, function( elem ) {
2667 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
2668 });
2669 }
2670
2671 jQuery.filter = function( expr, elems, not ) {
2672 var elem = elems[ 0 ];
2673
2674 if ( not ) {
2675 expr = ":not(" + expr + ")";
2676 }
2677
2678 return elems.length === 1 && elem.nodeType === 1 ?
2679 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2680 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2681 return elem.nodeType === 1;
2682 }));
2683 };
2684
2685 jQuery.fn.extend({
2686 find: function( selector ) {
2687 var i,
2688 ret = [],
2689 self = this,
2690 len = self.length;
2691
2692 if ( typeof selector !== "string" ) {
2693 return this.pushStack( jQuery( selector ).filter(function() {
2694 for ( i = 0; i < len; i++ ) {
2695 if ( jQuery.contains( self[ i ], this ) ) {
2696 return true;
2697 }
2698 }
2699 }) );
2700 }
2701
2702 for ( i = 0; i < len; i++ ) {
2703 jQuery.find( selector, self[ i ], ret );
2704 }
2705
2706 // Needed because $( selector, context ) becomes $( context ).find( selector )
2707 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2708 ret.selector = this.selector ? this.selector + " " + selector : selector;
2709 return ret;
2710 },
2711 filter: function( selector ) {
2712 return this.pushStack( winnow(this, selector || [], false) );
2713 },
2714 not: function( selector ) {
2715 return this.pushStack( winnow(this, selector || [], true) );
2716 },
2717 is: function( selector ) {
2718 return !!winnow(
2719 this,
2720
2721 // If this is a positional/relative selector, check membership in the returned set
2722 // so $("p:first").is("p:last") won't return true for a doc with two "p".
2723 typeof selector === "string" && rneedsContext.test( selector ) ?
2724 jQuery( selector ) :
2725 selector || [],
2726 false
2727 ).length;
2728 }
2729 });
2730
2731
2732 // Initialize a jQuery object
2733
2734
2735 // A central reference to the root jQuery(document)
2736 var rootjQuery,
2737
2738 // Use the correct document accordingly with window argument (sandbox)
2739 document = window.document,
2740
2741 // A simple way to check for HTML strings
2742 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2743 // Strict HTML recognition (#11290: must start with <)
2744 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2745
2746 init = jQuery.fn.init = function( selector, context ) {
2747 var match, elem;
2748
2749 // HANDLE: $(""), $(null), $(undefined), $(false)
2750 if ( !selector ) {
2751 return this;
2752 }
2753
2754 // Handle HTML strings
2755 if ( typeof selector === "string" ) {
2756 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
2757 // Assume that strings that start and end with <> are HTML and skip the regex check
2758 match = [ null, selector, null ];
2759
2760 } else {
2761 match = rquickExpr.exec( selector );
2762 }
2763
2764 // Match html or make sure no context is specified for #id
2765 if ( match && (match[1] || !context) ) {
2766
2767 // HANDLE: $(html) -> $(array)
2768 if ( match[1] ) {
2769 context = context instanceof jQuery ? context[0] : context;
2770
2771 // scripts is true for back-compat
2772 // Intentionally let the error be thrown if parseHTML is not present
2773 jQuery.merge( this, jQuery.parseHTML(
2774 match[1],
2775 context && context.nodeType ? context.ownerDocument || context : document,
2776 true
2777 ) );
2778
2779 // HANDLE: $(html, props)
2780 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2781 for ( match in context ) {
2782 // Properties of context are called as methods if possible
2783 if ( jQuery.isFunction( this[ match ] ) ) {
2784 this[ match ]( context[ match ] );
2785
2786 // ...and otherwise set as attributes
2787 } else {
2788 this.attr( match, context[ match ] );
2789 }
2790 }
2791 }
2792
2793 return this;
2794
2795 // HANDLE: $(#id)
2796 } else {
2797 elem = document.getElementById( match[2] );
2798
2799 // Check parentNode to catch when Blackberry 4.6 returns
2800 // nodes that are no longer in the document #6963
2801 if ( elem && elem.parentNode ) {
2802 // Handle the case where IE and Opera return items
2803 // by name instead of ID
2804 if ( elem.id !== match[2] ) {
2805 return rootjQuery.find( selector );
2806 }
2807
2808 // Otherwise, we inject the element directly into the jQuery object
2809 this.length = 1;
2810 this[0] = elem;
2811 }
2812
2813 this.context = document;
2814 this.selector = selector;
2815 return this;
2816 }
2817
2818 // HANDLE: $(expr, $(...))
2819 } else if ( !context || context.jquery ) {
2820 return ( context || rootjQuery ).find( selector );
2821
2822 // HANDLE: $(expr, context)
2823 // (which is just equivalent to: $(context).find(expr)
2824 } else {
2825 return this.constructor( context ).find( selector );
2826 }
2827
2828 // HANDLE: $(DOMElement)
2829 } else if ( selector.nodeType ) {
2830 this.context = this[0] = selector;
2831 this.length = 1;
2832 return this;
2833
2834 // HANDLE: $(function)
2835 // Shortcut for document ready
2836 } else if ( jQuery.isFunction( selector ) ) {
2837 return typeof rootjQuery.ready !== "undefined" ?
2838 rootjQuery.ready( selector ) :
2839 // Execute immediately if ready is not present
2840 selector( jQuery );
2841 }
2842
2843 if ( selector.selector !== undefined ) {
2844 this.selector = selector.selector;
2845 this.context = selector.context;
2846 }
2847
2848 return jQuery.makeArray( selector, this );
2849 };
2850
2851 // Give the init function the jQuery prototype for later instantiation
2852 init.prototype = jQuery.fn;
2853
2854 // Initialize central reference
2855 rootjQuery = jQuery( document );
2856
2857
2858 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2859 // methods guaranteed to produce a unique set when starting from a unique set
2860 guaranteedUnique = {
2861 children: true,
2862 contents: true,
2863 next: true,
2864 prev: true
2865 };
2866
2867 jQuery.extend({
2868 dir: function( elem, dir, until ) {
2869 var matched = [],
2870 cur = elem[ dir ];
2871
2872 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
2873 if ( cur.nodeType === 1 ) {
2874 matched.push( cur );
2875 }
2876 cur = cur[dir];
2877 }
2878 return matched;
2879 },
2880
2881 sibling: function( n, elem ) {
2882 var r = [];
2883
2884 for ( ; n; n = n.nextSibling ) {
2885 if ( n.nodeType === 1 && n !== elem ) {
2886 r.push( n );
2887 }
2888 }
2889
2890 return r;
2891 }
2892 });
2893
2894 jQuery.fn.extend({
2895 has: function( target ) {
2896 var i,
2897 targets = jQuery( target, this ),
2898 len = targets.length;
2899
2900 return this.filter(function() {
2901 for ( i = 0; i < len; i++ ) {
2902 if ( jQuery.contains( this, targets[i] ) ) {
2903 return true;
2904 }
2905 }
2906 });
2907 },
2908
2909 closest: function( selectors, context ) {
2910 var cur,
2911 i = 0,
2912 l = this.length,
2913 matched = [],
2914 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2915 jQuery( selectors, context || this.context ) :
2916 0;
2917
2918 for ( ; i < l; i++ ) {
2919 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2920 // Always skip document fragments
2921 if ( cur.nodeType < 11 && (pos ?
2922 pos.index(cur) > -1 :
2923
2924 // Don't pass non-elements to Sizzle
2925 cur.nodeType === 1 &&
2926 jQuery.find.matchesSelector(cur, selectors)) ) {
2927
2928 matched.push( cur );
2929 break;
2930 }
2931 }
2932 }
2933
2934 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2935 },
2936
2937 // Determine the position of an element within
2938 // the matched set of elements
2939 index: function( elem ) {
2940
2941 // No argument, return index in parent
2942 if ( !elem ) {
2943 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
2944 }
2945
2946 // index in selector
2947 if ( typeof elem === "string" ) {
2948 return jQuery.inArray( this[0], jQuery( elem ) );
2949 }
2950
2951 // Locate the position of the desired element
2952 return jQuery.inArray(
2953 // If it receives a jQuery object, the first element is used
2954 elem.jquery ? elem[0] : elem, this );
2955 },
2956
2957 add: function( selector, context ) {
2958 return this.pushStack(
2959 jQuery.unique(
2960 jQuery.merge( this.get(), jQuery( selector, context ) )
2961 )
2962 );
2963 },
2964
2965 addBack: function( selector ) {
2966 return this.add( selector == null ?
2967 this.prevObject : this.prevObject.filter(selector)
2968 );
2969 }
2970 });
2971
2972 function sibling( cur, dir ) {
2973 do {
2974 cur = cur[ dir ];
2975 } while ( cur && cur.nodeType !== 1 );
2976
2977 return cur;
2978 }
2979
2980 jQuery.each({
2981 parent: function( elem ) {
2982 var parent = elem.parentNode;
2983 return parent && parent.nodeType !== 11 ? parent : null;
2984 },
2985 parents: function( elem ) {
2986 return jQuery.dir( elem, "parentNode" );
2987 },
2988 parentsUntil: function( elem, i, until ) {
2989 return jQuery.dir( elem, "parentNode", until );
2990 },
2991 next: function( elem ) {
2992 return sibling( elem, "nextSibling" );
2993 },
2994 prev: function( elem ) {
2995 return sibling( elem, "previousSibling" );
2996 },
2997 nextAll: function( elem ) {
2998 return jQuery.dir( elem, "nextSibling" );
2999 },
3000 prevAll: function( elem ) {
3001 return jQuery.dir( elem, "previousSibling" );
3002 },
3003 nextUntil: function( elem, i, until ) {
3004 return jQuery.dir( elem, "nextSibling", until );
3005 },
3006 prevUntil: function( elem, i, until ) {
3007 return jQuery.dir( elem, "previousSibling", until );
3008 },
3009 siblings: function( elem ) {
3010 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
3011 },
3012 children: function( elem ) {
3013 return jQuery.sibling( elem.firstChild );
3014 },
3015 contents: function( elem ) {
3016 return jQuery.nodeName( elem, "iframe" ) ?
3017 elem.contentDocument || elem.contentWindow.document :
3018 jQuery.merge( [], elem.childNodes );
3019 }
3020 }, function( name, fn ) {
3021 jQuery.fn[ name ] = function( until, selector ) {
3022 var ret = jQuery.map( this, fn, until );
3023
3024 if ( name.slice( -5 ) !== "Until" ) {
3025 selector = until;
3026 }
3027
3028 if ( selector && typeof selector === "string" ) {
3029 ret = jQuery.filter( selector, ret );
3030 }
3031
3032 if ( this.length > 1 ) {
3033 // Remove duplicates
3034 if ( !guaranteedUnique[ name ] ) {
3035 ret = jQuery.unique( ret );
3036 }
3037
3038 // Reverse order for parents* and prev-derivatives
3039 if ( rparentsprev.test( name ) ) {
3040 ret = ret.reverse();
3041 }
3042 }
3043
3044 return this.pushStack( ret );
3045 };
3046 });
3047 var rnotwhite = (/\S+/g);
3048
3049
3050
3051 // String to Object options format cache
3052 var optionsCache = {};
3053
3054 // Convert String-formatted options into Object-formatted ones and store in cache
3055 function createOptions( options ) {
3056 var object = optionsCache[ options ] = {};
3057 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3058 object[ flag ] = true;
3059 });
3060 return object;
3061 }
3062
3063 /*
3064 * Create a callback list using the following parameters:
3065 *
3066 * options: an optional list of space-separated options that will change how
3067 * the callback list behaves or a more traditional option object
3068 *
3069 * By default a callback list will act like an event callback list and can be
3070 * "fired" multiple times.
3071 *
3072 * Possible options:
3073 *
3074 * once: will ensure the callback list can only be fired once (like a Deferred)
3075 *
3076 * memory: will keep track of previous values and will call any callback added
3077 * after the list has been fired right away with the latest "memorized"
3078 * values (like a Deferred)
3079 *
3080 * unique: will ensure a callback can only be added once (no duplicate in the list)
3081 *
3082 * stopOnFalse: interrupt callings when a callback returns false
3083 *
3084 */
3085 jQuery.Callbacks = function( options ) {
3086
3087 // Convert options from String-formatted to Object-formatted if needed
3088 // (we check in cache first)
3089 options = typeof options === "string" ?
3090 ( optionsCache[ options ] || createOptions( options ) ) :
3091 jQuery.extend( {}, options );
3092
3093 var // Flag to know if list is currently firing
3094 firing,
3095 // Last fire value (for non-forgettable lists)
3096 memory,
3097 // Flag to know if list was already fired
3098 fired,
3099 // End of the loop when firing
3100 firingLength,
3101 // Index of currently firing callback (modified by remove if needed)
3102 firingIndex,
3103 // First callback to fire (used internally by add and fireWith)
3104 firingStart,
3105 // Actual callback list
3106 list = [],
3107 // Stack of fire calls for repeatable lists
3108 stack = !options.once && [],
3109 // Fire callbacks
3110 fire = function( data ) {
3111 memory = options.memory && data;
3112 fired = true;
3113 firingIndex = firingStart || 0;
3114 firingStart = 0;
3115 firingLength = list.length;
3116 firing = true;
3117 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3118 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3119 memory = false; // To prevent further calls using add
3120 break;
3121 }
3122 }
3123 firing = false;
3124 if ( list ) {
3125 if ( stack ) {
3126 if ( stack.length ) {
3127 fire( stack.shift() );
3128 }
3129 } else if ( memory ) {
3130 list = [];
3131 } else {
3132 self.disable();
3133 }
3134 }
3135 },
3136 // Actual Callbacks object
3137 self = {
3138 // Add a callback or a collection of callbacks to the list
3139 add: function() {
3140 if ( list ) {
3141 // First, we save the current length
3142 var start = list.length;
3143 (function add( args ) {
3144 jQuery.each( args, function( _, arg ) {
3145 var type = jQuery.type( arg );
3146 if ( type === "function" ) {
3147 if ( !options.unique || !self.has( arg ) ) {
3148 list.push( arg );
3149 }
3150 } else if ( arg && arg.length && type !== "string" ) {
3151 // Inspect recursively
3152 add( arg );
3153 }
3154 });
3155 })( arguments );
3156 // Do we need to add the callbacks to the
3157 // current firing batch?
3158 if ( firing ) {
3159 firingLength = list.length;
3160 // With memory, if we're not firing then
3161 // we should call right away
3162 } else if ( memory ) {
3163 firingStart = start;
3164 fire( memory );
3165 }
3166 }
3167 return this;
3168 },
3169 // Remove a callback from the list
3170 remove: function() {
3171 if ( list ) {
3172 jQuery.each( arguments, function( _, arg ) {
3173 var index;
3174 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3175 list.splice( index, 1 );
3176 // Handle firing indexes
3177 if ( firing ) {
3178 if ( index <= firingLength ) {
3179 firingLength--;
3180 }
3181 if ( index <= firingIndex ) {
3182 firingIndex--;
3183 }
3184 }
3185 }
3186 });
3187 }
3188 return this;
3189 },
3190 // Check if a given callback is in the list.
3191 // If no argument is given, return whether or not list has callbacks attached.
3192 has: function( fn ) {
3193 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3194 },
3195 // Remove all callbacks from the list
3196 empty: function() {
3197 list = [];
3198 firingLength = 0;
3199 return this;
3200 },
3201 // Have the list do nothing anymore
3202 disable: function() {
3203 list = stack = memory = undefined;
3204 return this;
3205 },
3206 // Is it disabled?
3207 disabled: function() {
3208 return !list;
3209 },
3210 // Lock the list in its current state
3211 lock: function() {
3212 stack = undefined;
3213 if ( !memory ) {
3214 self.disable();
3215 }
3216 return this;
3217 },
3218 // Is it locked?
3219 locked: function() {
3220 return !stack;
3221 },
3222 // Call all callbacks with the given context and arguments
3223 fireWith: function( context, args ) {
3224 if ( list && ( !fired || stack ) ) {
3225 args = args || [];
3226 args = [ context, args.slice ? args.slice() : args ];
3227 if ( firing ) {
3228 stack.push( args );
3229 } else {
3230 fire( args );
3231 }
3232 }
3233 return this;
3234 },
3235 // Call all the callbacks with the given arguments
3236 fire: function() {
3237 self.fireWith( this, arguments );
3238 return this;
3239 },
3240 // To know if the callbacks have already been called at least once
3241 fired: function() {
3242 return !!fired;
3243 }
3244 };
3245
3246 return self;
3247 };
3248
3249
3250 jQuery.extend({
3251
3252 Deferred: function( func ) {
3253 var tuples = [
3254 // action, add listener, listener list, final state
3255 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3256 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3257 [ "notify", "progress", jQuery.Callbacks("memory") ]
3258 ],
3259 state = "pending",
3260 promise = {
3261 state: function() {
3262 return state;
3263 },
3264 always: function() {
3265 deferred.done( arguments ).fail( arguments );
3266 return this;
3267 },
3268 then: function( /* fnDone, fnFail, fnProgress */ ) {
3269 var fns = arguments;
3270 return jQuery.Deferred(function( newDefer ) {
3271 jQuery.each( tuples, function( i, tuple ) {
3272 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3273 // deferred[ done | fail | progress ] for forwarding actions to newDefer
3274 deferred[ tuple[1] ](function() {
3275 var returned = fn && fn.apply( this, arguments );
3276 if ( returned && jQuery.isFunction( returned.promise ) ) {
3277 returned.promise()
3278 .done( newDefer.resolve )
3279 .fail( newDefer.reject )
3280 .progress( newDefer.notify );
3281 } else {
3282 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3283 }
3284 });
3285 });
3286 fns = null;
3287 }).promise();
3288 },
3289 // Get a promise for this deferred
3290 // If obj is provided, the promise aspect is added to the object
3291 promise: function( obj ) {
3292 return obj != null ? jQuery.extend( obj, promise ) : promise;
3293 }
3294 },
3295 deferred = {};
3296
3297 // Keep pipe for back-compat
3298 promise.pipe = promise.then;
3299
3300 // Add list-specific methods
3301 jQuery.each( tuples, function( i, tuple ) {
3302 var list = tuple[ 2 ],
3303 stateString = tuple[ 3 ];
3304
3305 // promise[ done | fail | progress ] = list.add
3306 promise[ tuple[1] ] = list.add;
3307
3308 // Handle state
3309 if ( stateString ) {
3310 list.add(function() {
3311 // state = [ resolved | rejected ]
3312 state = stateString;
3313
3314 // [ reject_list | resolve_list ].disable; progress_list.lock
3315 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3316 }
3317
3318 // deferred[ resolve | reject | notify ]
3319 deferred[ tuple[0] ] = function() {
3320 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3321 return this;
3322 };
3323 deferred[ tuple[0] + "With" ] = list.fireWith;
3324 });
3325
3326 // Make the deferred a promise
3327 promise.promise( deferred );
3328
3329 // Call given func if any
3330 if ( func ) {
3331 func.call( deferred, deferred );
3332 }
3333
3334 // All done!
3335 return deferred;
3336 },
3337
3338 // Deferred helper
3339 when: function( subordinate /* , ..., subordinateN */ ) {
3340 var i = 0,
3341 resolveValues = slice.call( arguments ),
3342 length = resolveValues.length,
3343
3344 // the count of uncompleted subordinates
3345 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3346
3347 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3348 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3349
3350 // Update function for both resolve and progress values
3351 updateFunc = function( i, contexts, values ) {
3352 return function( value ) {
3353 contexts[ i ] = this;
3354 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3355 if ( values === progressValues ) {
3356 deferred.notifyWith( contexts, values );
3357
3358 } else if ( !(--remaining) ) {
3359 deferred.resolveWith( contexts, values );
3360 }
3361 };
3362 },
3363
3364 progressValues, progressContexts, resolveContexts;
3365
3366 // add listeners to Deferred subordinates; treat others as resolved
3367 if ( length > 1 ) {
3368 progressValues = new Array( length );
3369 progressContexts = new Array( length );
3370 resolveContexts = new Array( length );
3371 for ( ; i < length; i++ ) {
3372 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3373 resolveValues[ i ].promise()
3374 .done( updateFunc( i, resolveContexts, resolveValues ) )
3375 .fail( deferred.reject )
3376 .progress( updateFunc( i, progressContexts, progressValues ) );
3377 } else {
3378 --remaining;
3379 }
3380 }
3381 }
3382
3383 // if we're not waiting on anything, resolve the master
3384 if ( !remaining ) {
3385 deferred.resolveWith( resolveContexts, resolveValues );
3386 }
3387
3388 return deferred.promise();
3389 }
3390 });
3391
3392
3393 // The deferred used on DOM ready
3394 var readyList;
3395
3396 jQuery.fn.ready = function( fn ) {
3397 // Add the callback
3398 jQuery.ready.promise().done( fn );
3399
3400 return this;
3401 };
3402
3403 jQuery.extend({
3404 // Is the DOM ready to be used? Set to true once it occurs.
3405 isReady: false,
3406
3407 // A counter to track how many items to wait for before
3408 // the ready event fires. See #6781
3409 readyWait: 1,
3410
3411 // Hold (or release) the ready event
3412 holdReady: function( hold ) {
3413 if ( hold ) {
3414 jQuery.readyWait++;
3415 } else {
3416 jQuery.ready( true );
3417 }
3418 },
3419
3420 // Handle when the DOM is ready
3421 ready: function( wait ) {
3422
3423 // Abort if there are pending holds or we're already ready
3424 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3425 return;
3426 }
3427
3428 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
3429 if ( !document.body ) {
3430 return setTimeout( jQuery.ready );
3431 }
3432
3433 // Remember that the DOM is ready
3434 jQuery.isReady = true;
3435
3436 // If a normal DOM Ready event fired, decrement, and wait if need be
3437 if ( wait !== true && --jQuery.readyWait > 0 ) {
3438 return;
3439 }
3440
3441 // If there are functions bound, to execute
3442 readyList.resolveWith( document, [ jQuery ] );
3443
3444 // Trigger any bound ready events
3445 if ( jQuery.fn.triggerHandler ) {
3446 jQuery( document ).triggerHandler( "ready" );
3447 jQuery( document ).off( "ready" );
3448 }
3449 }
3450 });
3451
3452 /**
3453 * Clean-up method for dom ready events
3454 */
3455 function detach() {
3456 if ( document.addEventListener ) {
3457 document.removeEventListener( "DOMContentLoaded", completed, false );
3458 window.removeEventListener( "load", completed, false );
3459
3460 } else {
3461 document.detachEvent( "onreadystatechange", completed );
3462 window.detachEvent( "onload", completed );
3463 }
3464 }
3465
3466 /**
3467 * The ready event handler and self cleanup method
3468 */
3469 function completed() {
3470 // readyState === "complete" is good enough for us to call the dom ready in oldIE
3471 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
3472 detach();
3473 jQuery.ready();
3474 }
3475 }
3476
3477 jQuery.ready.promise = function( obj ) {
3478 if ( !readyList ) {
3479
3480 readyList = jQuery.Deferred();
3481
3482 // Catch cases where $(document).ready() is called after the browser event has already occurred.
3483 // we once tried to use readyState "interactive" here, but it caused issues like the one
3484 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3485 if ( document.readyState === "complete" ) {
3486 // Handle it asynchronously to allow scripts the opportunity to delay ready
3487 setTimeout( jQuery.ready );
3488
3489 // Standards-based browsers support DOMContentLoaded
3490 } else if ( document.addEventListener ) {
3491 // Use the handy event callback
3492 document.addEventListener( "DOMContentLoaded", completed, false );
3493
3494 // A fallback to window.onload, that will always work
3495 window.addEventListener( "load", completed, false );
3496
3497 // If IE event model is used
3498 } else {
3499 // Ensure firing before onload, maybe late but safe also for iframes
3500 document.attachEvent( "onreadystatechange", completed );
3501
3502 // A fallback to window.onload, that will always work
3503 window.attachEvent( "onload", completed );
3504
3505 // If IE and not a frame
3506 // continually check to see if the document is ready
3507 var top = false;
3508
3509 try {
3510 top = window.frameElement == null && document.documentElement;
3511 } catch(e) {}
3512
3513 if ( top && top.doScroll ) {
3514 (function doScrollCheck() {
3515 if ( !jQuery.isReady ) {
3516
3517 try {
3518 // Use the trick by Diego Perini
3519 // http://javascript.nwbox.com/IEContentLoaded/
3520 top.doScroll("left");
3521 } catch(e) {
3522 return setTimeout( doScrollCheck, 50 );
3523 }
3524
3525 // detach all dom ready events
3526 detach();
3527
3528 // and execute any waiting functions
3529 jQuery.ready();
3530 }
3531 })();
3532 }
3533 }
3534 }
3535 return readyList.promise( obj );
3536 };
3537
3538
3539 var strundefined = typeof undefined;
3540
3541
3542
3543 // Support: IE<9
3544 // Iteration over object's inherited properties before its own
3545 var i;
3546 for ( i in jQuery( support ) ) {
3547 break;
3548 }
3549 support.ownLast = i !== "0";
3550
3551 // Note: most support tests are defined in their respective modules.
3552 // false until the test is run
3553 support.inlineBlockNeedsLayout = false;
3554
3555 // Execute ASAP in case we need to set body.style.zoom
3556 jQuery(function() {
3557 // Minified: var a,b,c,d
3558 var val, div, body, container;
3559
3560 body = document.getElementsByTagName( "body" )[ 0 ];
3561 if ( !body || !body.style ) {
3562 // Return for frameset docs that don't have a body
3563 return;
3564 }
3565
3566 // Setup
3567 div = document.createElement( "div" );
3568 container = document.createElement( "div" );
3569 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
3570 body.appendChild( container ).appendChild( div );
3571
3572 if ( typeof div.style.zoom !== strundefined ) {
3573 // Support: IE<8
3574 // Check if natively block-level elements act like inline-block
3575 // elements when setting their display to 'inline' and giving
3576 // them layout
3577 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
3578
3579 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
3580 if ( val ) {
3581 // Prevent IE 6 from affecting layout for positioned elements #11048
3582 // Prevent IE from shrinking the body in IE 7 mode #12869
3583 // Support: IE<8
3584 body.style.zoom = 1;
3585 }
3586 }
3587
3588 body.removeChild( container );
3589 });
3590
3591
3592
3593
3594 (function() {
3595 var div = document.createElement( "div" );
3596
3597 // Execute the test only if not already executed in another module.
3598 if (support.deleteExpando == null) {
3599 // Support: IE<9
3600 support.deleteExpando = true;
3601 try {
3602 delete div.test;
3603 } catch( e ) {
3604 support.deleteExpando = false;
3605 }
3606 }
3607
3608 // Null elements to avoid leaks in IE.
3609 div = null;
3610 })();
3611
3612
3613 /**
3614 * Determines whether an object can have data
3615 */
3616 jQuery.acceptData = function( elem ) {
3617 var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
3618 nodeType = +elem.nodeType || 1;
3619
3620 // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3621 return nodeType !== 1 && nodeType !== 9 ?
3622 false :
3623
3624 // Nodes accept data unless otherwise specified; rejection can be conditional
3625 !noData || noData !== true && elem.getAttribute("classid") === noData;
3626 };
3627
3628
3629 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3630 rmultiDash = /([A-Z])/g;
3631
3632 function dataAttr( elem, key, data ) {
3633 // If nothing was found internally, try to fetch any
3634 // data from the HTML5 data-* attribute
3635 if ( data === undefined && elem.nodeType === 1 ) {
3636
3637 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3638
3639 data = elem.getAttribute( name );
3640
3641 if ( typeof data === "string" ) {
3642 try {
3643 data = data === "true" ? true :
3644 data === "false" ? false :
3645 data === "null" ? null :
3646 // Only convert to a number if it doesn't change the string
3647 +data + "" === data ? +data :
3648 rbrace.test( data ) ? jQuery.parseJSON( data ) :
3649 data;
3650 } catch( e ) {}
3651
3652 // Make sure we set the data so it isn't changed later
3653 jQuery.data( elem, key, data );
3654
3655 } else {
3656 data = undefined;
3657 }
3658 }
3659
3660 return data;
3661 }
3662
3663 // checks a cache object for emptiness
3664 function isEmptyDataObject( obj ) {
3665 var name;
3666 for ( name in obj ) {
3667
3668 // if the public data object is empty, the private is still empty
3669 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3670 continue;
3671 }
3672 if ( name !== "toJSON" ) {
3673 return false;
3674 }
3675 }
3676
3677 return true;
3678 }
3679
3680 function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3681 if ( !jQuery.acceptData( elem ) ) {
3682 return;
3683 }
3684
3685 var ret, thisCache,
3686 internalKey = jQuery.expando,
3687
3688 // We have to handle DOM nodes and JS objects differently because IE6-7
3689 // can't GC object references properly across the DOM-JS boundary
3690 isNode = elem.nodeType,
3691
3692 // Only DOM nodes need the global jQuery cache; JS object data is
3693 // attached directly to the object so GC can occur automatically
3694 cache = isNode ? jQuery.cache : elem,
3695
3696 // Only defining an ID for JS objects if its cache already exists allows
3697 // the code to shortcut on the same path as a DOM node with no cache
3698 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3699
3700 // Avoid doing any more work than we need to when trying to get data on an
3701 // object that has no data at all
3702 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3703 return;
3704 }
3705
3706 if ( !id ) {
3707 // Only DOM nodes need a new unique ID for each element since their data
3708 // ends up in the global cache
3709 if ( isNode ) {
3710 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3711 } else {
3712 id = internalKey;
3713 }
3714 }
3715
3716 if ( !cache[ id ] ) {
3717 // Avoid exposing jQuery metadata on plain JS objects when the object
3718 // is serialized using JSON.stringify
3719 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3720 }
3721
3722 // An object can be passed to jQuery.data instead of a key/value pair; this gets
3723 // shallow copied over onto the existing cache
3724 if ( typeof name === "object" || typeof name === "function" ) {
3725 if ( pvt ) {
3726 cache[ id ] = jQuery.extend( cache[ id ], name );
3727 } else {
3728 cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3729 }
3730 }
3731
3732 thisCache = cache[ id ];
3733
3734 // jQuery data() is stored in a separate object inside the object's internal data
3735 // cache in order to avoid key collisions between internal data and user-defined
3736 // data.
3737 if ( !pvt ) {
3738 if ( !thisCache.data ) {
3739 thisCache.data = {};
3740 }
3741
3742 thisCache = thisCache.data;
3743 }
3744
3745 if ( data !== undefined ) {
3746 thisCache[ jQuery.camelCase( name ) ] = data;
3747 }
3748
3749 // Check for both converted-to-camel and non-converted data property names
3750 // If a data property was specified
3751 if ( typeof name === "string" ) {
3752
3753 // First Try to find as-is property data
3754 ret = thisCache[ name ];
3755
3756 // Test for null|undefined property data
3757 if ( ret == null ) {
3758
3759 // Try to find the camelCased property
3760 ret = thisCache[ jQuery.camelCase( name ) ];
3761 }
3762 } else {
3763 ret = thisCache;
3764 }
3765
3766 return ret;
3767 }
3768
3769 function internalRemoveData( elem, name, pvt ) {
3770 if ( !jQuery.acceptData( elem ) ) {
3771 return;
3772 }
3773
3774 var thisCache, i,
3775 isNode = elem.nodeType,
3776
3777 // See jQuery.data for more information
3778 cache = isNode ? jQuery.cache : elem,
3779 id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3780
3781 // If there is already no cache entry for this object, there is no
3782 // purpose in continuing
3783 if ( !cache[ id ] ) {
3784 return;
3785 }
3786
3787 if ( name ) {
3788
3789 thisCache = pvt ? cache[ id ] : cache[ id ].data;
3790
3791 if ( thisCache ) {
3792
3793 // Support array or space separated string names for data keys
3794 if ( !jQuery.isArray( name ) ) {
3795
3796 // try the string as a key before any manipulation
3797 if ( name in thisCache ) {
3798 name = [ name ];
3799 } else {
3800
3801 // split the camel cased version by spaces unless a key with the spaces exists
3802 name = jQuery.camelCase( name );
3803 if ( name in thisCache ) {
3804 name = [ name ];
3805 } else {
3806 name = name.split(" ");
3807 }
3808 }
3809 } else {
3810 // If "name" is an array of keys...
3811 // When data is initially created, via ("key", "val") signature,
3812 // keys will be converted to camelCase.
3813 // Since there is no way to tell _how_ a key was added, remove
3814 // both plain key and camelCase key. #12786
3815 // This will only penalize the array argument path.
3816 name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3817 }
3818
3819 i = name.length;
3820 while ( i-- ) {
3821 delete thisCache[ name[i] ];
3822 }
3823
3824 // If there is no data left in the cache, we want to continue
3825 // and let the cache object itself get destroyed
3826 if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3827 return;
3828 }
3829 }
3830 }
3831
3832 // See jQuery.data for more information
3833 if ( !pvt ) {
3834 delete cache[ id ].data;
3835
3836 // Don't destroy the parent cache unless the internal data object
3837 // had been the only thing left in it
3838 if ( !isEmptyDataObject( cache[ id ] ) ) {
3839 return;
3840 }
3841 }
3842
3843 // Destroy the cache
3844 if ( isNode ) {
3845 jQuery.cleanData( [ elem ], true );
3846
3847 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3848 /* jshint eqeqeq: false */
3849 } else if ( support.deleteExpando || cache != cache.window ) {
3850 /* jshint eqeqeq: true */
3851 delete cache[ id ];
3852
3853 // When all else fails, null
3854 } else {
3855 cache[ id ] = null;
3856 }
3857 }
3858
3859 jQuery.extend({
3860 cache: {},
3861
3862 // The following elements (space-suffixed to avoid Object.prototype collisions)
3863 // throw uncatchable exceptions if you attempt to set expando properties
3864 noData: {
3865 "applet ": true,
3866 "embed ": true,
3867 // ...but Flash objects (which have this classid) *can* handle expandos
3868 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3869 },
3870
3871 hasData: function( elem ) {
3872 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3873 return !!elem && !isEmptyDataObject( elem );
3874 },
3875
3876 data: function( elem, name, data ) {
3877 return internalData( elem, name, data );
3878 },
3879
3880 removeData: function( elem, name ) {
3881 return internalRemoveData( elem, name );
3882 },
3883
3884 // For internal use only.
3885 _data: function( elem, name, data ) {
3886 return internalData( elem, name, data, true );
3887 },
3888
3889 _removeData: function( elem, name ) {
3890 return internalRemoveData( elem, name, true );
3891 }
3892 });
3893
3894 jQuery.fn.extend({
3895 data: function( key, value ) {
3896 var i, name, data,
3897 elem = this[0],
3898 attrs = elem && elem.attributes;
3899
3900 // Special expections of .data basically thwart jQuery.access,
3901 // so implement the relevant behavior ourselves
3902
3903 // Gets all values
3904 if ( key === undefined ) {
3905 if ( this.length ) {
3906 data = jQuery.data( elem );
3907
3908 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3909 i = attrs.length;
3910 while ( i-- ) {
3911
3912 // Support: IE11+
3913 // The attrs elements can be null (#14894)
3914 if ( attrs[ i ] ) {
3915 name = attrs[ i ].name;
3916 if ( name.indexOf( "data-" ) === 0 ) {
3917 name = jQuery.camelCase( name.slice(5) );
3918 dataAttr( elem, name, data[ name ] );
3919 }
3920 }
3921 }
3922 jQuery._data( elem, "parsedAttrs", true );
3923 }
3924 }
3925
3926 return data;
3927 }
3928
3929 // Sets multiple values
3930 if ( typeof key === "object" ) {
3931 return this.each(function() {
3932 jQuery.data( this, key );
3933 });
3934 }
3935
3936 return arguments.length > 1 ?
3937
3938 // Sets one value
3939 this.each(function() {
3940 jQuery.data( this, key, value );
3941 }) :
3942
3943 // Gets one value
3944 // Try to fetch any internally stored data first
3945 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
3946 },
3947
3948 removeData: function( key ) {
3949 return this.each(function() {
3950 jQuery.removeData( this, key );
3951 });
3952 }
3953 });
3954
3955
3956 jQuery.extend({
3957 queue: function( elem, type, data ) {
3958 var queue;
3959
3960 if ( elem ) {
3961 type = ( type || "fx" ) + "queue";
3962 queue = jQuery._data( elem, type );
3963
3964 // Speed up dequeue by getting out quickly if this is just a lookup
3965 if ( data ) {
3966 if ( !queue || jQuery.isArray(data) ) {
3967 queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3968 } else {
3969 queue.push( data );
3970 }
3971 }
3972 return queue || [];
3973 }
3974 },
3975
3976 dequeue: function( elem, type ) {
3977 type = type || "fx";
3978
3979 var queue = jQuery.queue( elem, type ),
3980 startLength = queue.length,
3981 fn = queue.shift(),
3982 hooks = jQuery._queueHooks( elem, type ),
3983 next = function() {
3984 jQuery.dequeue( elem, type );
3985 };
3986
3987 // If the fx queue is dequeued, always remove the progress sentinel
3988 if ( fn === "inprogress" ) {
3989 fn = queue.shift();
3990 startLength--;
3991 }
3992
3993 if ( fn ) {
3994
3995 // Add a progress sentinel to prevent the fx queue from being
3996 // automatically dequeued
3997 if ( type === "fx" ) {
3998 queue.unshift( "inprogress" );
3999 }
4000
4001 // clear up the last queue stop function
4002 delete hooks.stop;
4003 fn.call( elem, next, hooks );
4004 }
4005
4006 if ( !startLength && hooks ) {
4007 hooks.empty.fire();
4008 }
4009 },
4010
4011 // not intended for public consumption - generates a queueHooks object, or returns the current one
4012 _queueHooks: function( elem, type ) {
4013 var key = type + "queueHooks";
4014 return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4015 empty: jQuery.Callbacks("once memory").add(function() {
4016 jQuery._removeData( elem, type + "queue" );
4017 jQuery._removeData( elem, key );
4018 })
4019 });
4020 }
4021 });
4022
4023 jQuery.fn.extend({
4024 queue: function( type, data ) {
4025 var setter = 2;
4026
4027 if ( typeof type !== "string" ) {
4028 data = type;
4029 type = "fx";
4030 setter--;
4031 }
4032
4033 if ( arguments.length < setter ) {
4034 return jQuery.queue( this[0], type );
4035 }
4036
4037 return data === undefined ?
4038 this :
4039 this.each(function() {
4040 var queue = jQuery.queue( this, type, data );
4041
4042 // ensure a hooks for this queue
4043 jQuery._queueHooks( this, type );
4044
4045 if ( type === "fx" && queue[0] !== "inprogress" ) {
4046 jQuery.dequeue( this, type );
4047 }
4048 });
4049 },
4050 dequeue: function( type ) {
4051 return this.each(function() {
4052 jQuery.dequeue( this, type );
4053 });
4054 },
4055 clearQueue: function( type ) {
4056 return this.queue( type || "fx", [] );
4057 },
4058 // Get a promise resolved when queues of a certain type
4059 // are emptied (fx is the type by default)
4060 promise: function( type, obj ) {
4061 var tmp,
4062 count = 1,
4063 defer = jQuery.Deferred(),
4064 elements = this,
4065 i = this.length,
4066 resolve = function() {
4067 if ( !( --count ) ) {
4068 defer.resolveWith( elements, [ elements ] );
4069 }
4070 };
4071
4072 if ( typeof type !== "string" ) {
4073 obj = type;
4074 type = undefined;
4075 }
4076 type = type || "fx";
4077
4078 while ( i-- ) {
4079 tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4080 if ( tmp && tmp.empty ) {
4081 count++;
4082 tmp.empty.add( resolve );
4083 }
4084 }
4085 resolve();
4086 return defer.promise( obj );
4087 }
4088 });
4089 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
4090
4091 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4092
4093 var isHidden = function( elem, el ) {
4094 // isHidden might be called from jQuery#filter function;
4095 // in that case, element will be second argument
4096 elem = el || elem;
4097 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4098 };
4099
4100
4101
4102 // Multifunctional method to get and set values of a collection
4103 // The value/s can optionally be executed if it's a function
4104 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4105 var i = 0,
4106 length = elems.length,
4107 bulk = key == null;
4108
4109 // Sets many values
4110 if ( jQuery.type( key ) === "object" ) {
4111 chainable = true;
4112 for ( i in key ) {
4113 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4114 }
4115
4116 // Sets one value
4117 } else if ( value !== undefined ) {
4118 chainable = true;
4119
4120 if ( !jQuery.isFunction( value ) ) {
4121 raw = true;
4122 }
4123
4124 if ( bulk ) {
4125 // Bulk operations run against the entire set
4126 if ( raw ) {
4127 fn.call( elems, value );
4128 fn = null;
4129
4130 // ...except when executing function values
4131 } else {
4132 bulk = fn;
4133 fn = function( elem, key, value ) {
4134 return bulk.call( jQuery( elem ), value );
4135 };
4136 }
4137 }
4138
4139 if ( fn ) {
4140 for ( ; i < length; i++ ) {
4141 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4142 }
4143 }
4144 }
4145
4146 return chainable ?
4147 elems :
4148
4149 // Gets
4150 bulk ?
4151 fn.call( elems ) :
4152 length ? fn( elems[0], key ) : emptyGet;
4153 };
4154 var rcheckableType = (/^(?:checkbox|radio)$/i);
4155
4156
4157
4158 (function() {
4159 // Minified: var a,b,c
4160 var input = document.createElement( "input" ),
4161 div = document.createElement( "div" ),
4162 fragment = document.createDocumentFragment();
4163
4164 // Setup
4165 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4166
4167 // IE strips leading whitespace when .innerHTML is used
4168 support.leadingWhitespace = div.firstChild.nodeType === 3;
4169
4170 // Make sure that tbody elements aren't automatically inserted
4171 // IE will insert them into empty tables
4172 support.tbody = !div.getElementsByTagName( "tbody" ).length;
4173
4174 // Make sure that link elements get serialized correctly by innerHTML
4175 // This requires a wrapper element in IE
4176 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4177
4178 // Makes sure cloning an html5 element does not cause problems
4179 // Where outerHTML is undefined, this still works
4180 support.html5Clone =
4181 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4182
4183 // Check if a disconnected checkbox will retain its checked
4184 // value of true after appended to the DOM (IE6/7)
4185 input.type = "checkbox";
4186 input.checked = true;
4187 fragment.appendChild( input );
4188 support.appendChecked = input.checked;
4189
4190 // Make sure textarea (and checkbox) defaultValue is properly cloned
4191 // Support: IE6-IE11+
4192 div.innerHTML = "<textarea>x</textarea>";
4193 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4194
4195 // #11217 - WebKit loses check when the name is after the checked attribute
4196 fragment.appendChild( div );
4197 div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
4198
4199 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4200 // old WebKit doesn't clone checked state correctly in fragments
4201 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4202
4203 // Support: IE<9
4204 // Opera does not clone events (and typeof div.attachEvent === undefined).
4205 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4206 support.noCloneEvent = true;
4207 if ( div.attachEvent ) {
4208 div.attachEvent( "onclick", function() {
4209 support.noCloneEvent = false;
4210 });
4211
4212 div.cloneNode( true ).click();
4213 }
4214
4215 // Execute the test only if not already executed in another module.
4216 if (support.deleteExpando == null) {
4217 // Support: IE<9
4218 support.deleteExpando = true;
4219 try {
4220 delete div.test;
4221 } catch( e ) {
4222 support.deleteExpando = false;
4223 }
4224 }
4225 })();
4226
4227
4228 (function() {
4229 var i, eventName,
4230 div = document.createElement( "div" );
4231
4232 // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
4233 for ( i in { submit: true, change: true, focusin: true }) {
4234 eventName = "on" + i;
4235
4236 if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
4237 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4238 div.setAttribute( eventName, "t" );
4239 support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
4240 }
4241 }
4242
4243 // Null elements to avoid leaks in IE.
4244 div = null;
4245 })();
4246
4247
4248 var rformElems = /^(?:input|select|textarea)$/i,
4249 rkeyEvent = /^key/,
4250 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
4251 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4252 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4253
4254 function returnTrue() {
4255 return true;
4256 }
4257
4258 function returnFalse() {
4259 return false;
4260 }
4261
4262 function safeActiveElement() {
4263 try {
4264 return document.activeElement;
4265 } catch ( err ) { }
4266 }
4267
4268 /*
4269 * Helper functions for managing events -- not part of the public interface.
4270 * Props to Dean Edwards' addEvent library for many of the ideas.
4271 */
4272 jQuery.event = {
4273
4274 global: {},
4275
4276 add: function( elem, types, handler, data, selector ) {
4277 var tmp, events, t, handleObjIn,
4278 special, eventHandle, handleObj,
4279 handlers, type, namespaces, origType,
4280 elemData = jQuery._data( elem );
4281
4282 // Don't attach events to noData or text/comment nodes (but allow plain objects)
4283 if ( !elemData ) {
4284 return;
4285 }
4286
4287 // Caller can pass in an object of custom data in lieu of the handler
4288 if ( handler.handler ) {
4289 handleObjIn = handler;
4290 handler = handleObjIn.handler;
4291 selector = handleObjIn.selector;
4292 }
4293
4294 // Make sure that the handler has a unique ID, used to find/remove it later
4295 if ( !handler.guid ) {
4296 handler.guid = jQuery.guid++;
4297 }
4298
4299 // Init the element's event structure and main handler, if this is the first
4300 if ( !(events = elemData.events) ) {
4301 events = elemData.events = {};
4302 }
4303 if ( !(eventHandle = elemData.handle) ) {
4304 eventHandle = elemData.handle = function( e ) {
4305 // Discard the second event of a jQuery.event.trigger() and
4306 // when an event is called after a page has unloaded
4307 return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
4308 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4309 undefined;
4310 };
4311 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4312 eventHandle.elem = elem;
4313 }
4314
4315 // Handle multiple events separated by a space
4316 types = ( types || "" ).match( rnotwhite ) || [ "" ];
4317 t = types.length;
4318 while ( t-- ) {
4319 tmp = rtypenamespace.exec( types[t] ) || [];
4320 type = origType = tmp[1];
4321 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4322
4323 // There *must* be a type, no attaching namespace-only handlers
4324 if ( !type ) {
4325 continue;
4326 }
4327
4328 // If event changes its type, use the special event handlers for the changed type
4329 special = jQuery.event.special[ type ] || {};
4330
4331 // If selector defined, determine special event api type, otherwise given type
4332 type = ( selector ? special.delegateType : special.bindType ) || type;
4333
4334 // Update special based on newly reset type
4335 special = jQuery.event.special[ type ] || {};
4336
4337 // handleObj is passed to all event handlers
4338 handleObj = jQuery.extend({
4339 type: type,
4340 origType: origType,
4341 data: data,
4342 handler: handler,
4343 guid: handler.guid,
4344 selector: selector,
4345 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4346 namespace: namespaces.join(".")
4347 }, handleObjIn );
4348
4349 // Init the event handler queue if we're the first
4350 if ( !(handlers = events[ type ]) ) {
4351 handlers = events[ type ] = [];
4352 handlers.delegateCount = 0;
4353
4354 // Only use addEventListener/attachEvent if the special events handler returns false
4355 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4356 // Bind the global event handler to the element
4357 if ( elem.addEventListener ) {
4358 elem.addEventListener( type, eventHandle, false );
4359
4360 } else if ( elem.attachEvent ) {
4361 elem.attachEvent( "on" + type, eventHandle );
4362 }
4363 }
4364 }
4365
4366 if ( special.add ) {
4367 special.add.call( elem, handleObj );
4368
4369 if ( !handleObj.handler.guid ) {
4370 handleObj.handler.guid = handler.guid;
4371 }
4372 }
4373
4374 // Add to the element's handler list, delegates in front
4375 if ( selector ) {
4376 handlers.splice( handlers.delegateCount++, 0, handleObj );
4377 } else {
4378 handlers.push( handleObj );
4379 }
4380
4381 // Keep track of which events have ever been used, for event optimization
4382 jQuery.event.global[ type ] = true;
4383 }
4384
4385 // Nullify elem to prevent memory leaks in IE
4386 elem = null;
4387 },
4388
4389 // Detach an event or set of events from an element
4390 remove: function( elem, types, handler, selector, mappedTypes ) {
4391 var j, handleObj, tmp,
4392 origCount, t, events,
4393 special, handlers, type,
4394 namespaces, origType,
4395 elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4396
4397 if ( !elemData || !(events = elemData.events) ) {
4398 return;
4399 }
4400
4401 // Once for each type.namespace in types; type may be omitted
4402 types = ( types || "" ).match( rnotwhite ) || [ "" ];
4403 t = types.length;
4404 while ( t-- ) {
4405 tmp = rtypenamespace.exec( types[t] ) || [];
4406 type = origType = tmp[1];
4407 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4408
4409 // Unbind all events (on this namespace, if provided) for the element
4410 if ( !type ) {
4411 for ( type in events ) {
4412 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4413 }
4414 continue;
4415 }
4416
4417 special = jQuery.event.special[ type ] || {};
4418 type = ( selector ? special.delegateType : special.bindType ) || type;
4419 handlers = events[ type ] || [];
4420 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4421
4422 // Remove matching events
4423 origCount = j = handlers.length;
4424 while ( j-- ) {
4425 handleObj = handlers[ j ];
4426
4427 if ( ( mappedTypes || origType === handleObj.origType ) &&
4428 ( !handler || handler.guid === handleObj.guid ) &&
4429 ( !tmp || tmp.test( handleObj.namespace ) ) &&
4430 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4431 handlers.splice( j, 1 );
4432
4433 if ( handleObj.selector ) {
4434 handlers.delegateCount--;
4435 }
4436 if ( special.remove ) {
4437 special.remove.call( elem, handleObj );
4438 }
4439 }
4440 }
4441
4442 // Remove generic event handler if we removed something and no more handlers exist
4443 // (avoids potential for endless recursion during removal of special event handlers)
4444 if ( origCount && !handlers.length ) {
4445 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4446 jQuery.removeEvent( elem, type, elemData.handle );
4447 }
4448
4449 delete events[ type ];
4450 }
4451 }
4452
4453 // Remove the expando if it's no longer used
4454 if ( jQuery.isEmptyObject( events ) ) {
4455 delete elemData.handle;
4456
4457 // removeData also checks for emptiness and clears the expando if empty
4458 // so use it instead of delete
4459 jQuery._removeData( elem, "events" );
4460 }
4461 },
4462
4463 trigger: function( event, data, elem, onlyHandlers ) {
4464 var handle, ontype, cur,
4465 bubbleType, special, tmp, i,
4466 eventPath = [ elem || document ],
4467 type = hasOwn.call( event, "type" ) ? event.type : event,
4468 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4469
4470 cur = tmp = elem = elem || document;
4471
4472 // Don't do events on text and comment nodes
4473 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4474 return;
4475 }
4476
4477 // focus/blur morphs to focusin/out; ensure we're not firing them right now
4478 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4479 return;
4480 }
4481
4482 if ( type.indexOf(".") >= 0 ) {
4483 // Namespaced trigger; create a regexp to match event type in handle()
4484 namespaces = type.split(".");
4485 type = namespaces.shift();
4486 namespaces.sort();
4487 }
4488 ontype = type.indexOf(":") < 0 && "on" + type;
4489
4490 // Caller can pass in a jQuery.Event object, Object, or just an event type string
4491 event = event[ jQuery.expando ] ?
4492 event :
4493 new jQuery.Event( type, typeof event === "object" && event );
4494
4495 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4496 event.isTrigger = onlyHandlers ? 2 : 3;
4497 event.namespace = namespaces.join(".");
4498 event.namespace_re = event.namespace ?
4499 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4500 null;
4501
4502 // Clean up the event in case it is being reused
4503 event.result = undefined;
4504 if ( !event.target ) {
4505 event.target = elem;
4506 }
4507
4508 // Clone any incoming data and prepend the event, creating the handler arg list
4509 data = data == null ?
4510 [ event ] :
4511 jQuery.makeArray( data, [ event ] );
4512
4513 // Allow special events to draw outside the lines
4514 special = jQuery.event.special[ type ] || {};
4515 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4516 return;
4517 }
4518
4519 // Determine event propagation path in advance, per W3C events spec (#9951)
4520 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4521 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4522
4523 bubbleType = special.delegateType || type;
4524 if ( !rfocusMorph.test( bubbleType + type ) ) {
4525 cur = cur.parentNode;
4526 }
4527 for ( ; cur; cur = cur.parentNode ) {
4528 eventPath.push( cur );
4529 tmp = cur;
4530 }
4531
4532 // Only add window if we got to document (e.g., not plain obj or detached DOM)
4533 if ( tmp === (elem.ownerDocument || document) ) {
4534 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4535 }
4536 }
4537
4538 // Fire handlers on the event path
4539 i = 0;
4540 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4541
4542 event.type = i > 1 ?
4543 bubbleType :
4544 special.bindType || type;
4545
4546 // jQuery handler
4547 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4548 if ( handle ) {
4549 handle.apply( cur, data );
4550 }
4551
4552 // Native handler
4553 handle = ontype && cur[ ontype ];
4554 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4555 event.result = handle.apply( cur, data );
4556 if ( event.result === false ) {
4557 event.preventDefault();
4558 }
4559 }
4560 }
4561 event.type = type;
4562
4563 // If nobody prevented the default action, do it now
4564 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4565
4566 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4567 jQuery.acceptData( elem ) ) {
4568
4569 // Call a native DOM method on the target with the same name name as the event.
4570 // Can't use an .isFunction() check here because IE6/7 fails that test.
4571 // Don't do default actions on window, that's where global variables be (#6170)
4572 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4573
4574 // Don't re-trigger an onFOO event when we call its FOO() method
4575 tmp = elem[ ontype ];
4576
4577 if ( tmp ) {
4578 elem[ ontype ] = null;
4579 }
4580
4581 // Prevent re-triggering of the same event, since we already bubbled it above
4582 jQuery.event.triggered = type;
4583 try {
4584 elem[ type ]();
4585 } catch ( e ) {
4586 // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4587 // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4588 }
4589 jQuery.event.triggered = undefined;
4590
4591 if ( tmp ) {
4592 elem[ ontype ] = tmp;
4593 }
4594 }
4595 }
4596 }
4597
4598 return event.result;
4599 },
4600
4601 dispatch: function( event ) {
4602
4603 // Make a writable jQuery.Event from the native event object
4604 event = jQuery.event.fix( event );
4605
4606 var i, ret, handleObj, matched, j,
4607 handlerQueue = [],
4608 args = slice.call( arguments ),
4609 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4610 special = jQuery.event.special[ event.type ] || {};
4611
4612 // Use the fix-ed jQuery.Event rather than the (read-only) native event
4613 args[0] = event;
4614 event.delegateTarget = this;
4615
4616 // Call the preDispatch hook for the mapped type, and let it bail if desired
4617 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4618 return;
4619 }
4620
4621 // Determine handlers
4622 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4623
4624 // Run delegates first; they may want to stop propagation beneath us
4625 i = 0;
4626 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4627 event.currentTarget = matched.elem;
4628
4629 j = 0;
4630 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4631
4632 // Triggered event must either 1) have no namespace, or
4633 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4634 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4635
4636 event.handleObj = handleObj;
4637 event.data = handleObj.data;
4638
4639 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4640 .apply( matched.elem, args );
4641
4642 if ( ret !== undefined ) {
4643 if ( (event.result = ret) === false ) {
4644 event.preventDefault();
4645 event.stopPropagation();
4646 }
4647 }
4648 }
4649 }
4650 }
4651
4652 // Call the postDispatch hook for the mapped type
4653 if ( special.postDispatch ) {
4654 special.postDispatch.call( this, event );
4655 }
4656
4657 return event.result;
4658 },
4659
4660 handlers: function( event, handlers ) {
4661 var sel, handleObj, matches, i,
4662 handlerQueue = [],
4663 delegateCount = handlers.delegateCount,
4664 cur = event.target;
4665
4666 // Find delegate handlers
4667 // Black-hole SVG <use> instance trees (#13180)
4668 // Avoid non-left-click bubbling in Firefox (#3861)
4669 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4670
4671 /* jshint eqeqeq: false */
4672 for ( ; cur != this; cur = cur.parentNode || this ) {
4673 /* jshint eqeqeq: true */
4674
4675 // Don't check non-elements (#13208)
4676 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4677 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4678 matches = [];
4679 for ( i = 0; i < delegateCount; i++ ) {
4680 handleObj = handlers[ i ];
4681
4682 // Don't conflict with Object.prototype properties (#13203)
4683 sel = handleObj.selector + " ";
4684
4685 if ( matches[ sel ] === undefined ) {
4686 matches[ sel ] = handleObj.needsContext ?
4687 jQuery( sel, this ).index( cur ) >= 0 :
4688 jQuery.find( sel, this, null, [ cur ] ).length;
4689 }
4690 if ( matches[ sel ] ) {
4691 matches.push( handleObj );
4692 }
4693 }
4694 if ( matches.length ) {
4695 handlerQueue.push({ elem: cur, handlers: matches });
4696 }
4697 }
4698 }
4699 }
4700
4701 // Add the remaining (directly-bound) handlers
4702 if ( delegateCount < handlers.length ) {
4703 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4704 }
4705
4706 return handlerQueue;
4707 },
4708
4709 fix: function( event ) {
4710 if ( event[ jQuery.expando ] ) {
4711 return event;
4712 }
4713
4714 // Create a writable copy of the event object and normalize some properties
4715 var i, prop, copy,
4716 type = event.type,
4717 originalEvent = event,
4718 fixHook = this.fixHooks[ type ];
4719
4720 if ( !fixHook ) {
4721 this.fixHooks[ type ] = fixHook =
4722 rmouseEvent.test( type ) ? this.mouseHooks :
4723 rkeyEvent.test( type ) ? this.keyHooks :
4724 {};
4725 }
4726 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4727
4728 event = new jQuery.Event( originalEvent );
4729
4730 i = copy.length;
4731 while ( i-- ) {
4732 prop = copy[ i ];
4733 event[ prop ] = originalEvent[ prop ];
4734 }
4735
4736 // Support: IE<9
4737 // Fix target property (#1925)
4738 if ( !event.target ) {
4739 event.target = originalEvent.srcElement || document;
4740 }
4741
4742 // Support: Chrome 23+, Safari?
4743 // Target should not be a text node (#504, #13143)
4744 if ( event.target.nodeType === 3 ) {
4745 event.target = event.target.parentNode;
4746 }
4747
4748 // Support: IE<9
4749 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4750 event.metaKey = !!event.metaKey;
4751
4752 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4753 },
4754
4755 // Includes some event props shared by KeyEvent and MouseEvent
4756 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4757
4758 fixHooks: {},
4759
4760 keyHooks: {
4761 props: "char charCode key keyCode".split(" "),
4762 filter: function( event, original ) {
4763
4764 // Add which for key events
4765 if ( event.which == null ) {
4766 event.which = original.charCode != null ? original.charCode : original.keyCode;
4767 }
4768
4769 return event;
4770 }
4771 },
4772
4773 mouseHooks: {
4774 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4775 filter: function( event, original ) {
4776 var body, eventDoc, doc,
4777 button = original.button,
4778 fromElement = original.fromElement;
4779
4780 // Calculate pageX/Y if missing and clientX/Y available
4781 if ( event.pageX == null && original.clientX != null ) {
4782 eventDoc = event.target.ownerDocument || document;
4783 doc = eventDoc.documentElement;
4784 body = eventDoc.body;
4785
4786 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4787 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4788 }
4789
4790 // Add relatedTarget, if necessary
4791 if ( !event.relatedTarget && fromElement ) {
4792 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4793 }
4794
4795 // Add which for click: 1 === left; 2 === middle; 3 === right
4796 // Note: button is not normalized, so don't use it
4797 if ( !event.which && button !== undefined ) {
4798 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4799 }
4800
4801 return event;
4802 }
4803 },
4804
4805 special: {
4806 load: {
4807 // Prevent triggered image.load events from bubbling to window.load
4808 noBubble: true
4809 },
4810 focus: {
4811 // Fire native event if possible so blur/focus sequence is correct
4812 trigger: function() {
4813 if ( this !== safeActiveElement() && this.focus ) {
4814 try {
4815 this.focus();
4816 return false;
4817 } catch ( e ) {
4818 // Support: IE<9
4819 // If we error on focus to hidden element (#1486, #12518),
4820 // let .trigger() run the handlers
4821 }
4822 }
4823 },
4824 delegateType: "focusin"
4825 },
4826 blur: {
4827 trigger: function() {
4828 if ( this === safeActiveElement() && this.blur ) {
4829 this.blur();
4830 return false;
4831 }
4832 },
4833 delegateType: "focusout"
4834 },
4835 click: {
4836 // For checkbox, fire native event so checked state will be right
4837 trigger: function() {
4838 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4839 this.click();
4840 return false;
4841 }
4842 },
4843
4844 // For cross-browser consistency, don't fire native .click() on links
4845 _default: function( event ) {
4846 return jQuery.nodeName( event.target, "a" );
4847 }
4848 },
4849
4850 beforeunload: {
4851 postDispatch: function( event ) {
4852
4853 // Support: Firefox 20+
4854 // Firefox doesn't alert if the returnValue field is not set.
4855 if ( event.result !== undefined && event.originalEvent ) {
4856 event.originalEvent.returnValue = event.result;
4857 }
4858 }
4859 }
4860 },
4861
4862 simulate: function( type, elem, event, bubble ) {
4863 // Piggyback on a donor event to simulate a different one.
4864 // Fake originalEvent to avoid donor's stopPropagation, but if the
4865 // simulated event prevents default then we do the same on the donor.
4866 var e = jQuery.extend(
4867 new jQuery.Event(),
4868 event,
4869 {
4870 type: type,
4871 isSimulated: true,
4872 originalEvent: {}
4873 }
4874 );
4875 if ( bubble ) {
4876 jQuery.event.trigger( e, null, elem );
4877 } else {
4878 jQuery.event.dispatch.call( elem, e );
4879 }
4880 if ( e.isDefaultPrevented() ) {
4881 event.preventDefault();
4882 }
4883 }
4884 };
4885
4886 jQuery.removeEvent = document.removeEventListener ?
4887 function( elem, type, handle ) {
4888 if ( elem.removeEventListener ) {
4889 elem.removeEventListener( type, handle, false );
4890 }
4891 } :
4892 function( elem, type, handle ) {
4893 var name = "on" + type;
4894
4895 if ( elem.detachEvent ) {
4896
4897 // #8545, #7054, preventing memory leaks for custom events in IE6-8
4898 // detachEvent needed property on element, by name of that event, to properly expose it to GC
4899 if ( typeof elem[ name ] === strundefined ) {
4900 elem[ name ] = null;
4901 }
4902
4903 elem.detachEvent( name, handle );
4904 }
4905 };
4906
4907 jQuery.Event = function( src, props ) {
4908 // Allow instantiation without the 'new' keyword
4909 if ( !(this instanceof jQuery.Event) ) {
4910 return new jQuery.Event( src, props );
4911 }
4912
4913 // Event object
4914 if ( src && src.type ) {
4915 this.originalEvent = src;
4916 this.type = src.type;
4917
4918 // Events bubbling up the document may have been marked as prevented
4919 // by a handler lower down the tree; reflect the correct value.
4920 this.isDefaultPrevented = src.defaultPrevented ||
4921 src.defaultPrevented === undefined &&
4922 // Support: IE < 9, Android < 4.0
4923 src.returnValue === false ?
4924 returnTrue :
4925 returnFalse;
4926
4927 // Event type
4928 } else {
4929 this.type = src;
4930 }
4931
4932 // Put explicitly provided properties onto the event object
4933 if ( props ) {
4934 jQuery.extend( this, props );
4935 }
4936
4937 // Create a timestamp if incoming event doesn't have one
4938 this.timeStamp = src && src.timeStamp || jQuery.now();
4939
4940 // Mark it as fixed
4941 this[ jQuery.expando ] = true;
4942 };
4943
4944 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4945 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4946 jQuery.Event.prototype = {
4947 isDefaultPrevented: returnFalse,
4948 isPropagationStopped: returnFalse,
4949 isImmediatePropagationStopped: returnFalse,
4950
4951 preventDefault: function() {
4952 var e = this.originalEvent;
4953
4954 this.isDefaultPrevented = returnTrue;
4955 if ( !e ) {
4956 return;
4957 }
4958
4959 // If preventDefault exists, run it on the original event
4960 if ( e.preventDefault ) {
4961 e.preventDefault();
4962
4963 // Support: IE
4964 // Otherwise set the returnValue property of the original event to false
4965 } else {
4966 e.returnValue = false;
4967 }
4968 },
4969 stopPropagation: function() {
4970 var e = this.originalEvent;
4971
4972 this.isPropagationStopped = returnTrue;
4973 if ( !e ) {
4974 return;
4975 }
4976 // If stopPropagation exists, run it on the original event
4977 if ( e.stopPropagation ) {
4978 e.stopPropagation();
4979 }
4980
4981 // Support: IE
4982 // Set the cancelBubble property of the original event to true
4983 e.cancelBubble = true;
4984 },
4985 stopImmediatePropagation: function() {
4986 var e = this.originalEvent;
4987
4988 this.isImmediatePropagationStopped = returnTrue;
4989
4990 if ( e && e.stopImmediatePropagation ) {
4991 e.stopImmediatePropagation();
4992 }
4993
4994 this.stopPropagation();
4995 }
4996 };
4997
4998 // Create mouseenter/leave events using mouseover/out and event-time checks
4999 jQuery.each({
5000 mouseenter: "mouseover",
5001 mouseleave: "mouseout",
5002 pointerenter: "pointerover",
5003 pointerleave: "pointerout"
5004 }, function( orig, fix ) {
5005 jQuery.event.special[ orig ] = {
5006 delegateType: fix,
5007 bindType: fix,
5008
5009 handle: function( event ) {
5010 var ret,
5011 target = this,
5012 related = event.relatedTarget,
5013 handleObj = event.handleObj;
5014
5015 // For mousenter/leave call the handler if related is outside the target.
5016 // NB: No relatedTarget if the mouse left/entered the browser window
5017 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5018 event.type = handleObj.origType;
5019 ret = handleObj.handler.apply( this, arguments );
5020 event.type = fix;
5021 }
5022 return ret;
5023 }
5024 };
5025 });
5026
5027 // IE submit delegation
5028 if ( !support.submitBubbles ) {
5029
5030 jQuery.event.special.submit = {
5031 setup: function() {
5032 // Only need this for delegated form submit events
5033 if ( jQuery.nodeName( this, "form" ) ) {
5034 return false;
5035 }
5036
5037 // Lazy-add a submit handler when a descendant form may potentially be submitted
5038 jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5039 // Node name check avoids a VML-related crash in IE (#9807)
5040 var elem = e.target,
5041 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5042 if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5043 jQuery.event.add( form, "submit._submit", function( event ) {
5044 event._submit_bubble = true;
5045 });
5046 jQuery._data( form, "submitBubbles", true );
5047 }
5048 });
5049 // return undefined since we don't need an event listener
5050 },
5051
5052 postDispatch: function( event ) {
5053 // If form was submitted by the user, bubble the event up the tree
5054 if ( event._submit_bubble ) {
5055 delete event._submit_bubble;
5056 if ( this.parentNode && !event.isTrigger ) {
5057 jQuery.event.simulate( "submit", this.parentNode, event, true );
5058 }
5059 }
5060 },
5061
5062 teardown: function() {
5063 // Only need this for delegated form submit events
5064 if ( jQuery.nodeName( this, "form" ) ) {
5065 return false;
5066 }
5067
5068 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5069 jQuery.event.remove( this, "._submit" );
5070 }
5071 };
5072 }
5073
5074 // IE change delegation and checkbox/radio fix
5075 if ( !support.changeBubbles ) {
5076
5077 jQuery.event.special.change = {
5078
5079 setup: function() {
5080
5081 if ( rformElems.test( this.nodeName ) ) {
5082 // IE doesn't fire change on a check/radio until blur; trigger it on click
5083 // after a propertychange. Eat the blur-change in special.change.handle.
5084 // This still fires onchange a second time for check/radio after blur.
5085 if ( this.type === "checkbox" || this.type === "radio" ) {
5086 jQuery.event.add( this, "propertychange._change", function( event ) {
5087 if ( event.originalEvent.propertyName === "checked" ) {
5088 this._just_changed = true;
5089 }
5090 });
5091 jQuery.event.add( this, "click._change", function( event ) {
5092 if ( this._just_changed && !event.isTrigger ) {
5093 this._just_changed = false;
5094 }
5095 // Allow triggered, simulated change events (#11500)
5096 jQuery.event.simulate( "change", this, event, true );
5097 });
5098 }
5099 return false;
5100 }
5101 // Delegated event; lazy-add a change handler on descendant inputs
5102 jQuery.event.add( this, "beforeactivate._change", function( e ) {
5103 var elem = e.target;
5104
5105 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5106 jQuery.event.add( elem, "change._change", function( event ) {
5107 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5108 jQuery.event.simulate( "change", this.parentNode, event, true );
5109 }
5110 });
5111 jQuery._data( elem, "changeBubbles", true );
5112 }
5113 });
5114 },
5115
5116 handle: function( event ) {
5117 var elem = event.target;
5118
5119 // Swallow native change events from checkbox/radio, we already triggered them above
5120 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5121 return event.handleObj.handler.apply( this, arguments );
5122 }
5123 },
5124
5125 teardown: function() {
5126 jQuery.event.remove( this, "._change" );
5127
5128 return !rformElems.test( this.nodeName );
5129 }
5130 };
5131 }
5132
5133 // Create "bubbling" focus and blur events
5134 if ( !support.focusinBubbles ) {
5135 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5136
5137 // Attach a single capturing handler on the document while someone wants focusin/focusout
5138 var handler = function( event ) {
5139 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5140 };
5141
5142 jQuery.event.special[ fix ] = {
5143 setup: function() {
5144 var doc = this.ownerDocument || this,
5145 attaches = jQuery._data( doc, fix );
5146
5147 if ( !attaches ) {
5148 doc.addEventListener( orig, handler, true );
5149 }
5150 jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5151 },
5152 teardown: function() {
5153 var doc = this.ownerDocument || this,
5154 attaches = jQuery._data( doc, fix ) - 1;
5155
5156 if ( !attaches ) {
5157 doc.removeEventListener( orig, handler, true );
5158 jQuery._removeData( doc, fix );
5159 } else {
5160 jQuery._data( doc, fix, attaches );
5161 }
5162 }
5163 };
5164 });
5165 }
5166
5167 jQuery.fn.extend({
5168
5169 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5170 var type, origFn;
5171
5172 // Types can be a map of types/handlers
5173 if ( typeof types === "object" ) {
5174 // ( types-Object, selector, data )
5175 if ( typeof selector !== "string" ) {
5176 // ( types-Object, data )
5177 data = data || selector;
5178 selector = undefined;
5179 }
5180 for ( type in types ) {
5181 this.on( type, selector, data, types[ type ], one );
5182 }
5183 return this;
5184 }
5185
5186 if ( data == null && fn == null ) {
5187 // ( types, fn )
5188 fn = selector;
5189 data = selector = undefined;
5190 } else if ( fn == null ) {
5191 if ( typeof selector === "string" ) {
5192 // ( types, selector, fn )
5193 fn = data;
5194 data = undefined;
5195 } else {
5196 // ( types, data, fn )
5197 fn = data;
5198 data = selector;
5199 selector = undefined;
5200 }
5201 }
5202 if ( fn === false ) {
5203 fn = returnFalse;
5204 } else if ( !fn ) {
5205 return this;
5206 }
5207
5208 if ( one === 1 ) {
5209 origFn = fn;
5210 fn = function( event ) {
5211 // Can use an empty set, since event contains the info
5212 jQuery().off( event );
5213 return origFn.apply( this, arguments );
5214 };
5215 // Use same guid so caller can remove using origFn
5216 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5217 }
5218 return this.each( function() {
5219 jQuery.event.add( this, types, fn, data, selector );
5220 });
5221 },
5222 one: function( types, selector, data, fn ) {
5223 return this.on( types, selector, data, fn, 1 );
5224 },
5225 off: function( types, selector, fn ) {
5226 var handleObj, type;
5227 if ( types && types.preventDefault && types.handleObj ) {
5228 // ( event ) dispatched jQuery.Event
5229 handleObj = types.handleObj;
5230 jQuery( types.delegateTarget ).off(
5231 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5232 handleObj.selector,
5233 handleObj.handler
5234 );
5235 return this;
5236 }
5237 if ( typeof types === "object" ) {
5238 // ( types-object [, selector] )
5239 for ( type in types ) {
5240 this.off( type, selector, types[ type ] );
5241 }
5242 return this;
5243 }
5244 if ( selector === false || typeof selector === "function" ) {
5245 // ( types [, fn] )
5246 fn = selector;
5247 selector = undefined;
5248 }
5249 if ( fn === false ) {
5250 fn = returnFalse;
5251 }
5252 return this.each(function() {
5253 jQuery.event.remove( this, types, fn, selector );
5254 });
5255 },
5256
5257 trigger: function( type, data ) {
5258 return this.each(function() {
5259 jQuery.event.trigger( type, data, this );
5260 });
5261 },
5262 triggerHandler: function( type, data ) {
5263 var elem = this[0];
5264 if ( elem ) {
5265 return jQuery.event.trigger( type, data, elem, true );
5266 }
5267 }
5268 });
5269
5270
5271 function createSafeFragment( document ) {
5272 var list = nodeNames.split( "|" ),
5273 safeFrag = document.createDocumentFragment();
5274
5275 if ( safeFrag.createElement ) {
5276 while ( list.length ) {
5277 safeFrag.createElement(
5278 list.pop()
5279 );
5280 }
5281 }
5282 return safeFrag;
5283 }
5284
5285 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5286 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5287 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5288 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5289 rleadingWhitespace = /^\s+/,
5290 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5291 rtagName = /<([\w:]+)/,
5292 rtbody = /<tbody/i,
5293 rhtml = /<|&#?\w+;/,
5294 rnoInnerhtml = /<(?:script|style|link)/i,
5295 // checked="checked" or checked
5296 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5297 rscriptType = /^$|\/(?:java|ecma)script/i,
5298 rscriptTypeMasked = /^true\/(.*)/,
5299 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5300
5301 // We have to close these tags to support XHTML (#13200)
5302 wrapMap = {
5303 option: [ 1, "<select multiple='multiple'>", "</select>" ],
5304 legend: [ 1, "<fieldset>", "</fieldset>" ],
5305 area: [ 1, "<map>", "</map>" ],
5306 param: [ 1, "<object>", "</object>" ],
5307 thead: [ 1, "<table>", "</table>" ],
5308 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5309 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5310 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5311
5312 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5313 // unless wrapped in a div with non-breaking characters in front of it.
5314 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5315 },
5316 safeFragment = createSafeFragment( document ),
5317 fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5318
5319 wrapMap.optgroup = wrapMap.option;
5320 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5321 wrapMap.th = wrapMap.td;
5322
5323 function getAll( context, tag ) {
5324 var elems, elem,
5325 i = 0,
5326 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
5327 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
5328 undefined;
5329
5330 if ( !found ) {
5331 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5332 if ( !tag || jQuery.nodeName( elem, tag ) ) {
5333 found.push( elem );
5334 } else {
5335 jQuery.merge( found, getAll( elem, tag ) );
5336 }
5337 }
5338 }
5339
5340 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5341 jQuery.merge( [ context ], found ) :
5342 found;
5343 }
5344
5345 // Used in buildFragment, fixes the defaultChecked property
5346 function fixDefaultChecked( elem ) {
5347 if ( rcheckableType.test( elem.type ) ) {
5348 elem.defaultChecked = elem.checked;
5349 }
5350 }
5351
5352 // Support: IE<8
5353 // Manipulating tables requires a tbody
5354 function manipulationTarget( elem, content ) {
5355 return jQuery.nodeName( elem, "table" ) &&
5356 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5357
5358 elem.getElementsByTagName("tbody")[0] ||
5359 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
5360 elem;
5361 }
5362
5363 // Replace/restore the type attribute of script elements for safe DOM manipulation
5364 function disableScript( elem ) {
5365 elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
5366 return elem;
5367 }
5368 function restoreScript( elem ) {
5369 var match = rscriptTypeMasked.exec( elem.type );
5370 if ( match ) {
5371 elem.type = match[1];
5372 } else {
5373 elem.removeAttribute("type");
5374 }
5375 return elem;
5376 }
5377
5378 // Mark scripts as having already been evaluated
5379 function setGlobalEval( elems, refElements ) {
5380 var elem,
5381 i = 0;
5382 for ( ; (elem = elems[i]) != null; i++ ) {
5383 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5384 }
5385 }
5386
5387 function cloneCopyEvent( src, dest ) {
5388
5389 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5390 return;
5391 }
5392
5393 var type, i, l,
5394 oldData = jQuery._data( src ),
5395 curData = jQuery._data( dest, oldData ),
5396 events = oldData.events;
5397
5398 if ( events ) {
5399 delete curData.handle;
5400 curData.events = {};
5401
5402 for ( type in events ) {
5403 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5404 jQuery.event.add( dest, type, events[ type ][ i ] );
5405 }
5406 }
5407 }
5408
5409 // make the cloned public data object a copy from the original
5410 if ( curData.data ) {
5411 curData.data = jQuery.extend( {}, curData.data );
5412 }
5413 }
5414
5415 function fixCloneNodeIssues( src, dest ) {
5416 var nodeName, e, data;
5417
5418 // We do not need to do anything for non-Elements
5419 if ( dest.nodeType !== 1 ) {
5420 return;
5421 }
5422
5423 nodeName = dest.nodeName.toLowerCase();
5424
5425 // IE6-8 copies events bound via attachEvent when using cloneNode.
5426 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5427 data = jQuery._data( dest );
5428
5429 for ( e in data.events ) {
5430 jQuery.removeEvent( dest, e, data.handle );
5431 }
5432
5433 // Event data gets referenced instead of copied if the expando gets copied too
5434 dest.removeAttribute( jQuery.expando );
5435 }
5436
5437 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5438 if ( nodeName === "script" && dest.text !== src.text ) {
5439 disableScript( dest ).text = src.text;
5440 restoreScript( dest );
5441
5442 // IE6-10 improperly clones children of object elements using classid.
5443 // IE10 throws NoModificationAllowedError if parent is null, #12132.
5444 } else if ( nodeName === "object" ) {
5445 if ( dest.parentNode ) {
5446 dest.outerHTML = src.outerHTML;
5447 }
5448
5449 // This path appears unavoidable for IE9. When cloning an object
5450 // element in IE9, the outerHTML strategy above is not sufficient.
5451 // If the src has innerHTML and the destination does not,
5452 // copy the src.innerHTML into the dest.innerHTML. #10324
5453 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5454 dest.innerHTML = src.innerHTML;
5455 }
5456
5457 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5458 // IE6-8 fails to persist the checked state of a cloned checkbox
5459 // or radio button. Worse, IE6-7 fail to give the cloned element
5460 // a checked appearance if the defaultChecked value isn't also set
5461
5462 dest.defaultChecked = dest.checked = src.checked;
5463
5464 // IE6-7 get confused and end up setting the value of a cloned
5465 // checkbox/radio button to an empty string instead of "on"
5466 if ( dest.value !== src.value ) {
5467 dest.value = src.value;
5468 }
5469
5470 // IE6-8 fails to return the selected option to the default selected
5471 // state when cloning options
5472 } else if ( nodeName === "option" ) {
5473 dest.defaultSelected = dest.selected = src.defaultSelected;
5474
5475 // IE6-8 fails to set the defaultValue to the correct value when
5476 // cloning other types of input fields
5477 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5478 dest.defaultValue = src.defaultValue;
5479 }
5480 }
5481
5482 jQuery.extend({
5483 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5484 var destElements, node, clone, i, srcElements,
5485 inPage = jQuery.contains( elem.ownerDocument, elem );
5486
5487 if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5488 clone = elem.cloneNode( true );
5489
5490 // IE<=8 does not properly clone detached, unknown element nodes
5491 } else {
5492 fragmentDiv.innerHTML = elem.outerHTML;
5493 fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5494 }
5495
5496 if ( (!support.noCloneEvent || !support.noCloneChecked) &&
5497 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5498
5499 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5500 destElements = getAll( clone );
5501 srcElements = getAll( elem );
5502
5503 // Fix all IE cloning issues
5504 for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5505 // Ensure that the destination node is not null; Fixes #9587
5506 if ( destElements[i] ) {
5507 fixCloneNodeIssues( node, destElements[i] );
5508 }
5509 }
5510 }
5511
5512 // Copy the events from the original to the clone
5513 if ( dataAndEvents ) {
5514 if ( deepDataAndEvents ) {
5515 srcElements = srcElements || getAll( elem );
5516 destElements = destElements || getAll( clone );
5517
5518 for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5519 cloneCopyEvent( node, destElements[i] );
5520 }
5521 } else {
5522 cloneCopyEvent( elem, clone );
5523 }
5524 }
5525
5526 // Preserve script evaluation history
5527 destElements = getAll( clone, "script" );
5528 if ( destElements.length > 0 ) {
5529 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5530 }
5531
5532 destElements = srcElements = node = null;
5533
5534 // Return the cloned set
5535 return clone;
5536 },
5537
5538 buildFragment: function( elems, context, scripts, selection ) {
5539 var j, elem, contains,
5540 tmp, tag, tbody, wrap,
5541 l = elems.length,
5542
5543 // Ensure a safe fragment
5544 safe = createSafeFragment( context ),
5545
5546 nodes = [],
5547 i = 0;
5548
5549 for ( ; i < l; i++ ) {
5550 elem = elems[ i ];
5551
5552 if ( elem || elem === 0 ) {
5553
5554 // Add nodes directly
5555 if ( jQuery.type( elem ) === "object" ) {
5556 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5557
5558 // Convert non-html into a text node
5559 } else if ( !rhtml.test( elem ) ) {
5560 nodes.push( context.createTextNode( elem ) );
5561
5562 // Convert html into DOM nodes
5563 } else {
5564 tmp = tmp || safe.appendChild( context.createElement("div") );
5565
5566 // Deserialize a standard representation
5567 tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
5568 wrap = wrapMap[ tag ] || wrapMap._default;
5569
5570 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5571
5572 // Descend through wrappers to the right content
5573 j = wrap[0];
5574 while ( j-- ) {
5575 tmp = tmp.lastChild;
5576 }
5577
5578 // Manually add leading whitespace removed by IE
5579 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5580 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5581 }
5582
5583 // Remove IE's autoinserted <tbody> from table fragments
5584 if ( !support.tbody ) {
5585
5586 // String was a <table>, *may* have spurious <tbody>
5587 elem = tag === "table" && !rtbody.test( elem ) ?
5588 tmp.firstChild :
5589
5590 // String was a bare <thead> or <tfoot>
5591 wrap[1] === "<table>" && !rtbody.test( elem ) ?
5592 tmp :
5593 0;
5594
5595 j = elem && elem.childNodes.length;
5596 while ( j-- ) {
5597 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5598 elem.removeChild( tbody );
5599 }
5600 }
5601 }
5602
5603 jQuery.merge( nodes, tmp.childNodes );
5604
5605 // Fix #12392 for WebKit and IE > 9
5606 tmp.textContent = "";
5607
5608 // Fix #12392 for oldIE
5609 while ( tmp.firstChild ) {
5610 tmp.removeChild( tmp.firstChild );
5611 }
5612
5613 // Remember the top-level container for proper cleanup
5614 tmp = safe.lastChild;
5615 }
5616 }
5617 }
5618
5619 // Fix #11356: Clear elements from fragment
5620 if ( tmp ) {
5621 safe.removeChild( tmp );
5622 }
5623
5624 // Reset defaultChecked for any radios and checkboxes
5625 // about to be appended to the DOM in IE 6/7 (#8060)
5626 if ( !support.appendChecked ) {
5627 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5628 }
5629
5630 i = 0;
5631 while ( (elem = nodes[ i++ ]) ) {
5632
5633 // #4087 - If origin and destination elements are the same, and this is
5634 // that element, do not do anything
5635 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5636 continue;
5637 }
5638
5639 contains = jQuery.contains( elem.ownerDocument, elem );
5640
5641 // Append to fragment
5642 tmp = getAll( safe.appendChild( elem ), "script" );
5643
5644 // Preserve script evaluation history
5645 if ( contains ) {
5646 setGlobalEval( tmp );
5647 }
5648
5649 // Capture executables
5650 if ( scripts ) {
5651 j = 0;
5652 while ( (elem = tmp[ j++ ]) ) {
5653 if ( rscriptType.test( elem.type || "" ) ) {
5654 scripts.push( elem );
5655 }
5656 }
5657 }
5658 }
5659
5660 tmp = null;
5661
5662 return safe;
5663 },
5664
5665 cleanData: function( elems, /* internal */ acceptData ) {
5666 var elem, type, id, data,
5667 i = 0,
5668 internalKey = jQuery.expando,
5669 cache = jQuery.cache,
5670 deleteExpando = support.deleteExpando,
5671 special = jQuery.event.special;
5672
5673 for ( ; (elem = elems[i]) != null; i++ ) {
5674 if ( acceptData || jQuery.acceptData( elem ) ) {
5675
5676 id = elem[ internalKey ];
5677 data = id && cache[ id ];
5678
5679 if ( data ) {
5680 if ( data.events ) {
5681 for ( type in data.events ) {
5682 if ( special[ type ] ) {
5683 jQuery.event.remove( elem, type );
5684
5685 // This is a shortcut to avoid jQuery.event.remove's overhead
5686 } else {
5687 jQuery.removeEvent( elem, type, data.handle );
5688 }
5689 }
5690 }
5691
5692 // Remove cache only if it was not already removed by jQuery.event.remove
5693 if ( cache[ id ] ) {
5694
5695 delete cache[ id ];
5696
5697 // IE does not allow us to delete expando properties from nodes,
5698 // nor does it have a removeAttribute function on Document nodes;
5699 // we must handle all of these cases
5700 if ( deleteExpando ) {
5701 delete elem[ internalKey ];
5702
5703 } else if ( typeof elem.removeAttribute !== strundefined ) {
5704 elem.removeAttribute( internalKey );
5705
5706 } else {
5707 elem[ internalKey ] = null;
5708 }
5709
5710 deletedIds.push( id );
5711 }
5712 }
5713 }
5714 }
5715 }
5716 });
5717
5718 jQuery.fn.extend({
5719 text: function( value ) {
5720 return access( this, function( value ) {
5721 return value === undefined ?
5722 jQuery.text( this ) :
5723 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5724 }, null, value, arguments.length );
5725 },
5726
5727 append: function() {
5728 return this.domManip( arguments, function( elem ) {
5729 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5730 var target = manipulationTarget( this, elem );
5731 target.appendChild( elem );
5732 }
5733 });
5734 },
5735
5736 prepend: function() {
5737 return this.domManip( arguments, function( elem ) {
5738 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5739 var target = manipulationTarget( this, elem );
5740 target.insertBefore( elem, target.firstChild );
5741 }
5742 });
5743 },
5744
5745 before: function() {
5746 return this.domManip( arguments, function( elem ) {
5747 if ( this.parentNode ) {
5748 this.parentNode.insertBefore( elem, this );
5749 }
5750 });
5751 },
5752
5753 after: function() {
5754 return this.domManip( arguments, function( elem ) {
5755 if ( this.parentNode ) {
5756 this.parentNode.insertBefore( elem, this.nextSibling );
5757 }
5758 });
5759 },
5760
5761 remove: function( selector, keepData /* Internal Use Only */ ) {
5762 var elem,
5763 elems = selector ? jQuery.filter( selector, this ) : this,
5764 i = 0;
5765
5766 for ( ; (elem = elems[i]) != null; i++ ) {
5767
5768 if ( !keepData && elem.nodeType === 1 ) {
5769 jQuery.cleanData( getAll( elem ) );
5770 }
5771
5772 if ( elem.parentNode ) {
5773 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5774 setGlobalEval( getAll( elem, "script" ) );
5775 }
5776 elem.parentNode.removeChild( elem );
5777 }
5778 }
5779
5780 return this;
5781 },
5782
5783 empty: function() {
5784 var elem,
5785 i = 0;
5786
5787 for ( ; (elem = this[i]) != null; i++ ) {
5788 // Remove element nodes and prevent memory leaks
5789 if ( elem.nodeType === 1 ) {
5790 jQuery.cleanData( getAll( elem, false ) );
5791 }
5792
5793 // Remove any remaining nodes
5794 while ( elem.firstChild ) {
5795 elem.removeChild( elem.firstChild );
5796 }
5797
5798 // If this is a select, ensure that it displays empty (#12336)
5799 // Support: IE<9
5800 if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5801 elem.options.length = 0;
5802 }
5803 }
5804
5805 return this;
5806 },
5807
5808 clone: function( dataAndEvents, deepDataAndEvents ) {
5809 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5810 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5811
5812 return this.map(function() {
5813 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5814 });
5815 },
5816
5817 html: function( value ) {
5818 return access( this, function( value ) {
5819 var elem = this[ 0 ] || {},
5820 i = 0,
5821 l = this.length;
5822
5823 if ( value === undefined ) {
5824 return elem.nodeType === 1 ?
5825 elem.innerHTML.replace( rinlinejQuery, "" ) :
5826 undefined;
5827 }
5828
5829 // See if we can take a shortcut and just use innerHTML
5830 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5831 ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
5832 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5833 !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
5834
5835 value = value.replace( rxhtmlTag, "<$1></$2>" );
5836
5837 try {
5838 for (; i < l; i++ ) {
5839 // Remove element nodes and prevent memory leaks
5840 elem = this[i] || {};
5841 if ( elem.nodeType === 1 ) {
5842 jQuery.cleanData( getAll( elem, false ) );
5843 elem.innerHTML = value;
5844 }
5845 }
5846
5847 elem = 0;
5848
5849 // If using innerHTML throws an exception, use the fallback method
5850 } catch(e) {}
5851 }
5852
5853 if ( elem ) {
5854 this.empty().append( value );
5855 }
5856 }, null, value, arguments.length );
5857 },
5858
5859 replaceWith: function() {
5860 var arg = arguments[ 0 ];
5861
5862 // Make the changes, replacing each context element with the new content
5863 this.domManip( arguments, function( elem ) {
5864 arg = this.parentNode;
5865
5866 jQuery.cleanData( getAll( this ) );
5867
5868 if ( arg ) {
5869 arg.replaceChild( elem, this );
5870 }
5871 });
5872
5873 // Force removal if there was no new content (e.g., from empty arguments)
5874 return arg && (arg.length || arg.nodeType) ? this : this.remove();
5875 },
5876
5877 detach: function( selector ) {
5878 return this.remove( selector, true );
5879 },
5880
5881 domManip: function( args, callback ) {
5882
5883 // Flatten any nested arrays
5884 args = concat.apply( [], args );
5885
5886 var first, node, hasScripts,
5887 scripts, doc, fragment,
5888 i = 0,
5889 l = this.length,
5890 set = this,
5891 iNoClone = l - 1,
5892 value = args[0],
5893 isFunction = jQuery.isFunction( value );
5894
5895 // We can't cloneNode fragments that contain checked, in WebKit
5896 if ( isFunction ||
5897 ( l > 1 && typeof value === "string" &&
5898 !support.checkClone && rchecked.test( value ) ) ) {
5899 return this.each(function( index ) {
5900 var self = set.eq( index );
5901 if ( isFunction ) {
5902 args[0] = value.call( this, index, self.html() );
5903 }
5904 self.domManip( args, callback );
5905 });
5906 }
5907
5908 if ( l ) {
5909 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5910 first = fragment.firstChild;
5911
5912 if ( fragment.childNodes.length === 1 ) {
5913 fragment = first;
5914 }
5915
5916 if ( first ) {
5917 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5918 hasScripts = scripts.length;
5919
5920 // Use the original fragment for the last item instead of the first because it can end up
5921 // being emptied incorrectly in certain situations (#8070).
5922 for ( ; i < l; i++ ) {
5923 node = fragment;
5924
5925 if ( i !== iNoClone ) {
5926 node = jQuery.clone( node, true, true );
5927
5928 // Keep references to cloned scripts for later restoration
5929 if ( hasScripts ) {
5930 jQuery.merge( scripts, getAll( node, "script" ) );
5931 }
5932 }
5933
5934 callback.call( this[i], node, i );
5935 }
5936
5937 if ( hasScripts ) {
5938 doc = scripts[ scripts.length - 1 ].ownerDocument;
5939
5940 // Reenable scripts
5941 jQuery.map( scripts, restoreScript );
5942
5943 // Evaluate executable scripts on first document insertion
5944 for ( i = 0; i < hasScripts; i++ ) {
5945 node = scripts[ i ];
5946 if ( rscriptType.test( node.type || "" ) &&
5947 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5948
5949 if ( node.src ) {
5950 // Optional AJAX dependency, but won't run scripts if not present
5951 if ( jQuery._evalUrl ) {
5952 jQuery._evalUrl( node.src );
5953 }
5954 } else {
5955 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5956 }
5957 }
5958 }
5959 }
5960
5961 // Fix #11809: Avoid leaking memory
5962 fragment = first = null;
5963 }
5964 }
5965
5966 return this;
5967 }
5968 });
5969
5970 jQuery.each({
5971 appendTo: "append",
5972 prependTo: "prepend",
5973 insertBefore: "before",
5974 insertAfter: "after",
5975 replaceAll: "replaceWith"
5976 }, function( name, original ) {
5977 jQuery.fn[ name ] = function( selector ) {
5978 var elems,
5979 i = 0,
5980 ret = [],
5981 insert = jQuery( selector ),
5982 last = insert.length - 1;
5983
5984 for ( ; i <= last; i++ ) {
5985 elems = i === last ? this : this.clone(true);
5986 jQuery( insert[i] )[ original ]( elems );
5987
5988 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
5989 push.apply( ret, elems.get() );
5990 }
5991
5992 return this.pushStack( ret );
5993 };
5994 });
5995
5996
5997 var iframe,
5998 elemdisplay = {};
5999
6000 /**
6001 * Retrieve the actual display of a element
6002 * @param {String} name nodeName of the element
6003 * @param {Object} doc Document object
6004 */
6005 // Called only from within defaultDisplay
6006 function actualDisplay( name, doc ) {
6007 var style,
6008 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6009
6010 // getDefaultComputedStyle might be reliably used only on attached element
6011 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
6012
6013 // Use of this method is a temporary fix (more like optmization) until something better comes along,
6014 // since it was removed from specification and supported only in FF
6015 style.display : jQuery.css( elem[ 0 ], "display" );
6016
6017 // We don't have any data stored on the element,
6018 // so use "detach" method as fast way to get rid of the element
6019 elem.detach();
6020
6021 return display;
6022 }
6023
6024 /**
6025 * Try to determine the default display value of an element
6026 * @param {String} nodeName
6027 */
6028 function defaultDisplay( nodeName ) {
6029 var doc = document,
6030 display = elemdisplay[ nodeName ];
6031
6032 if ( !display ) {
6033 display = actualDisplay( nodeName, doc );
6034
6035 // If the simple way fails, read from inside an iframe
6036 if ( display === "none" || !display ) {
6037
6038 // Use the already-created iframe if possible
6039 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6040
6041 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6042 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6043
6044 // Support: IE
6045 doc.write();
6046 doc.close();
6047
6048 display = actualDisplay( nodeName, doc );
6049 iframe.detach();
6050 }
6051
6052 // Store the correct default display
6053 elemdisplay[ nodeName ] = display;
6054 }
6055
6056 return display;
6057 }
6058
6059
6060 (function() {
6061 var shrinkWrapBlocksVal;
6062
6063 support.shrinkWrapBlocks = function() {
6064 if ( shrinkWrapBlocksVal != null ) {
6065 return shrinkWrapBlocksVal;
6066 }
6067
6068 // Will be changed later if needed.
6069 shrinkWrapBlocksVal = false;
6070
6071 // Minified: var b,c,d
6072 var div, body, container;
6073
6074 body = document.getElementsByTagName( "body" )[ 0 ];
6075 if ( !body || !body.style ) {
6076 // Test fired too early or in an unsupported environment, exit.
6077 return;
6078 }
6079
6080 // Setup
6081 div = document.createElement( "div" );
6082 container = document.createElement( "div" );
6083 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6084 body.appendChild( container ).appendChild( div );
6085
6086 // Support: IE6
6087 // Check if elements with layout shrink-wrap their children
6088 if ( typeof div.style.zoom !== strundefined ) {
6089 // Reset CSS: box-sizing; display; margin; border
6090 div.style.cssText =
6091 // Support: Firefox<29, Android 2.3
6092 // Vendor-prefix box-sizing
6093 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6094 "box-sizing:content-box;display:block;margin:0;border:0;" +
6095 "padding:1px;width:1px;zoom:1";
6096 div.appendChild( document.createElement( "div" ) ).style.width = "5px";
6097 shrinkWrapBlocksVal = div.offsetWidth !== 3;
6098 }
6099
6100 body.removeChild( container );
6101
6102 return shrinkWrapBlocksVal;
6103 };
6104
6105 })();
6106 var rmargin = (/^margin/);
6107
6108 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6109
6110
6111
6112 var getStyles, curCSS,
6113 rposition = /^(top|right|bottom|left)$/;
6114
6115 if ( window.getComputedStyle ) {
6116 getStyles = function( elem ) {
6117 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
6118 };
6119
6120 curCSS = function( elem, name, computed ) {
6121 var width, minWidth, maxWidth, ret,
6122 style = elem.style;
6123
6124 computed = computed || getStyles( elem );
6125
6126 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6127 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6128
6129 if ( computed ) {
6130
6131 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6132 ret = jQuery.style( elem, name );
6133 }
6134
6135 // A tribute to the "awesome hack by Dean Edwards"
6136 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6137 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6138 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6139 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6140
6141 // Remember the original values
6142 width = style.width;
6143 minWidth = style.minWidth;
6144 maxWidth = style.maxWidth;
6145
6146 // Put in the new values to get a computed value out
6147 style.minWidth = style.maxWidth = style.width = ret;
6148 ret = computed.width;
6149
6150 // Revert the changed values
6151 style.width = width;
6152 style.minWidth = minWidth;
6153 style.maxWidth = maxWidth;
6154 }
6155 }
6156
6157 // Support: IE
6158 // IE returns zIndex value as an integer.
6159 return ret === undefined ?
6160 ret :
6161 ret + "";
6162 };
6163 } else if ( document.documentElement.currentStyle ) {
6164 getStyles = function( elem ) {
6165 return elem.currentStyle;
6166 };
6167
6168 curCSS = function( elem, name, computed ) {
6169 var left, rs, rsLeft, ret,
6170 style = elem.style;
6171
6172 computed = computed || getStyles( elem );
6173 ret = computed ? computed[ name ] : undefined;
6174
6175 // Avoid setting ret to empty string here
6176 // so we don't default to auto
6177 if ( ret == null && style && style[ name ] ) {
6178 ret = style[ name ];
6179 }
6180
6181 // From the awesome hack by Dean Edwards
6182 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6183
6184 // If we're not dealing with a regular pixel number
6185 // but a number that has a weird ending, we need to convert it to pixels
6186 // but not position css attributes, as those are proportional to the parent element instead
6187 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6188 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6189
6190 // Remember the original values
6191 left = style.left;
6192 rs = elem.runtimeStyle;
6193 rsLeft = rs && rs.left;
6194
6195 // Put in the new values to get a computed value out
6196 if ( rsLeft ) {
6197 rs.left = elem.currentStyle.left;
6198 }
6199 style.left = name === "fontSize" ? "1em" : ret;
6200 ret = style.pixelLeft + "px";
6201
6202 // Revert the changed values
6203 style.left = left;
6204 if ( rsLeft ) {
6205 rs.left = rsLeft;
6206 }
6207 }
6208
6209 // Support: IE
6210 // IE returns zIndex value as an integer.
6211 return ret === undefined ?
6212 ret :
6213 ret + "" || "auto";
6214 };
6215 }
6216
6217
6218
6219
6220 function addGetHookIf( conditionFn, hookFn ) {
6221 // Define the hook, we'll check on the first run if it's really needed.
6222 return {
6223 get: function() {
6224 var condition = conditionFn();
6225
6226 if ( condition == null ) {
6227 // The test was not ready at this point; screw the hook this time
6228 // but check again when needed next time.
6229 return;
6230 }
6231
6232 if ( condition ) {
6233 // Hook not needed (or it's not possible to use it due to missing dependency),
6234 // remove it.
6235 // Since there are no other hooks for marginRight, remove the whole object.
6236 delete this.get;
6237 return;
6238 }
6239
6240 // Hook needed; redefine it so that the support test is not executed again.
6241
6242 return (this.get = hookFn).apply( this, arguments );
6243 }
6244 };
6245 }
6246
6247
6248 (function() {
6249 // Minified: var b,c,d,e,f,g, h,i
6250 var div, style, a, pixelPositionVal, boxSizingReliableVal,
6251 reliableHiddenOffsetsVal, reliableMarginRightVal;
6252
6253 // Setup
6254 div = document.createElement( "div" );
6255 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6256 a = div.getElementsByTagName( "a" )[ 0 ];
6257 style = a && a.style;
6258
6259 // Finish early in limited (non-browser) environments
6260 if ( !style ) {
6261 return;
6262 }
6263
6264 style.cssText = "float:left;opacity:.5";
6265
6266 // Support: IE<9
6267 // Make sure that element opacity exists (as opposed to filter)
6268 support.opacity = style.opacity === "0.5";
6269
6270 // Verify style float existence
6271 // (IE uses styleFloat instead of cssFloat)
6272 support.cssFloat = !!style.cssFloat;
6273
6274 div.style.backgroundClip = "content-box";
6275 div.cloneNode( true ).style.backgroundClip = "";
6276 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6277
6278 // Support: Firefox<29, Android 2.3
6279 // Vendor-prefix box-sizing
6280 support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
6281 style.WebkitBoxSizing === "";
6282
6283 jQuery.extend(support, {
6284 reliableHiddenOffsets: function() {
6285 if ( reliableHiddenOffsetsVal == null ) {
6286 computeStyleTests();
6287 }
6288 return reliableHiddenOffsetsVal;
6289 },
6290
6291 boxSizingReliable: function() {
6292 if ( boxSizingReliableVal == null ) {
6293 computeStyleTests();
6294 }
6295 return boxSizingReliableVal;
6296 },
6297
6298 pixelPosition: function() {
6299 if ( pixelPositionVal == null ) {
6300 computeStyleTests();
6301 }
6302 return pixelPositionVal;
6303 },
6304
6305 // Support: Android 2.3
6306 reliableMarginRight: function() {
6307 if ( reliableMarginRightVal == null ) {
6308 computeStyleTests();
6309 }
6310 return reliableMarginRightVal;
6311 }
6312 });
6313
6314 function computeStyleTests() {
6315 // Minified: var b,c,d,j
6316 var div, body, container, contents;
6317
6318 body = document.getElementsByTagName( "body" )[ 0 ];
6319 if ( !body || !body.style ) {
6320 // Test fired too early or in an unsupported environment, exit.
6321 return;
6322 }
6323
6324 // Setup
6325 div = document.createElement( "div" );
6326 container = document.createElement( "div" );
6327 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6328 body.appendChild( container ).appendChild( div );
6329
6330 div.style.cssText =
6331 // Support: Firefox<29, Android 2.3
6332 // Vendor-prefix box-sizing
6333 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
6334 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
6335 "border:1px;padding:1px;width:4px;position:absolute";
6336
6337 // Support: IE<9
6338 // Assume reasonable values in the absence of getComputedStyle
6339 pixelPositionVal = boxSizingReliableVal = false;
6340 reliableMarginRightVal = true;
6341
6342 // Check for getComputedStyle so that this code is not run in IE<9.
6343 if ( window.getComputedStyle ) {
6344 pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
6345 boxSizingReliableVal =
6346 ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
6347
6348 // Support: Android 2.3
6349 // Div with explicit width and no margin-right incorrectly
6350 // gets computed margin-right based on width of container (#3333)
6351 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6352 contents = div.appendChild( document.createElement( "div" ) );
6353
6354 // Reset CSS: box-sizing; display; margin; border; padding
6355 contents.style.cssText = div.style.cssText =
6356 // Support: Firefox<29, Android 2.3
6357 // Vendor-prefix box-sizing
6358 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6359 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
6360 contents.style.marginRight = contents.style.width = "0";
6361 div.style.width = "1px";
6362
6363 reliableMarginRightVal =
6364 !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
6365 }
6366
6367 // Support: IE8
6368 // Check if table cells still have offsetWidth/Height when they are set
6369 // to display:none and there are still other visible table cells in a
6370 // table row; if so, offsetWidth/Height are not reliable for use when
6371 // determining if an element has been hidden directly using
6372 // display:none (it is still safe to use offsets if a parent element is
6373 // hidden; don safety goggles and see bug #4512 for more information).
6374 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6375 contents = div.getElementsByTagName( "td" );
6376 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
6377 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6378 if ( reliableHiddenOffsetsVal ) {
6379 contents[ 0 ].style.display = "";
6380 contents[ 1 ].style.display = "none";
6381 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6382 }
6383
6384 body.removeChild( container );
6385 }
6386
6387 })();
6388
6389
6390 // A method for quickly swapping in/out CSS properties to get correct calculations.
6391 jQuery.swap = function( elem, options, callback, args ) {
6392 var ret, name,
6393 old = {};
6394
6395 // Remember the old values, and insert the new ones
6396 for ( name in options ) {
6397 old[ name ] = elem.style[ name ];
6398 elem.style[ name ] = options[ name ];
6399 }
6400
6401 ret = callback.apply( elem, args || [] );
6402
6403 // Revert the old values
6404 for ( name in options ) {
6405 elem.style[ name ] = old[ name ];
6406 }
6407
6408 return ret;
6409 };
6410
6411
6412 var
6413 ralpha = /alpha\([^)]*\)/i,
6414 ropacity = /opacity\s*=\s*([^)]*)/,
6415
6416 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6417 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6418 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6419 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6420 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
6421
6422 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6423 cssNormalTransform = {
6424 letterSpacing: "0",
6425 fontWeight: "400"
6426 },
6427
6428 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6429
6430
6431 // return a css property mapped to a potentially vendor prefixed property
6432 function vendorPropName( style, name ) {
6433
6434 // shortcut for names that are not vendor prefixed
6435 if ( name in style ) {
6436 return name;
6437 }
6438
6439 // check for vendor prefixed names
6440 var capName = name.charAt(0).toUpperCase() + name.slice(1),
6441 origName = name,
6442 i = cssPrefixes.length;
6443
6444 while ( i-- ) {
6445 name = cssPrefixes[ i ] + capName;
6446 if ( name in style ) {
6447 return name;
6448 }
6449 }
6450
6451 return origName;
6452 }
6453
6454 function showHide( elements, show ) {
6455 var display, elem, hidden,
6456 values = [],
6457 index = 0,
6458 length = elements.length;
6459
6460 for ( ; index < length; index++ ) {
6461 elem = elements[ index ];
6462 if ( !elem.style ) {
6463 continue;
6464 }
6465
6466 values[ index ] = jQuery._data( elem, "olddisplay" );
6467 display = elem.style.display;
6468 if ( show ) {
6469 // Reset the inline display of this element to learn if it is
6470 // being hidden by cascaded rules or not
6471 if ( !values[ index ] && display === "none" ) {
6472 elem.style.display = "";
6473 }
6474
6475 // Set elements which have been overridden with display: none
6476 // in a stylesheet to whatever the default browser style is
6477 // for such an element
6478 if ( elem.style.display === "" && isHidden( elem ) ) {
6479 values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
6480 }
6481 } else {
6482 hidden = isHidden( elem );
6483
6484 if ( display && display !== "none" || !hidden ) {
6485 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6486 }
6487 }
6488 }
6489
6490 // Set the display of most of the elements in a second loop
6491 // to avoid the constant reflow
6492 for ( index = 0; index < length; index++ ) {
6493 elem = elements[ index ];
6494 if ( !elem.style ) {
6495 continue;
6496 }
6497 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6498 elem.style.display = show ? values[ index ] || "" : "none";
6499 }
6500 }
6501
6502 return elements;
6503 }
6504
6505 function setPositiveNumber( elem, value, subtract ) {
6506 var matches = rnumsplit.exec( value );
6507 return matches ?
6508 // Guard against undefined "subtract", e.g., when used as in cssHooks
6509 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6510 value;
6511 }
6512
6513 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6514 var i = extra === ( isBorderBox ? "border" : "content" ) ?
6515 // If we already have the right measurement, avoid augmentation
6516 4 :
6517 // Otherwise initialize for horizontal or vertical properties
6518 name === "width" ? 1 : 0,
6519
6520 val = 0;
6521
6522 for ( ; i < 4; i += 2 ) {
6523 // both box models exclude margin, so add it if we want it
6524 if ( extra === "margin" ) {
6525 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6526 }
6527
6528 if ( isBorderBox ) {
6529 // border-box includes padding, so remove it if we want content
6530 if ( extra === "content" ) {
6531 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6532 }
6533
6534 // at this point, extra isn't border nor margin, so remove border
6535 if ( extra !== "margin" ) {
6536 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6537 }
6538 } else {
6539 // at this point, extra isn't content, so add padding
6540 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6541
6542 // at this point, extra isn't content nor padding, so add border
6543 if ( extra !== "padding" ) {
6544 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6545 }
6546 }
6547 }
6548
6549 return val;
6550 }
6551
6552 function getWidthOrHeight( elem, name, extra ) {
6553
6554 // Start with offset property, which is equivalent to the border-box value
6555 var valueIsBorderBox = true,
6556 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6557 styles = getStyles( elem ),
6558 isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6559
6560 // some non-html elements return undefined for offsetWidth, so check for null/undefined
6561 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6562 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6563 if ( val <= 0 || val == null ) {
6564 // Fall back to computed then uncomputed css if necessary
6565 val = curCSS( elem, name, styles );
6566 if ( val < 0 || val == null ) {
6567 val = elem.style[ name ];
6568 }
6569
6570 // Computed unit is not pixels. Stop here and return.
6571 if ( rnumnonpx.test(val) ) {
6572 return val;
6573 }
6574
6575 // we need the check for style in case a browser which returns unreliable values
6576 // for getComputedStyle silently falls back to the reliable elem.style
6577 valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
6578
6579 // Normalize "", auto, and prepare for extra
6580 val = parseFloat( val ) || 0;
6581 }
6582
6583 // use the active box-sizing model to add/subtract irrelevant styles
6584 return ( val +
6585 augmentWidthOrHeight(
6586 elem,
6587 name,
6588 extra || ( isBorderBox ? "border" : "content" ),
6589 valueIsBorderBox,
6590 styles
6591 )
6592 ) + "px";
6593 }
6594
6595 jQuery.extend({
6596 // Add in style property hooks for overriding the default
6597 // behavior of getting and setting a style property
6598 cssHooks: {
6599 opacity: {
6600 get: function( elem, computed ) {
6601 if ( computed ) {
6602 // We should always get a number back from opacity
6603 var ret = curCSS( elem, "opacity" );
6604 return ret === "" ? "1" : ret;
6605 }
6606 }
6607 }
6608 },
6609
6610 // Don't automatically add "px" to these possibly-unitless properties
6611 cssNumber: {
6612 "columnCount": true,
6613 "fillOpacity": true,
6614 "flexGrow": true,
6615 "flexShrink": true,
6616 "fontWeight": true,
6617 "lineHeight": true,
6618 "opacity": true,
6619 "order": true,
6620 "orphans": true,
6621 "widows": true,
6622 "zIndex": true,
6623 "zoom": true
6624 },
6625
6626 // Add in properties whose names you wish to fix before
6627 // setting or getting the value
6628 cssProps: {
6629 // normalize float css property
6630 "float": support.cssFloat ? "cssFloat" : "styleFloat"
6631 },
6632
6633 // Get and set the style property on a DOM Node
6634 style: function( elem, name, value, extra ) {
6635 // Don't set styles on text and comment nodes
6636 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6637 return;
6638 }
6639
6640 // Make sure that we're working with the right name
6641 var ret, type, hooks,
6642 origName = jQuery.camelCase( name ),
6643 style = elem.style;
6644
6645 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6646
6647 // gets hook for the prefixed version
6648 // followed by the unprefixed version
6649 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6650
6651 // Check if we're setting a value
6652 if ( value !== undefined ) {
6653 type = typeof value;
6654
6655 // convert relative number strings (+= or -=) to relative numbers. #7345
6656 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6657 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6658 // Fixes bug #9237
6659 type = "number";
6660 }
6661
6662 // Make sure that null and NaN values aren't set. See: #7116
6663 if ( value == null || value !== value ) {
6664 return;
6665 }
6666
6667 // If a number was passed in, add 'px' to the (except for certain CSS properties)
6668 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6669 value += "px";
6670 }
6671
6672 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6673 // but it would mean to define eight (for every problematic property) identical functions
6674 if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6675 style[ name ] = "inherit";
6676 }
6677
6678 // If a hook was provided, use that value, otherwise just set the specified value
6679 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6680
6681 // Support: IE
6682 // Swallow errors from 'invalid' CSS values (#5509)
6683 try {
6684 style[ name ] = value;
6685 } catch(e) {}
6686 }
6687
6688 } else {
6689 // If a hook was provided get the non-computed value from there
6690 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6691 return ret;
6692 }
6693
6694 // Otherwise just get the value from the style object
6695 return style[ name ];
6696 }
6697 },
6698
6699 css: function( elem, name, extra, styles ) {
6700 var num, val, hooks,
6701 origName = jQuery.camelCase( name );
6702
6703 // Make sure that we're working with the right name
6704 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6705
6706 // gets hook for the prefixed version
6707 // followed by the unprefixed version
6708 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6709
6710 // If a hook was provided get the computed value from there
6711 if ( hooks && "get" in hooks ) {
6712 val = hooks.get( elem, true, extra );
6713 }
6714
6715 // Otherwise, if a way to get the computed value exists, use that
6716 if ( val === undefined ) {
6717 val = curCSS( elem, name, styles );
6718 }
6719
6720 //convert "normal" to computed value
6721 if ( val === "normal" && name in cssNormalTransform ) {
6722 val = cssNormalTransform[ name ];
6723 }
6724
6725 // Return, converting to number if forced or a qualifier was provided and val looks numeric
6726 if ( extra === "" || extra ) {
6727 num = parseFloat( val );
6728 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6729 }
6730 return val;
6731 }
6732 });
6733
6734 jQuery.each([ "height", "width" ], function( i, name ) {
6735 jQuery.cssHooks[ name ] = {
6736 get: function( elem, computed, extra ) {
6737 if ( computed ) {
6738 // certain elements can have dimension info if we invisibly show them
6739 // however, it must have a current display style that would benefit from this
6740 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
6741 jQuery.swap( elem, cssShow, function() {
6742 return getWidthOrHeight( elem, name, extra );
6743 }) :
6744 getWidthOrHeight( elem, name, extra );
6745 }
6746 },
6747
6748 set: function( elem, value, extra ) {
6749 var styles = extra && getStyles( elem );
6750 return setPositiveNumber( elem, value, extra ?
6751 augmentWidthOrHeight(
6752 elem,
6753 name,
6754 extra,
6755 support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6756 styles
6757 ) : 0
6758 );
6759 }
6760 };
6761 });
6762
6763 if ( !support.opacity ) {
6764 jQuery.cssHooks.opacity = {
6765 get: function( elem, computed ) {
6766 // IE uses filters for opacity
6767 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6768 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6769 computed ? "1" : "";
6770 },
6771
6772 set: function( elem, value ) {
6773 var style = elem.style,
6774 currentStyle = elem.currentStyle,
6775 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6776 filter = currentStyle && currentStyle.filter || style.filter || "";
6777
6778 // IE has trouble with opacity if it does not have layout
6779 // Force it by setting the zoom level
6780 style.zoom = 1;
6781
6782 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6783 // if value === "", then remove inline opacity #12685
6784 if ( ( value >= 1 || value === "" ) &&
6785 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6786 style.removeAttribute ) {
6787
6788 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6789 // if "filter:" is present at all, clearType is disabled, we want to avoid this
6790 // style.removeAttribute is IE Only, but so apparently is this code path...
6791 style.removeAttribute( "filter" );
6792
6793 // if there is no filter style applied in a css rule or unset inline opacity, we are done
6794 if ( value === "" || currentStyle && !currentStyle.filter ) {
6795 return;
6796 }
6797 }
6798
6799 // otherwise, set new filter values
6800 style.filter = ralpha.test( filter ) ?
6801 filter.replace( ralpha, opacity ) :
6802 filter + " " + opacity;
6803 }
6804 };
6805 }
6806
6807 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6808 function( elem, computed ) {
6809 if ( computed ) {
6810 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6811 // Work around by temporarily setting element display to inline-block
6812 return jQuery.swap( elem, { "display": "inline-block" },
6813 curCSS, [ elem, "marginRight" ] );
6814 }
6815 }
6816 );
6817
6818 // These hooks are used by animate to expand properties
6819 jQuery.each({
6820 margin: "",
6821 padding: "",
6822 border: "Width"
6823 }, function( prefix, suffix ) {
6824 jQuery.cssHooks[ prefix + suffix ] = {
6825 expand: function( value ) {
6826 var i = 0,
6827 expanded = {},
6828
6829 // assumes a single number if not a string
6830 parts = typeof value === "string" ? value.split(" ") : [ value ];
6831
6832 for ( ; i < 4; i++ ) {
6833 expanded[ prefix + cssExpand[ i ] + suffix ] =
6834 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6835 }
6836
6837 return expanded;
6838 }
6839 };
6840
6841 if ( !rmargin.test( prefix ) ) {
6842 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6843 }
6844 });
6845
6846 jQuery.fn.extend({
6847 css: function( name, value ) {
6848 return access( this, function( elem, name, value ) {
6849 var styles, len,
6850 map = {},
6851 i = 0;
6852
6853 if ( jQuery.isArray( name ) ) {
6854 styles = getStyles( elem );
6855 len = name.length;
6856
6857 for ( ; i < len; i++ ) {
6858 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6859 }
6860
6861 return map;
6862 }
6863
6864 return value !== undefined ?
6865 jQuery.style( elem, name, value ) :
6866 jQuery.css( elem, name );
6867 }, name, value, arguments.length > 1 );
6868 },
6869 show: function() {
6870 return showHide( this, true );
6871 },
6872 hide: function() {
6873 return showHide( this );
6874 },
6875 toggle: function( state ) {
6876 if ( typeof state === "boolean" ) {
6877 return state ? this.show() : this.hide();
6878 }
6879
6880 return this.each(function() {
6881 if ( isHidden( this ) ) {
6882 jQuery( this ).show();
6883 } else {
6884 jQuery( this ).hide();
6885 }
6886 });
6887 }
6888 });
6889
6890
6891 function Tween( elem, options, prop, end, easing ) {
6892 return new Tween.prototype.init( elem, options, prop, end, easing );
6893 }
6894 jQuery.Tween = Tween;
6895
6896 Tween.prototype = {
6897 constructor: Tween,
6898 init: function( elem, options, prop, end, easing, unit ) {
6899 this.elem = elem;
6900 this.prop = prop;
6901 this.easing = easing || "swing";
6902 this.options = options;
6903 this.start = this.now = this.cur();
6904 this.end = end;
6905 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6906 },
6907 cur: function() {
6908 var hooks = Tween.propHooks[ this.prop ];
6909
6910 return hooks && hooks.get ?
6911 hooks.get( this ) :
6912 Tween.propHooks._default.get( this );
6913 },
6914 run: function( percent ) {
6915 var eased,
6916 hooks = Tween.propHooks[ this.prop ];
6917
6918 if ( this.options.duration ) {
6919 this.pos = eased = jQuery.easing[ this.easing ](
6920 percent, this.options.duration * percent, 0, 1, this.options.duration
6921 );
6922 } else {
6923 this.pos = eased = percent;
6924 }
6925 this.now = ( this.end - this.start ) * eased + this.start;
6926
6927 if ( this.options.step ) {
6928 this.options.step.call( this.elem, this.now, this );
6929 }
6930
6931 if ( hooks && hooks.set ) {
6932 hooks.set( this );
6933 } else {
6934 Tween.propHooks._default.set( this );
6935 }
6936 return this;
6937 }
6938 };
6939
6940 Tween.prototype.init.prototype = Tween.prototype;
6941
6942 Tween.propHooks = {
6943 _default: {
6944 get: function( tween ) {
6945 var result;
6946
6947 if ( tween.elem[ tween.prop ] != null &&
6948 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6949 return tween.elem[ tween.prop ];
6950 }
6951
6952 // passing an empty string as a 3rd parameter to .css will automatically
6953 // attempt a parseFloat and fallback to a string if the parse fails
6954 // so, simple values such as "10px" are parsed to Float.
6955 // complex values such as "rotate(1rad)" are returned as is.
6956 result = jQuery.css( tween.elem, tween.prop, "" );
6957 // Empty strings, null, undefined and "auto" are converted to 0.
6958 return !result || result === "auto" ? 0 : result;
6959 },
6960 set: function( tween ) {
6961 // use step hook for back compat - use cssHook if its there - use .style if its
6962 // available and use plain properties where available
6963 if ( jQuery.fx.step[ tween.prop ] ) {
6964 jQuery.fx.step[ tween.prop ]( tween );
6965 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
6966 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6967 } else {
6968 tween.elem[ tween.prop ] = tween.now;
6969 }
6970 }
6971 }
6972 };
6973
6974 // Support: IE <=9
6975 // Panic based approach to setting things on disconnected nodes
6976
6977 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6978 set: function( tween ) {
6979 if ( tween.elem.nodeType && tween.elem.parentNode ) {
6980 tween.elem[ tween.prop ] = tween.now;
6981 }
6982 }
6983 };
6984
6985 jQuery.easing = {
6986 linear: function( p ) {
6987 return p;
6988 },
6989 swing: function( p ) {
6990 return 0.5 - Math.cos( p * Math.PI ) / 2;
6991 }
6992 };
6993
6994 jQuery.fx = Tween.prototype.init;
6995
6996 // Back Compat <1.8 extension point
6997 jQuery.fx.step = {};
6998
6999
7000
7001
7002 var
7003 fxNow, timerId,
7004 rfxtypes = /^(?:toggle|show|hide)$/,
7005 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
7006 rrun = /queueHooks$/,
7007 animationPrefilters = [ defaultPrefilter ],
7008 tweeners = {
7009 "*": [ function( prop, value ) {
7010 var tween = this.createTween( prop, value ),
7011 target = tween.cur(),
7012 parts = rfxnum.exec( value ),
7013 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
7014
7015 // Starting value computation is required for potential unit mismatches
7016 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
7017 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
7018 scale = 1,
7019 maxIterations = 20;
7020
7021 if ( start && start[ 3 ] !== unit ) {
7022 // Trust units reported by jQuery.css
7023 unit = unit || start[ 3 ];
7024
7025 // Make sure we update the tween properties later on
7026 parts = parts || [];
7027
7028 // Iteratively approximate from a nonzero starting point
7029 start = +target || 1;
7030
7031 do {
7032 // If previous iteration zeroed out, double until we get *something*
7033 // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7034 scale = scale || ".5";
7035
7036 // Adjust and apply
7037 start = start / scale;
7038 jQuery.style( tween.elem, prop, start + unit );
7039
7040 // Update scale, tolerating zero or NaN from tween.cur()
7041 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7042 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7043 }
7044
7045 // Update tween properties
7046 if ( parts ) {
7047 start = tween.start = +start || +target || 0;
7048 tween.unit = unit;
7049 // If a +=/-= token was provided, we're doing a relative animation
7050 tween.end = parts[ 1 ] ?
7051 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
7052 +parts[ 2 ];
7053 }
7054
7055 return tween;
7056 } ]
7057 };
7058
7059 // Animations created synchronously will run synchronously
7060 function createFxNow() {
7061 setTimeout(function() {
7062 fxNow = undefined;
7063 });
7064 return ( fxNow = jQuery.now() );
7065 }
7066
7067 // Generate parameters to create a standard animation
7068 function genFx( type, includeWidth ) {
7069 var which,
7070 attrs = { height: type },
7071 i = 0;
7072
7073 // if we include width, step value is 1 to do all cssExpand values,
7074 // if we don't include width, step value is 2 to skip over Left and Right
7075 includeWidth = includeWidth ? 1 : 0;
7076 for ( ; i < 4 ; i += 2 - includeWidth ) {
7077 which = cssExpand[ i ];
7078 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7079 }
7080
7081 if ( includeWidth ) {
7082 attrs.opacity = attrs.width = type;
7083 }
7084
7085 return attrs;
7086 }
7087
7088 function createTween( value, prop, animation ) {
7089 var tween,
7090 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7091 index = 0,
7092 length = collection.length;
7093 for ( ; index < length; index++ ) {
7094 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
7095
7096 // we're done with this property
7097 return tween;
7098 }
7099 }
7100 }
7101
7102 function defaultPrefilter( elem, props, opts ) {
7103 /* jshint validthis: true */
7104 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7105 anim = this,
7106 orig = {},
7107 style = elem.style,
7108 hidden = elem.nodeType && isHidden( elem ),
7109 dataShow = jQuery._data( elem, "fxshow" );
7110
7111 // handle queue: false promises
7112 if ( !opts.queue ) {
7113 hooks = jQuery._queueHooks( elem, "fx" );
7114 if ( hooks.unqueued == null ) {
7115 hooks.unqueued = 0;
7116 oldfire = hooks.empty.fire;
7117 hooks.empty.fire = function() {
7118 if ( !hooks.unqueued ) {
7119 oldfire();
7120 }
7121 };
7122 }
7123 hooks.unqueued++;
7124
7125 anim.always(function() {
7126 // doing this makes sure that the complete handler will be called
7127 // before this completes
7128 anim.always(function() {
7129 hooks.unqueued--;
7130 if ( !jQuery.queue( elem, "fx" ).length ) {
7131 hooks.empty.fire();
7132 }
7133 });
7134 });
7135 }
7136
7137 // height/width overflow pass
7138 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7139 // Make sure that nothing sneaks out
7140 // Record all 3 overflow attributes because IE does not
7141 // change the overflow attribute when overflowX and
7142 // overflowY are set to the same value
7143 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7144
7145 // Set display property to inline-block for height/width
7146 // animations on inline elements that are having width/height animated
7147 display = jQuery.css( elem, "display" );
7148
7149 // Test default display if display is currently "none"
7150 checkDisplay = display === "none" ?
7151 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7152
7153 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7154
7155 // inline-level elements accept inline-block;
7156 // block-level elements need to be inline with layout
7157 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7158 style.display = "inline-block";
7159 } else {
7160 style.zoom = 1;
7161 }
7162 }
7163 }
7164
7165 if ( opts.overflow ) {
7166 style.overflow = "hidden";
7167 if ( !support.shrinkWrapBlocks() ) {
7168 anim.always(function() {
7169 style.overflow = opts.overflow[ 0 ];
7170 style.overflowX = opts.overflow[ 1 ];
7171 style.overflowY = opts.overflow[ 2 ];
7172 });
7173 }
7174 }
7175
7176 // show/hide pass
7177 for ( prop in props ) {
7178 value = props[ prop ];
7179 if ( rfxtypes.exec( value ) ) {
7180 delete props[ prop ];
7181 toggle = toggle || value === "toggle";
7182 if ( value === ( hidden ? "hide" : "show" ) ) {
7183
7184 // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
7185 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7186 hidden = true;
7187 } else {
7188 continue;
7189 }
7190 }
7191 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7192
7193 // Any non-fx value stops us from restoring the original display value
7194 } else {
7195 display = undefined;
7196 }
7197 }
7198
7199 if ( !jQuery.isEmptyObject( orig ) ) {
7200 if ( dataShow ) {
7201 if ( "hidden" in dataShow ) {
7202 hidden = dataShow.hidden;
7203 }
7204 } else {
7205 dataShow = jQuery._data( elem, "fxshow", {} );
7206 }
7207
7208 // store state if its toggle - enables .stop().toggle() to "reverse"
7209 if ( toggle ) {
7210 dataShow.hidden = !hidden;
7211 }
7212 if ( hidden ) {
7213 jQuery( elem ).show();
7214 } else {
7215 anim.done(function() {
7216 jQuery( elem ).hide();
7217 });
7218 }
7219 anim.done(function() {
7220 var prop;
7221 jQuery._removeData( elem, "fxshow" );
7222 for ( prop in orig ) {
7223 jQuery.style( elem, prop, orig[ prop ] );
7224 }
7225 });
7226 for ( prop in orig ) {
7227 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7228
7229 if ( !( prop in dataShow ) ) {
7230 dataShow[ prop ] = tween.start;
7231 if ( hidden ) {
7232 tween.end = tween.start;
7233 tween.start = prop === "width" || prop === "height" ? 1 : 0;
7234 }
7235 }
7236 }
7237
7238 // If this is a noop like .hide().hide(), restore an overwritten display value
7239 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
7240 style.display = display;
7241 }
7242 }
7243
7244 function propFilter( props, specialEasing ) {
7245 var index, name, easing, value, hooks;
7246
7247 // camelCase, specialEasing and expand cssHook pass
7248 for ( index in props ) {
7249 name = jQuery.camelCase( index );
7250 easing = specialEasing[ name ];
7251 value = props[ index ];
7252 if ( jQuery.isArray( value ) ) {
7253 easing = value[ 1 ];
7254 value = props[ index ] = value[ 0 ];
7255 }
7256
7257 if ( index !== name ) {
7258 props[ name ] = value;
7259 delete props[ index ];
7260 }
7261
7262 hooks = jQuery.cssHooks[ name ];
7263 if ( hooks && "expand" in hooks ) {
7264 value = hooks.expand( value );
7265 delete props[ name ];
7266
7267 // not quite $.extend, this wont overwrite keys already present.
7268 // also - reusing 'index' from above because we have the correct "name"
7269 for ( index in value ) {
7270 if ( !( index in props ) ) {
7271 props[ index ] = value[ index ];
7272 specialEasing[ index ] = easing;
7273 }
7274 }
7275 } else {
7276 specialEasing[ name ] = easing;
7277 }
7278 }
7279 }
7280
7281 function Animation( elem, properties, options ) {
7282 var result,
7283 stopped,
7284 index = 0,
7285 length = animationPrefilters.length,
7286 deferred = jQuery.Deferred().always( function() {
7287 // don't match elem in the :animated selector
7288 delete tick.elem;
7289 }),
7290 tick = function() {
7291 if ( stopped ) {
7292 return false;
7293 }
7294 var currentTime = fxNow || createFxNow(),
7295 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7296 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7297 temp = remaining / animation.duration || 0,
7298 percent = 1 - temp,
7299 index = 0,
7300 length = animation.tweens.length;
7301
7302 for ( ; index < length ; index++ ) {
7303 animation.tweens[ index ].run( percent );
7304 }
7305
7306 deferred.notifyWith( elem, [ animation, percent, remaining ]);
7307
7308 if ( percent < 1 && length ) {
7309 return remaining;
7310 } else {
7311 deferred.resolveWith( elem, [ animation ] );
7312 return false;
7313 }
7314 },
7315 animation = deferred.promise({
7316 elem: elem,
7317 props: jQuery.extend( {}, properties ),
7318 opts: jQuery.extend( true, { specialEasing: {} }, options ),
7319 originalProperties: properties,
7320 originalOptions: options,
7321 startTime: fxNow || createFxNow(),
7322 duration: options.duration,
7323 tweens: [],
7324 createTween: function( prop, end ) {
7325 var tween = jQuery.Tween( elem, animation.opts, prop, end,
7326 animation.opts.specialEasing[ prop ] || animation.opts.easing );
7327 animation.tweens.push( tween );
7328 return tween;
7329 },
7330 stop: function( gotoEnd ) {
7331 var index = 0,
7332 // if we are going to the end, we want to run all the tweens
7333 // otherwise we skip this part
7334 length = gotoEnd ? animation.tweens.length : 0;
7335 if ( stopped ) {
7336 return this;
7337 }
7338 stopped = true;
7339 for ( ; index < length ; index++ ) {
7340 animation.tweens[ index ].run( 1 );
7341 }
7342
7343 // resolve when we played the last frame
7344 // otherwise, reject
7345 if ( gotoEnd ) {
7346 deferred.resolveWith( elem, [ animation, gotoEnd ] );
7347 } else {
7348 deferred.rejectWith( elem, [ animation, gotoEnd ] );
7349 }
7350 return this;
7351 }
7352 }),
7353 props = animation.props;
7354
7355 propFilter( props, animation.opts.specialEasing );
7356
7357 for ( ; index < length ; index++ ) {
7358 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7359 if ( result ) {
7360 return result;
7361 }
7362 }
7363
7364 jQuery.map( props, createTween, animation );
7365
7366 if ( jQuery.isFunction( animation.opts.start ) ) {
7367 animation.opts.start.call( elem, animation );
7368 }
7369
7370 jQuery.fx.timer(
7371 jQuery.extend( tick, {
7372 elem: elem,
7373 anim: animation,
7374 queue: animation.opts.queue
7375 })
7376 );
7377
7378 // attach callbacks from options
7379 return animation.progress( animation.opts.progress )
7380 .done( animation.opts.done, animation.opts.complete )
7381 .fail( animation.opts.fail )
7382 .always( animation.opts.always );
7383 }
7384
7385 jQuery.Animation = jQuery.extend( Animation, {
7386 tweener: function( props, callback ) {
7387 if ( jQuery.isFunction( props ) ) {
7388 callback = props;
7389 props = [ "*" ];
7390 } else {
7391 props = props.split(" ");
7392 }
7393
7394 var prop,
7395 index = 0,
7396 length = props.length;
7397
7398 for ( ; index < length ; index++ ) {
7399 prop = props[ index ];
7400 tweeners[ prop ] = tweeners[ prop ] || [];
7401 tweeners[ prop ].unshift( callback );
7402 }
7403 },
7404
7405 prefilter: function( callback, prepend ) {
7406 if ( prepend ) {
7407 animationPrefilters.unshift( callback );
7408 } else {
7409 animationPrefilters.push( callback );
7410 }
7411 }
7412 });
7413
7414 jQuery.speed = function( speed, easing, fn ) {
7415 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7416 complete: fn || !fn && easing ||
7417 jQuery.isFunction( speed ) && speed,
7418 duration: speed,
7419 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7420 };
7421
7422 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7423 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7424
7425 // normalize opt.queue - true/undefined/null -> "fx"
7426 if ( opt.queue == null || opt.queue === true ) {
7427 opt.queue = "fx";
7428 }
7429
7430 // Queueing
7431 opt.old = opt.complete;
7432
7433 opt.complete = function() {
7434 if ( jQuery.isFunction( opt.old ) ) {
7435 opt.old.call( this );
7436 }
7437
7438 if ( opt.queue ) {
7439 jQuery.dequeue( this, opt.queue );
7440 }
7441 };
7442
7443 return opt;
7444 };
7445
7446 jQuery.fn.extend({
7447 fadeTo: function( speed, to, easing, callback ) {
7448
7449 // show any hidden elements after setting opacity to 0
7450 return this.filter( isHidden ).css( "opacity", 0 ).show()
7451
7452 // animate to the value specified
7453 .end().animate({ opacity: to }, speed, easing, callback );
7454 },
7455 animate: function( prop, speed, easing, callback ) {
7456 var empty = jQuery.isEmptyObject( prop ),
7457 optall = jQuery.speed( speed, easing, callback ),
7458 doAnimation = function() {
7459 // Operate on a copy of prop so per-property easing won't be lost
7460 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7461
7462 // Empty animations, or finishing resolves immediately
7463 if ( empty || jQuery._data( this, "finish" ) ) {
7464 anim.stop( true );
7465 }
7466 };
7467 doAnimation.finish = doAnimation;
7468
7469 return empty || optall.queue === false ?
7470 this.each( doAnimation ) :
7471 this.queue( optall.queue, doAnimation );
7472 },
7473 stop: function( type, clearQueue, gotoEnd ) {
7474 var stopQueue = function( hooks ) {
7475 var stop = hooks.stop;
7476 delete hooks.stop;
7477 stop( gotoEnd );
7478 };
7479
7480 if ( typeof type !== "string" ) {
7481 gotoEnd = clearQueue;
7482 clearQueue = type;
7483 type = undefined;
7484 }
7485 if ( clearQueue && type !== false ) {
7486 this.queue( type || "fx", [] );
7487 }
7488
7489 return this.each(function() {
7490 var dequeue = true,
7491 index = type != null && type + "queueHooks",
7492 timers = jQuery.timers,
7493 data = jQuery._data( this );
7494
7495 if ( index ) {
7496 if ( data[ index ] && data[ index ].stop ) {
7497 stopQueue( data[ index ] );
7498 }
7499 } else {
7500 for ( index in data ) {
7501 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7502 stopQueue( data[ index ] );
7503 }
7504 }
7505 }
7506
7507 for ( index = timers.length; index--; ) {
7508 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7509 timers[ index ].anim.stop( gotoEnd );
7510 dequeue = false;
7511 timers.splice( index, 1 );
7512 }
7513 }
7514
7515 // start the next in the queue if the last step wasn't forced
7516 // timers currently will call their complete callbacks, which will dequeue
7517 // but only if they were gotoEnd
7518 if ( dequeue || !gotoEnd ) {
7519 jQuery.dequeue( this, type );
7520 }
7521 });
7522 },
7523 finish: function( type ) {
7524 if ( type !== false ) {
7525 type = type || "fx";
7526 }
7527 return this.each(function() {
7528 var index,
7529 data = jQuery._data( this ),
7530 queue = data[ type + "queue" ],
7531 hooks = data[ type + "queueHooks" ],
7532 timers = jQuery.timers,
7533 length = queue ? queue.length : 0;
7534
7535 // enable finishing flag on private data
7536 data.finish = true;
7537
7538 // empty the queue first
7539 jQuery.queue( this, type, [] );
7540
7541 if ( hooks && hooks.stop ) {
7542 hooks.stop.call( this, true );
7543 }
7544
7545 // look for any active animations, and finish them
7546 for ( index = timers.length; index--; ) {
7547 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7548 timers[ index ].anim.stop( true );
7549 timers.splice( index, 1 );
7550 }
7551 }
7552
7553 // look for any animations in the old queue and finish them
7554 for ( index = 0; index < length; index++ ) {
7555 if ( queue[ index ] && queue[ index ].finish ) {
7556 queue[ index ].finish.call( this );
7557 }
7558 }
7559
7560 // turn off finishing flag
7561 delete data.finish;
7562 });
7563 }
7564 });
7565
7566 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7567 var cssFn = jQuery.fn[ name ];
7568 jQuery.fn[ name ] = function( speed, easing, callback ) {
7569 return speed == null || typeof speed === "boolean" ?
7570 cssFn.apply( this, arguments ) :
7571 this.animate( genFx( name, true ), speed, easing, callback );
7572 };
7573 });
7574
7575 // Generate shortcuts for custom animations
7576 jQuery.each({
7577 slideDown: genFx("show"),
7578 slideUp: genFx("hide"),
7579 slideToggle: genFx("toggle"),
7580 fadeIn: { opacity: "show" },
7581 fadeOut: { opacity: "hide" },
7582 fadeToggle: { opacity: "toggle" }
7583 }, function( name, props ) {
7584 jQuery.fn[ name ] = function( speed, easing, callback ) {
7585 return this.animate( props, speed, easing, callback );
7586 };
7587 });
7588
7589 jQuery.timers = [];
7590 jQuery.fx.tick = function() {
7591 var timer,
7592 timers = jQuery.timers,
7593 i = 0;
7594
7595 fxNow = jQuery.now();
7596
7597 for ( ; i < timers.length; i++ ) {
7598 timer = timers[ i ];
7599 // Checks the timer has not already been removed
7600 if ( !timer() && timers[ i ] === timer ) {
7601 timers.splice( i--, 1 );
7602 }
7603 }
7604
7605 if ( !timers.length ) {
7606 jQuery.fx.stop();
7607 }
7608 fxNow = undefined;
7609 };
7610
7611 jQuery.fx.timer = function( timer ) {
7612 jQuery.timers.push( timer );
7613 if ( timer() ) {
7614 jQuery.fx.start();
7615 } else {
7616 jQuery.timers.pop();
7617 }
7618 };
7619
7620 jQuery.fx.interval = 13;
7621
7622 jQuery.fx.start = function() {
7623 if ( !timerId ) {
7624 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7625 }
7626 };
7627
7628 jQuery.fx.stop = function() {
7629 clearInterval( timerId );
7630 timerId = null;
7631 };
7632
7633 jQuery.fx.speeds = {
7634 slow: 600,
7635 fast: 200,
7636 // Default speed
7637 _default: 400
7638 };
7639
7640
7641 // Based off of the plugin by Clint Helfers, with permission.
7642 // http://blindsignals.com/index.php/2009/07/jquery-delay/
7643 jQuery.fn.delay = function( time, type ) {
7644 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7645 type = type || "fx";
7646
7647 return this.queue( type, function( next, hooks ) {
7648 var timeout = setTimeout( next, time );
7649 hooks.stop = function() {
7650 clearTimeout( timeout );
7651 };
7652 });
7653 };
7654
7655
7656 (function() {
7657 // Minified: var a,b,c,d,e
7658 var input, div, select, a, opt;
7659
7660 // Setup
7661 div = document.createElement( "div" );
7662 div.setAttribute( "className", "t" );
7663 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
7664 a = div.getElementsByTagName("a")[ 0 ];
7665
7666 // First batch of tests.
7667 select = document.createElement("select");
7668 opt = select.appendChild( document.createElement("option") );
7669 input = div.getElementsByTagName("input")[ 0 ];
7670
7671 a.style.cssText = "top:1px";
7672
7673 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
7674 support.getSetAttribute = div.className !== "t";
7675
7676 // Get the style information from getAttribute
7677 // (IE uses .cssText instead)
7678 support.style = /top/.test( a.getAttribute("style") );
7679
7680 // Make sure that URLs aren't manipulated
7681 // (IE normalizes it by default)
7682 support.hrefNormalized = a.getAttribute("href") === "/a";
7683
7684 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
7685 support.checkOn = !!input.value;
7686
7687 // Make sure that a selected-by-default option has a working selected property.
7688 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
7689 support.optSelected = opt.selected;
7690
7691 // Tests for enctype support on a form (#6743)
7692 support.enctype = !!document.createElement("form").enctype;
7693
7694 // Make sure that the options inside disabled selects aren't marked as disabled
7695 // (WebKit marks them as disabled)
7696 select.disabled = true;
7697 support.optDisabled = !opt.disabled;
7698
7699 // Support: IE8 only
7700 // Check if we can trust getAttribute("value")
7701 input = document.createElement( "input" );
7702 input.setAttribute( "value", "" );
7703 support.input = input.getAttribute( "value" ) === "";
7704
7705 // Check if an input maintains its value after becoming a radio
7706 input.value = "t";
7707 input.setAttribute( "type", "radio" );
7708 support.radioValue = input.value === "t";
7709 })();
7710
7711
7712 var rreturn = /\r/g;
7713
7714 jQuery.fn.extend({
7715 val: function( value ) {
7716 var hooks, ret, isFunction,
7717 elem = this[0];
7718
7719 if ( !arguments.length ) {
7720 if ( elem ) {
7721 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7722
7723 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7724 return ret;
7725 }
7726
7727 ret = elem.value;
7728
7729 return typeof ret === "string" ?
7730 // handle most common string cases
7731 ret.replace(rreturn, "") :
7732 // handle cases where value is null/undef or number
7733 ret == null ? "" : ret;
7734 }
7735
7736 return;
7737 }
7738
7739 isFunction = jQuery.isFunction( value );
7740
7741 return this.each(function( i ) {
7742 var val;
7743
7744 if ( this.nodeType !== 1 ) {
7745 return;
7746 }
7747
7748 if ( isFunction ) {
7749 val = value.call( this, i, jQuery( this ).val() );
7750 } else {
7751 val = value;
7752 }
7753
7754 // Treat null/undefined as ""; convert numbers to string
7755 if ( val == null ) {
7756 val = "";
7757 } else if ( typeof val === "number" ) {
7758 val += "";
7759 } else if ( jQuery.isArray( val ) ) {
7760 val = jQuery.map( val, function( value ) {
7761 return value == null ? "" : value + "";
7762 });
7763 }
7764
7765 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7766
7767 // If set returns undefined, fall back to normal setting
7768 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7769 this.value = val;
7770 }
7771 });
7772 }
7773 });
7774
7775 jQuery.extend({
7776 valHooks: {
7777 option: {
7778 get: function( elem ) {
7779 var val = jQuery.find.attr( elem, "value" );
7780 return val != null ?
7781 val :
7782 // Support: IE10-11+
7783 // option.text throws exceptions (#14686, #14858)
7784 jQuery.trim( jQuery.text( elem ) );
7785 }
7786 },
7787 select: {
7788 get: function( elem ) {
7789 var value, option,
7790 options = elem.options,
7791 index = elem.selectedIndex,
7792 one = elem.type === "select-one" || index < 0,
7793 values = one ? null : [],
7794 max = one ? index + 1 : options.length,
7795 i = index < 0 ?
7796 max :
7797 one ? index : 0;
7798
7799 // Loop through all the selected options
7800 for ( ; i < max; i++ ) {
7801 option = options[ i ];
7802
7803 // oldIE doesn't update selected after form reset (#2551)
7804 if ( ( option.selected || i === index ) &&
7805 // Don't return options that are disabled or in a disabled optgroup
7806 ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
7807 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7808
7809 // Get the specific value for the option
7810 value = jQuery( option ).val();
7811
7812 // We don't need an array for one selects
7813 if ( one ) {
7814 return value;
7815 }
7816
7817 // Multi-Selects return an array
7818 values.push( value );
7819 }
7820 }
7821
7822 return values;
7823 },
7824
7825 set: function( elem, value ) {
7826 var optionSet, option,
7827 options = elem.options,
7828 values = jQuery.makeArray( value ),
7829 i = options.length;
7830
7831 while ( i-- ) {
7832 option = options[ i ];
7833
7834 if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
7835
7836 // Support: IE6
7837 // When new option element is added to select box we need to
7838 // force reflow of newly added node in order to workaround delay
7839 // of initialization properties
7840 try {
7841 option.selected = optionSet = true;
7842
7843 } catch ( _ ) {
7844
7845 // Will be executed only in IE6
7846 option.scrollHeight;
7847 }
7848
7849 } else {
7850 option.selected = false;
7851 }
7852 }
7853
7854 // Force browsers to behave consistently when non-matching value is set
7855 if ( !optionSet ) {
7856 elem.selectedIndex = -1;
7857 }
7858
7859 return options;
7860 }
7861 }
7862 }
7863 });
7864
7865 // Radios and checkboxes getter/setter
7866 jQuery.each([ "radio", "checkbox" ], function() {
7867 jQuery.valHooks[ this ] = {
7868 set: function( elem, value ) {
7869 if ( jQuery.isArray( value ) ) {
7870 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7871 }
7872 }
7873 };
7874 if ( !support.checkOn ) {
7875 jQuery.valHooks[ this ].get = function( elem ) {
7876 // Support: Webkit
7877 // "" is returned instead of "on" if a value isn't specified
7878 return elem.getAttribute("value") === null ? "on" : elem.value;
7879 };
7880 }
7881 });
7882
7883
7884
7885
7886 var nodeHook, boolHook,
7887 attrHandle = jQuery.expr.attrHandle,
7888 ruseDefault = /^(?:checked|selected)$/i,
7889 getSetAttribute = support.getSetAttribute,
7890 getSetInput = support.input;
7891
7892 jQuery.fn.extend({
7893 attr: function( name, value ) {
7894 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7895 },
7896
7897 removeAttr: function( name ) {
7898 return this.each(function() {
7899 jQuery.removeAttr( this, name );
7900 });
7901 }
7902 });
7903
7904 jQuery.extend({
7905 attr: function( elem, name, value ) {
7906 var hooks, ret,
7907 nType = elem.nodeType;
7908
7909 // don't get/set attributes on text, comment and attribute nodes
7910 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
7911 return;
7912 }
7913
7914 // Fallback to prop when attributes are not supported
7915 if ( typeof elem.getAttribute === strundefined ) {
7916 return jQuery.prop( elem, name, value );
7917 }
7918
7919 // All attributes are lowercase
7920 // Grab necessary hook if one is defined
7921 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7922 name = name.toLowerCase();
7923 hooks = jQuery.attrHooks[ name ] ||
7924 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
7925 }
7926
7927 if ( value !== undefined ) {
7928
7929 if ( value === null ) {
7930 jQuery.removeAttr( elem, name );
7931
7932 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
7933 return ret;
7934
7935 } else {
7936 elem.setAttribute( name, value + "" );
7937 return value;
7938 }
7939
7940 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
7941 return ret;
7942
7943 } else {
7944 ret = jQuery.find.attr( elem, name );
7945
7946 // Non-existent attributes return null, we normalize to undefined
7947 return ret == null ?
7948 undefined :
7949 ret;
7950 }
7951 },
7952
7953 removeAttr: function( elem, value ) {
7954 var name, propName,
7955 i = 0,
7956 attrNames = value && value.match( rnotwhite );
7957
7958 if ( attrNames && elem.nodeType === 1 ) {
7959 while ( (name = attrNames[i++]) ) {
7960 propName = jQuery.propFix[ name ] || name;
7961
7962 // Boolean attributes get special treatment (#10870)
7963 if ( jQuery.expr.match.bool.test( name ) ) {
7964 // Set corresponding property to false
7965 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
7966 elem[ propName ] = false;
7967 // Support: IE<9
7968 // Also clear defaultChecked/defaultSelected (if appropriate)
7969 } else {
7970 elem[ jQuery.camelCase( "default-" + name ) ] =
7971 elem[ propName ] = false;
7972 }
7973
7974 // See #9699 for explanation of this approach (setting first, then removal)
7975 } else {
7976 jQuery.attr( elem, name, "" );
7977 }
7978
7979 elem.removeAttribute( getSetAttribute ? name : propName );
7980 }
7981 }
7982 },
7983
7984 attrHooks: {
7985 type: {
7986 set: function( elem, value ) {
7987 if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
7988 // Setting the type on a radio button after the value resets the value in IE6-9
7989 // Reset value to default in case type is set after value during creation
7990 var val = elem.value;
7991 elem.setAttribute( "type", value );
7992 if ( val ) {
7993 elem.value = val;
7994 }
7995 return value;
7996 }
7997 }
7998 }
7999 }
8000 });
8001
8002 // Hook for boolean attributes
8003 boolHook = {
8004 set: function( elem, value, name ) {
8005 if ( value === false ) {
8006 // Remove boolean attributes when set to false
8007 jQuery.removeAttr( elem, name );
8008 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8009 // IE<8 needs the *property* name
8010 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
8011
8012 // Use defaultChecked and defaultSelected for oldIE
8013 } else {
8014 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
8015 }
8016
8017 return name;
8018 }
8019 };
8020
8021 // Retrieve booleans specially
8022 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8023
8024 var getter = attrHandle[ name ] || jQuery.find.attr;
8025
8026 attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
8027 function( elem, name, isXML ) {
8028 var ret, handle;
8029 if ( !isXML ) {
8030 // Avoid an infinite loop by temporarily removing this function from the getter
8031 handle = attrHandle[ name ];
8032 attrHandle[ name ] = ret;
8033 ret = getter( elem, name, isXML ) != null ?
8034 name.toLowerCase() :
8035 null;
8036 attrHandle[ name ] = handle;
8037 }
8038 return ret;
8039 } :
8040 function( elem, name, isXML ) {
8041 if ( !isXML ) {
8042 return elem[ jQuery.camelCase( "default-" + name ) ] ?
8043 name.toLowerCase() :
8044 null;
8045 }
8046 };
8047 });
8048
8049 // fix oldIE attroperties
8050 if ( !getSetInput || !getSetAttribute ) {
8051 jQuery.attrHooks.value = {
8052 set: function( elem, value, name ) {
8053 if ( jQuery.nodeName( elem, "input" ) ) {
8054 // Does not return so that setAttribute is also used
8055 elem.defaultValue = value;
8056 } else {
8057 // Use nodeHook if defined (#1954); otherwise setAttribute is fine
8058 return nodeHook && nodeHook.set( elem, value, name );
8059 }
8060 }
8061 };
8062 }
8063
8064 // IE6/7 do not support getting/setting some attributes with get/setAttribute
8065 if ( !getSetAttribute ) {
8066
8067 // Use this for any attribute in IE6/7
8068 // This fixes almost every IE6/7 issue
8069 nodeHook = {
8070 set: function( elem, value, name ) {
8071 // Set the existing or create a new attribute node
8072 var ret = elem.getAttributeNode( name );
8073 if ( !ret ) {
8074 elem.setAttributeNode(
8075 (ret = elem.ownerDocument.createAttribute( name ))
8076 );
8077 }
8078
8079 ret.value = value += "";
8080
8081 // Break association with cloned elements by also using setAttribute (#9646)
8082 if ( name === "value" || value === elem.getAttribute( name ) ) {
8083 return value;
8084 }
8085 }
8086 };
8087
8088 // Some attributes are constructed with empty-string values when not defined
8089 attrHandle.id = attrHandle.name = attrHandle.coords =
8090 function( elem, name, isXML ) {
8091 var ret;
8092 if ( !isXML ) {
8093 return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
8094 ret.value :
8095 null;
8096 }
8097 };
8098
8099 // Fixing value retrieval on a button requires this module
8100 jQuery.valHooks.button = {
8101 get: function( elem, name ) {
8102 var ret = elem.getAttributeNode( name );
8103 if ( ret && ret.specified ) {
8104 return ret.value;
8105 }
8106 },
8107 set: nodeHook.set
8108 };
8109
8110 // Set contenteditable to false on removals(#10429)
8111 // Setting to empty string throws an error as an invalid value
8112 jQuery.attrHooks.contenteditable = {
8113 set: function( elem, value, name ) {
8114 nodeHook.set( elem, value === "" ? false : value, name );
8115 }
8116 };
8117
8118 // Set width and height to auto instead of 0 on empty string( Bug #8150 )
8119 // This is for removals
8120 jQuery.each([ "width", "height" ], function( i, name ) {
8121 jQuery.attrHooks[ name ] = {
8122 set: function( elem, value ) {
8123 if ( value === "" ) {
8124 elem.setAttribute( name, "auto" );
8125 return value;
8126 }
8127 }
8128 };
8129 });
8130 }
8131
8132 if ( !support.style ) {
8133 jQuery.attrHooks.style = {
8134 get: function( elem ) {
8135 // Return undefined in the case of empty string
8136 // Note: IE uppercases css property names, but if we were to .toLowerCase()
8137 // .cssText, that would destroy case senstitivity in URL's, like in "background"
8138 return elem.style.cssText || undefined;
8139 },
8140 set: function( elem, value ) {
8141 return ( elem.style.cssText = value + "" );
8142 }
8143 };
8144 }
8145
8146
8147
8148
8149 var rfocusable = /^(?:input|select|textarea|button|object)$/i,
8150 rclickable = /^(?:a|area)$/i;
8151
8152 jQuery.fn.extend({
8153 prop: function( name, value ) {
8154 return access( this, jQuery.prop, name, value, arguments.length > 1 );
8155 },
8156
8157 removeProp: function( name ) {
8158 name = jQuery.propFix[ name ] || name;
8159 return this.each(function() {
8160 // try/catch handles cases where IE balks (such as removing a property on window)
8161 try {
8162 this[ name ] = undefined;
8163 delete this[ name ];
8164 } catch( e ) {}
8165 });
8166 }
8167 });
8168
8169 jQuery.extend({
8170 propFix: {
8171 "for": "htmlFor",
8172 "class": "className"
8173 },
8174
8175 prop: function( elem, name, value ) {
8176 var ret, hooks, notxml,
8177 nType = elem.nodeType;
8178
8179 // don't get/set properties on text, comment and attribute nodes
8180 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
8181 return;
8182 }
8183
8184 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
8185
8186 if ( notxml ) {
8187 // Fix name and attach hooks
8188 name = jQuery.propFix[ name ] || name;
8189 hooks = jQuery.propHooks[ name ];
8190 }
8191
8192 if ( value !== undefined ) {
8193 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
8194 ret :
8195 ( elem[ name ] = value );
8196
8197 } else {
8198 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
8199 ret :
8200 elem[ name ];
8201 }
8202 },
8203
8204 propHooks: {
8205 tabIndex: {
8206 get: function( elem ) {
8207 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
8208 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8209 // Use proper attribute retrieval(#12072)
8210 var tabindex = jQuery.find.attr( elem, "tabindex" );
8211
8212 return tabindex ?
8213 parseInt( tabindex, 10 ) :
8214 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
8215 0 :
8216 -1;
8217 }
8218 }
8219 }
8220 });
8221
8222 // Some attributes require a special call on IE
8223 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
8224 if ( !support.hrefNormalized ) {
8225 // href/src property should get the full normalized URL (#10299/#12915)
8226 jQuery.each([ "href", "src" ], function( i, name ) {
8227 jQuery.propHooks[ name ] = {
8228 get: function( elem ) {
8229 return elem.getAttribute( name, 4 );
8230 }
8231 };
8232 });
8233 }
8234
8235 // Support: Safari, IE9+
8236 // mis-reports the default selected property of an option
8237 // Accessing the parent's selectedIndex property fixes it
8238 if ( !support.optSelected ) {
8239 jQuery.propHooks.selected = {
8240 get: function( elem ) {
8241 var parent = elem.parentNode;
8242
8243 if ( parent ) {
8244 parent.selectedIndex;
8245
8246 // Make sure that it also works with optgroups, see #5701
8247 if ( parent.parentNode ) {
8248 parent.parentNode.selectedIndex;
8249 }
8250 }
8251 return null;
8252 }
8253 };
8254 }
8255
8256 jQuery.each([
8257 "tabIndex",
8258 "readOnly",
8259 "maxLength",
8260 "cellSpacing",
8261 "cellPadding",
8262 "rowSpan",
8263 "colSpan",
8264 "useMap",
8265 "frameBorder",
8266 "contentEditable"
8267 ], function() {
8268 jQuery.propFix[ this.toLowerCase() ] = this;
8269 });
8270
8271 // IE6/7 call enctype encoding
8272 if ( !support.enctype ) {
8273 jQuery.propFix.enctype = "encoding";
8274 }
8275
8276
8277
8278
8279 var rclass = /[\t\r\n\f]/g;
8280
8281 jQuery.fn.extend({
8282 addClass: function( value ) {
8283 var classes, elem, cur, clazz, j, finalValue,
8284 i = 0,
8285 len = this.length,
8286 proceed = typeof value === "string" && value;
8287
8288 if ( jQuery.isFunction( value ) ) {
8289 return this.each(function( j ) {
8290 jQuery( this ).addClass( value.call( this, j, this.className ) );
8291 });
8292 }
8293
8294 if ( proceed ) {
8295 // The disjunction here is for better compressibility (see removeClass)
8296 classes = ( value || "" ).match( rnotwhite ) || [];
8297
8298 for ( ; i < len; i++ ) {
8299 elem = this[ i ];
8300 cur = elem.nodeType === 1 && ( elem.className ?
8301 ( " " + elem.className + " " ).replace( rclass, " " ) :
8302 " "
8303 );
8304
8305 if ( cur ) {
8306 j = 0;
8307 while ( (clazz = classes[j++]) ) {
8308 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8309 cur += clazz + " ";
8310 }
8311 }
8312
8313 // only assign if different to avoid unneeded rendering.
8314 finalValue = jQuery.trim( cur );
8315 if ( elem.className !== finalValue ) {
8316 elem.className = finalValue;
8317 }
8318 }
8319 }
8320 }
8321
8322 return this;
8323 },
8324
8325 removeClass: function( value ) {
8326 var classes, elem, cur, clazz, j, finalValue,
8327 i = 0,
8328 len = this.length,
8329 proceed = arguments.length === 0 || typeof value === "string" && value;
8330
8331 if ( jQuery.isFunction( value ) ) {
8332 return this.each(function( j ) {
8333 jQuery( this ).removeClass( value.call( this, j, this.className ) );
8334 });
8335 }
8336 if ( proceed ) {
8337 classes = ( value || "" ).match( rnotwhite ) || [];
8338
8339 for ( ; i < len; i++ ) {
8340 elem = this[ i ];
8341 // This expression is here for better compressibility (see addClass)
8342 cur = elem.nodeType === 1 && ( elem.className ?
8343 ( " " + elem.className + " " ).replace( rclass, " " ) :
8344 ""
8345 );
8346
8347 if ( cur ) {
8348 j = 0;
8349 while ( (clazz = classes[j++]) ) {
8350 // Remove *all* instances
8351 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
8352 cur = cur.replace( " " + clazz + " ", " " );
8353 }
8354 }
8355
8356 // only assign if different to avoid unneeded rendering.
8357 finalValue = value ? jQuery.trim( cur ) : "";
8358 if ( elem.className !== finalValue ) {
8359 elem.className = finalValue;
8360 }
8361 }
8362 }
8363 }
8364
8365 return this;
8366 },
8367
8368 toggleClass: function( value, stateVal ) {
8369 var type = typeof value;
8370
8371 if ( typeof stateVal === "boolean" && type === "string" ) {
8372 return stateVal ? this.addClass( value ) : this.removeClass( value );
8373 }
8374
8375 if ( jQuery.isFunction( value ) ) {
8376 return this.each(function( i ) {
8377 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
8378 });
8379 }
8380
8381 return this.each(function() {
8382 if ( type === "string" ) {
8383 // toggle individual class names
8384 var className,
8385 i = 0,
8386 self = jQuery( this ),
8387 classNames = value.match( rnotwhite ) || [];
8388
8389 while ( (className = classNames[ i++ ]) ) {
8390 // check each className given, space separated list
8391 if ( self.hasClass( className ) ) {
8392 self.removeClass( className );
8393 } else {
8394 self.addClass( className );
8395 }
8396 }
8397
8398 // Toggle whole class name
8399 } else if ( type === strundefined || type === "boolean" ) {
8400 if ( this.className ) {
8401 // store className if set
8402 jQuery._data( this, "__className__", this.className );
8403 }
8404
8405 // If the element has a class name or if we're passed "false",
8406 // then remove the whole classname (if there was one, the above saved it).
8407 // Otherwise bring back whatever was previously saved (if anything),
8408 // falling back to the empty string if nothing was stored.
8409 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
8410 }
8411 });
8412 },
8413
8414 hasClass: function( selector ) {
8415 var className = " " + selector + " ",
8416 i = 0,
8417 l = this.length;
8418 for ( ; i < l; i++ ) {
8419 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
8420 return true;
8421 }
8422 }
8423
8424 return false;
8425 }
8426 });
8427
8428
8429
8430
8431 // Return jQuery for attributes-only inclusion
8432
8433
8434 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
8435 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8436 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
8437
8438 // Handle event binding
8439 jQuery.fn[ name ] = function( data, fn ) {
8440 return arguments.length > 0 ?
8441 this.on( name, null, data, fn ) :
8442 this.trigger( name );
8443 };
8444 });
8445
8446 jQuery.fn.extend({
8447 hover: function( fnOver, fnOut ) {
8448 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8449 },
8450
8451 bind: function( types, data, fn ) {
8452 return this.on( types, null, data, fn );
8453 },
8454 unbind: function( types, fn ) {
8455 return this.off( types, null, fn );
8456 },
8457
8458 delegate: function( selector, types, data, fn ) {
8459 return this.on( types, selector, data, fn );
8460 },
8461 undelegate: function( selector, types, fn ) {
8462 // ( namespace ) or ( selector, types [, fn] )
8463 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
8464 }
8465 });
8466
8467
8468 var nonce = jQuery.now();
8469
8470 var rquery = (/\?/);
8471
8472
8473
8474 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
8475
8476 jQuery.parseJSON = function( data ) {
8477 // Attempt to parse using the native JSON parser first
8478 if ( window.JSON && window.JSON.parse ) {
8479 // Support: Android 2.3
8480 // Workaround failure to string-cast null input
8481 return window.JSON.parse( data + "" );
8482 }
8483
8484 var requireNonComma,
8485 depth = null,
8486 str = jQuery.trim( data + "" );
8487
8488 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
8489 // after removing valid tokens
8490 return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
8491
8492 // Force termination if we see a misplaced comma
8493 if ( requireNonComma && comma ) {
8494 depth = 0;
8495 }
8496
8497 // Perform no more replacements after returning to outermost depth
8498 if ( depth === 0 ) {
8499 return token;
8500 }
8501
8502 // Commas must not follow "[", "{", or ","
8503 requireNonComma = open || comma;
8504
8505 // Determine new depth
8506 // array/object open ("[" or "{"): depth += true - false (increment)
8507 // array/object close ("]" or "}"): depth += false - true (decrement)
8508 // other cases ("," or primitive): depth += true - true (numeric cast)
8509 depth += !close - !open;
8510
8511 // Remove this token
8512 return "";
8513 }) ) ?
8514 ( Function( "return " + str ) )() :
8515 jQuery.error( "Invalid JSON: " + data );
8516 };
8517
8518
8519 // Cross-browser xml parsing
8520 jQuery.parseXML = function( data ) {
8521 var xml, tmp;
8522 if ( !data || typeof data !== "string" ) {
8523 return null;
8524 }
8525 try {
8526 if ( window.DOMParser ) { // Standard
8527 tmp = new DOMParser();
8528 xml = tmp.parseFromString( data, "text/xml" );
8529 } else { // IE
8530 xml = new ActiveXObject( "Microsoft.XMLDOM" );
8531 xml.async = "false";
8532 xml.loadXML( data );
8533 }
8534 } catch( e ) {
8535 xml = undefined;
8536 }
8537 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
8538 jQuery.error( "Invalid XML: " + data );
8539 }
8540 return xml;
8541 };
8542
8543
8544 var
8545 // Document location
8546 ajaxLocParts,
8547 ajaxLocation,
8548
8549 rhash = /#.*$/,
8550 rts = /([?&])_=[^&]*/,
8551 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
8552 // #7653, #8125, #8152: local protocol detection
8553 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8554 rnoContent = /^(?:GET|HEAD)$/,
8555 rprotocol = /^\/\//,
8556 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
8557
8558 /* Prefilters
8559 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8560 * 2) These are called:
8561 * - BEFORE asking for a transport
8562 * - AFTER param serialization (s.data is a string if s.processData is true)
8563 * 3) key is the dataType
8564 * 4) the catchall symbol "*" can be used
8565 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8566 */
8567 prefilters = {},
8568
8569 /* Transports bindings
8570 * 1) key is the dataType
8571 * 2) the catchall symbol "*" can be used
8572 * 3) selection will start with transport dataType and THEN go to "*" if needed
8573 */
8574 transports = {},
8575
8576 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8577 allTypes = "*/".concat("*");
8578
8579 // #8138, IE may throw an exception when accessing
8580 // a field from window.location if document.domain has been set
8581 try {
8582 ajaxLocation = location.href;
8583 } catch( e ) {
8584 // Use the href attribute of an A element
8585 // since IE will modify it given document.location
8586 ajaxLocation = document.createElement( "a" );
8587 ajaxLocation.href = "";
8588 ajaxLocation = ajaxLocation.href;
8589 }
8590
8591 // Segment location into parts
8592 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
8593
8594 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8595 function addToPrefiltersOrTransports( structure ) {
8596
8597 // dataTypeExpression is optional and defaults to "*"
8598 return function( dataTypeExpression, func ) {
8599
8600 if ( typeof dataTypeExpression !== "string" ) {
8601 func = dataTypeExpression;
8602 dataTypeExpression = "*";
8603 }
8604
8605 var dataType,
8606 i = 0,
8607 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8608
8609 if ( jQuery.isFunction( func ) ) {
8610 // For each dataType in the dataTypeExpression
8611 while ( (dataType = dataTypes[i++]) ) {
8612 // Prepend if requested
8613 if ( dataType.charAt( 0 ) === "+" ) {
8614 dataType = dataType.slice( 1 ) || "*";
8615 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
8616
8617 // Otherwise append
8618 } else {
8619 (structure[ dataType ] = structure[ dataType ] || []).push( func );
8620 }
8621 }
8622 }
8623 };
8624 }
8625
8626 // Base inspection function for prefilters and transports
8627 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8628
8629 var inspected = {},
8630 seekingTransport = ( structure === transports );
8631
8632 function inspect( dataType ) {
8633 var selected;
8634 inspected[ dataType ] = true;
8635 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8636 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8637 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8638 options.dataTypes.unshift( dataTypeOrTransport );
8639 inspect( dataTypeOrTransport );
8640 return false;
8641 } else if ( seekingTransport ) {
8642 return !( selected = dataTypeOrTransport );
8643 }
8644 });
8645 return selected;
8646 }
8647
8648 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8649 }
8650
8651 // A special extend for ajax options
8652 // that takes "flat" options (not to be deep extended)
8653 // Fixes #9887
8654 function ajaxExtend( target, src ) {
8655 var deep, key,
8656 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8657
8658 for ( key in src ) {
8659 if ( src[ key ] !== undefined ) {
8660 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
8661 }
8662 }
8663 if ( deep ) {
8664 jQuery.extend( true, target, deep );
8665 }
8666
8667 return target;
8668 }
8669
8670 /* Handles responses to an ajax request:
8671 * - finds the right dataType (mediates between content-type and expected dataType)
8672 * - returns the corresponding response
8673 */
8674 function ajaxHandleResponses( s, jqXHR, responses ) {
8675 var firstDataType, ct, finalDataType, type,
8676 contents = s.contents,
8677 dataTypes = s.dataTypes;
8678
8679 // Remove auto dataType and get content-type in the process
8680 while ( dataTypes[ 0 ] === "*" ) {
8681 dataTypes.shift();
8682 if ( ct === undefined ) {
8683 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8684 }
8685 }
8686
8687 // Check if we're dealing with a known content-type
8688 if ( ct ) {
8689 for ( type in contents ) {
8690 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8691 dataTypes.unshift( type );
8692 break;
8693 }
8694 }
8695 }
8696
8697 // Check to see if we have a response for the expected dataType
8698 if ( dataTypes[ 0 ] in responses ) {
8699 finalDataType = dataTypes[ 0 ];
8700 } else {
8701 // Try convertible dataTypes
8702 for ( type in responses ) {
8703 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8704 finalDataType = type;
8705 break;
8706 }
8707 if ( !firstDataType ) {
8708 firstDataType = type;
8709 }
8710 }
8711 // Or just use first one
8712 finalDataType = finalDataType || firstDataType;
8713 }
8714
8715 // If we found a dataType
8716 // We add the dataType to the list if needed
8717 // and return the corresponding response
8718 if ( finalDataType ) {
8719 if ( finalDataType !== dataTypes[ 0 ] ) {
8720 dataTypes.unshift( finalDataType );
8721 }
8722 return responses[ finalDataType ];
8723 }
8724 }
8725
8726 /* Chain conversions given the request and the original response
8727 * Also sets the responseXXX fields on the jqXHR instance
8728 */
8729 function ajaxConvert( s, response, jqXHR, isSuccess ) {
8730 var conv2, current, conv, tmp, prev,
8731 converters = {},
8732 // Work with a copy of dataTypes in case we need to modify it for conversion
8733 dataTypes = s.dataTypes.slice();
8734
8735 // Create converters map with lowercased keys
8736 if ( dataTypes[ 1 ] ) {
8737 for ( conv in s.converters ) {
8738 converters[ conv.toLowerCase() ] = s.converters[ conv ];
8739 }
8740 }
8741
8742 current = dataTypes.shift();
8743
8744 // Convert to each sequential dataType
8745 while ( current ) {
8746
8747 if ( s.responseFields[ current ] ) {
8748 jqXHR[ s.responseFields[ current ] ] = response;
8749 }
8750
8751 // Apply the dataFilter if provided
8752 if ( !prev && isSuccess && s.dataFilter ) {
8753 response = s.dataFilter( response, s.dataType );
8754 }
8755
8756 prev = current;
8757 current = dataTypes.shift();
8758
8759 if ( current ) {
8760
8761 // There's only work to do if current dataType is non-auto
8762 if ( current === "*" ) {
8763
8764 current = prev;
8765
8766 // Convert response if prev dataType is non-auto and differs from current
8767 } else if ( prev !== "*" && prev !== current ) {
8768
8769 // Seek a direct converter
8770 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8771
8772 // If none found, seek a pair
8773 if ( !conv ) {
8774 for ( conv2 in converters ) {
8775
8776 // If conv2 outputs current
8777 tmp = conv2.split( " " );
8778 if ( tmp[ 1 ] === current ) {
8779
8780 // If prev can be converted to accepted input
8781 conv = converters[ prev + " " + tmp[ 0 ] ] ||
8782 converters[ "* " + tmp[ 0 ] ];
8783 if ( conv ) {
8784 // Condense equivalence converters
8785 if ( conv === true ) {
8786 conv = converters[ conv2 ];
8787
8788 // Otherwise, insert the intermediate dataType
8789 } else if ( converters[ conv2 ] !== true ) {
8790 current = tmp[ 0 ];
8791 dataTypes.unshift( tmp[ 1 ] );
8792 }
8793 break;
8794 }
8795 }
8796 }
8797 }
8798
8799 // Apply converter (if not an equivalence)
8800 if ( conv !== true ) {
8801
8802 // Unless errors are allowed to bubble, catch and return them
8803 if ( conv && s[ "throws" ] ) {
8804 response = conv( response );
8805 } else {
8806 try {
8807 response = conv( response );
8808 } catch ( e ) {
8809 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8810 }
8811 }
8812 }
8813 }
8814 }
8815 }
8816
8817 return { state: "success", data: response };
8818 }
8819
8820 jQuery.extend({
8821
8822 // Counter for holding the number of active queries
8823 active: 0,
8824
8825 // Last-Modified header cache for next request
8826 lastModified: {},
8827 etag: {},
8828
8829 ajaxSettings: {
8830 url: ajaxLocation,
8831 type: "GET",
8832 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
8833 global: true,
8834 processData: true,
8835 async: true,
8836 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8837 /*
8838 timeout: 0,
8839 data: null,
8840 dataType: null,
8841 username: null,
8842 password: null,
8843 cache: null,
8844 throws: false,
8845 traditional: false,
8846 headers: {},
8847 */
8848
8849 accepts: {
8850 "*": allTypes,
8851 text: "text/plain",
8852 html: "text/html",
8853 xml: "application/xml, text/xml",
8854 json: "application/json, text/javascript"
8855 },
8856
8857 contents: {
8858 xml: /xml/,
8859 html: /html/,
8860 json: /json/
8861 },
8862
8863 responseFields: {
8864 xml: "responseXML",
8865 text: "responseText",
8866 json: "responseJSON"
8867 },
8868
8869 // Data converters
8870 // Keys separate source (or catchall "*") and destination types with a single space
8871 converters: {
8872
8873 // Convert anything to text
8874 "* text": String,
8875
8876 // Text to html (true = no transformation)
8877 "text html": true,
8878
8879 // Evaluate text as a json expression
8880 "text json": jQuery.parseJSON,
8881
8882 // Parse text as xml
8883 "text xml": jQuery.parseXML
8884 },
8885
8886 // For options that shouldn't be deep extended:
8887 // you can add your own custom options here if
8888 // and when you create one that shouldn't be
8889 // deep extended (see ajaxExtend)
8890 flatOptions: {
8891 url: true,
8892 context: true
8893 }
8894 },
8895
8896 // Creates a full fledged settings object into target
8897 // with both ajaxSettings and settings fields.
8898 // If target is omitted, writes into ajaxSettings.
8899 ajaxSetup: function( target, settings ) {
8900 return settings ?
8901
8902 // Building a settings object
8903 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8904
8905 // Extending ajaxSettings
8906 ajaxExtend( jQuery.ajaxSettings, target );
8907 },
8908
8909 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8910 ajaxTransport: addToPrefiltersOrTransports( transports ),
8911
8912 // Main method
8913 ajax: function( url, options ) {
8914
8915 // If url is an object, simulate pre-1.5 signature
8916 if ( typeof url === "object" ) {
8917 options = url;
8918 url = undefined;
8919 }
8920
8921 // Force options to be an object
8922 options = options || {};
8923
8924 var // Cross-domain detection vars
8925 parts,
8926 // Loop variable
8927 i,
8928 // URL without anti-cache param
8929 cacheURL,
8930 // Response headers as string
8931 responseHeadersString,
8932 // timeout handle
8933 timeoutTimer,
8934
8935 // To know if global events are to be dispatched
8936 fireGlobals,
8937
8938 transport,
8939 // Response headers
8940 responseHeaders,
8941 // Create the final options object
8942 s = jQuery.ajaxSetup( {}, options ),
8943 // Callbacks context
8944 callbackContext = s.context || s,
8945 // Context for global events is callbackContext if it is a DOM node or jQuery collection
8946 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
8947 jQuery( callbackContext ) :
8948 jQuery.event,
8949 // Deferreds
8950 deferred = jQuery.Deferred(),
8951 completeDeferred = jQuery.Callbacks("once memory"),
8952 // Status-dependent callbacks
8953 statusCode = s.statusCode || {},
8954 // Headers (they are sent all at once)
8955 requestHeaders = {},
8956 requestHeadersNames = {},
8957 // The jqXHR state
8958 state = 0,
8959 // Default abort message
8960 strAbort = "canceled",
8961 // Fake xhr
8962 jqXHR = {
8963 readyState: 0,
8964
8965 // Builds headers hashtable if needed
8966 getResponseHeader: function( key ) {
8967 var match;
8968 if ( state === 2 ) {
8969 if ( !responseHeaders ) {
8970 responseHeaders = {};
8971 while ( (match = rheaders.exec( responseHeadersString )) ) {
8972 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
8973 }
8974 }
8975 match = responseHeaders[ key.toLowerCase() ];
8976 }
8977 return match == null ? null : match;
8978 },
8979
8980 // Raw string
8981 getAllResponseHeaders: function() {
8982 return state === 2 ? responseHeadersString : null;
8983 },
8984
8985 // Caches the header
8986 setRequestHeader: function( name, value ) {
8987 var lname = name.toLowerCase();
8988 if ( !state ) {
8989 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
8990 requestHeaders[ name ] = value;
8991 }
8992 return this;
8993 },
8994
8995 // Overrides response content-type header
8996 overrideMimeType: function( type ) {
8997 if ( !state ) {
8998 s.mimeType = type;
8999 }
9000 return this;
9001 },
9002
9003 // Status-dependent callbacks
9004 statusCode: function( map ) {
9005 var code;
9006 if ( map ) {
9007 if ( state < 2 ) {
9008 for ( code in map ) {
9009 // Lazy-add the new callback in a way that preserves old ones
9010 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9011 }
9012 } else {
9013 // Execute the appropriate callbacks
9014 jqXHR.always( map[ jqXHR.status ] );
9015 }
9016 }
9017 return this;
9018 },
9019
9020 // Cancel the request
9021 abort: function( statusText ) {
9022 var finalText = statusText || strAbort;
9023 if ( transport ) {
9024 transport.abort( finalText );
9025 }
9026 done( 0, finalText );
9027 return this;
9028 }
9029 };
9030
9031 // Attach deferreds
9032 deferred.promise( jqXHR ).complete = completeDeferred.add;
9033 jqXHR.success = jqXHR.done;
9034 jqXHR.error = jqXHR.fail;
9035
9036 // Remove hash character (#7531: and string promotion)
9037 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
9038 // Handle falsy url in the settings object (#10093: consistency with old signature)
9039 // We also use the url parameter if available
9040 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
9041
9042 // Alias method option to type as per ticket #12004
9043 s.type = options.method || options.type || s.method || s.type;
9044
9045 // Extract dataTypes list
9046 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
9047
9048 // A cross-domain request is in order when we have a protocol:host:port mismatch
9049 if ( s.crossDomain == null ) {
9050 parts = rurl.exec( s.url.toLowerCase() );
9051 s.crossDomain = !!( parts &&
9052 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
9053 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
9054 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
9055 );
9056 }
9057
9058 // Convert data if not already a string
9059 if ( s.data && s.processData && typeof s.data !== "string" ) {
9060 s.data = jQuery.param( s.data, s.traditional );
9061 }
9062
9063 // Apply prefilters
9064 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9065
9066 // If request was aborted inside a prefilter, stop there
9067 if ( state === 2 ) {
9068 return jqXHR;
9069 }
9070
9071 // We can fire global events as of now if asked to
9072 fireGlobals = s.global;
9073
9074 // Watch for a new set of requests
9075 if ( fireGlobals && jQuery.active++ === 0 ) {
9076 jQuery.event.trigger("ajaxStart");
9077 }
9078
9079 // Uppercase the type
9080 s.type = s.type.toUpperCase();
9081
9082 // Determine if request has content
9083 s.hasContent = !rnoContent.test( s.type );
9084
9085 // Save the URL in case we're toying with the If-Modified-Since
9086 // and/or If-None-Match header later on
9087 cacheURL = s.url;
9088
9089 // More options handling for requests with no content
9090 if ( !s.hasContent ) {
9091
9092 // If data is available, append data to url
9093 if ( s.data ) {
9094 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
9095 // #9682: remove data so that it's not used in an eventual retry
9096 delete s.data;
9097 }
9098
9099 // Add anti-cache in url if needed
9100 if ( s.cache === false ) {
9101 s.url = rts.test( cacheURL ) ?
9102
9103 // If there is already a '_' parameter, set its value
9104 cacheURL.replace( rts, "$1_=" + nonce++ ) :
9105
9106 // Otherwise add one to the end
9107 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
9108 }
9109 }
9110
9111 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9112 if ( s.ifModified ) {
9113 if ( jQuery.lastModified[ cacheURL ] ) {
9114 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9115 }
9116 if ( jQuery.etag[ cacheURL ] ) {
9117 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9118 }
9119 }
9120
9121 // Set the correct header, if data is being sent
9122 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9123 jqXHR.setRequestHeader( "Content-Type", s.contentType );
9124 }
9125
9126 // Set the Accepts header for the server, depending on the dataType
9127 jqXHR.setRequestHeader(
9128 "Accept",
9129 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
9130 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9131 s.accepts[ "*" ]
9132 );
9133
9134 // Check for headers option
9135 for ( i in s.headers ) {
9136 jqXHR.setRequestHeader( i, s.headers[ i ] );
9137 }
9138
9139 // Allow custom headers/mimetypes and early abort
9140 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
9141 // Abort if not done already and return
9142 return jqXHR.abort();
9143 }
9144
9145 // aborting is no longer a cancellation
9146 strAbort = "abort";
9147
9148 // Install callbacks on deferreds
9149 for ( i in { success: 1, error: 1, complete: 1 } ) {
9150 jqXHR[ i ]( s[ i ] );
9151 }
9152
9153 // Get transport
9154 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9155
9156 // If no transport, we auto-abort
9157 if ( !transport ) {
9158 done( -1, "No Transport" );
9159 } else {
9160 jqXHR.readyState = 1;
9161
9162 // Send global event
9163 if ( fireGlobals ) {
9164 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9165 }
9166 // Timeout
9167 if ( s.async && s.timeout > 0 ) {
9168 timeoutTimer = setTimeout(function() {
9169 jqXHR.abort("timeout");
9170 }, s.timeout );
9171 }
9172
9173 try {
9174 state = 1;
9175 transport.send( requestHeaders, done );
9176 } catch ( e ) {
9177 // Propagate exception as error if not done
9178 if ( state < 2 ) {
9179 done( -1, e );
9180 // Simply rethrow otherwise
9181 } else {
9182 throw e;
9183 }
9184 }
9185 }
9186
9187 // Callback for when everything is done
9188 function done( status, nativeStatusText, responses, headers ) {
9189 var isSuccess, success, error, response, modified,
9190 statusText = nativeStatusText;
9191
9192 // Called once
9193 if ( state === 2 ) {
9194 return;
9195 }
9196
9197 // State is "done" now
9198 state = 2;
9199
9200 // Clear timeout if it exists
9201 if ( timeoutTimer ) {
9202 clearTimeout( timeoutTimer );
9203 }
9204
9205 // Dereference transport for early garbage collection
9206 // (no matter how long the jqXHR object will be used)
9207 transport = undefined;
9208
9209 // Cache response headers
9210 responseHeadersString = headers || "";
9211
9212 // Set readyState
9213 jqXHR.readyState = status > 0 ? 4 : 0;
9214
9215 // Determine if successful
9216 isSuccess = status >= 200 && status < 300 || status === 304;
9217
9218 // Get response data
9219 if ( responses ) {
9220 response = ajaxHandleResponses( s, jqXHR, responses );
9221 }
9222
9223 // Convert no matter what (that way responseXXX fields are always set)
9224 response = ajaxConvert( s, response, jqXHR, isSuccess );
9225
9226 // If successful, handle type chaining
9227 if ( isSuccess ) {
9228
9229 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9230 if ( s.ifModified ) {
9231 modified = jqXHR.getResponseHeader("Last-Modified");
9232 if ( modified ) {
9233 jQuery.lastModified[ cacheURL ] = modified;
9234 }
9235 modified = jqXHR.getResponseHeader("etag");
9236 if ( modified ) {
9237 jQuery.etag[ cacheURL ] = modified;
9238 }
9239 }
9240
9241 // if no content
9242 if ( status === 204 || s.type === "HEAD" ) {
9243 statusText = "nocontent";
9244
9245 // if not modified
9246 } else if ( status === 304 ) {
9247 statusText = "notmodified";
9248
9249 // If we have data, let's convert it
9250 } else {
9251 statusText = response.state;
9252 success = response.data;
9253 error = response.error;
9254 isSuccess = !error;
9255 }
9256 } else {
9257 // We extract error from statusText
9258 // then normalize statusText and status for non-aborts
9259 error = statusText;
9260 if ( status || !statusText ) {
9261 statusText = "error";
9262 if ( status < 0 ) {
9263 status = 0;
9264 }
9265 }
9266 }
9267
9268 // Set data for the fake xhr object
9269 jqXHR.status = status;
9270 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9271
9272 // Success/Error
9273 if ( isSuccess ) {
9274 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9275 } else {
9276 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9277 }
9278
9279 // Status-dependent callbacks
9280 jqXHR.statusCode( statusCode );
9281 statusCode = undefined;
9282
9283 if ( fireGlobals ) {
9284 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9285 [ jqXHR, s, isSuccess ? success : error ] );
9286 }
9287
9288 // Complete
9289 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9290
9291 if ( fireGlobals ) {
9292 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9293 // Handle the global AJAX counter
9294 if ( !( --jQuery.active ) ) {
9295 jQuery.event.trigger("ajaxStop");
9296 }
9297 }
9298 }
9299
9300 return jqXHR;
9301 },
9302
9303 getJSON: function( url, data, callback ) {
9304 return jQuery.get( url, data, callback, "json" );
9305 },
9306
9307 getScript: function( url, callback ) {
9308 return jQuery.get( url, undefined, callback, "script" );
9309 }
9310 });
9311
9312 jQuery.each( [ "get", "post" ], function( i, method ) {
9313 jQuery[ method ] = function( url, data, callback, type ) {
9314 // shift arguments if data argument was omitted
9315 if ( jQuery.isFunction( data ) ) {
9316 type = type || callback;
9317 callback = data;
9318 data = undefined;
9319 }
9320
9321 return jQuery.ajax({
9322 url: url,
9323 type: method,
9324 dataType: type,
9325 data: data,
9326 success: callback
9327 });
9328 };
9329 });
9330
9331 // Attach a bunch of functions for handling common AJAX events
9332 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
9333 jQuery.fn[ type ] = function( fn ) {
9334 return this.on( type, fn );
9335 };
9336 });
9337
9338
9339 jQuery._evalUrl = function( url ) {
9340 return jQuery.ajax({
9341 url: url,
9342 type: "GET",
9343 dataType: "script",
9344 async: false,
9345 global: false,
9346 "throws": true
9347 });
9348 };
9349
9350
9351 jQuery.fn.extend({
9352 wrapAll: function( html ) {
9353 if ( jQuery.isFunction( html ) ) {
9354 return this.each(function(i) {
9355 jQuery(this).wrapAll( html.call(this, i) );
9356 });
9357 }
9358
9359 if ( this[0] ) {
9360 // The elements to wrap the target around
9361 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
9362
9363 if ( this[0].parentNode ) {
9364 wrap.insertBefore( this[0] );
9365 }
9366
9367 wrap.map(function() {
9368 var elem = this;
9369
9370 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
9371 elem = elem.firstChild;
9372 }
9373
9374 return elem;
9375 }).append( this );
9376 }
9377
9378 return this;
9379 },
9380
9381 wrapInner: function( html ) {
9382 if ( jQuery.isFunction( html ) ) {
9383 return this.each(function(i) {
9384 jQuery(this).wrapInner( html.call(this, i) );
9385 });
9386 }
9387
9388 return this.each(function() {
9389 var self = jQuery( this ),
9390 contents = self.contents();
9391
9392 if ( contents.length ) {
9393 contents.wrapAll( html );
9394
9395 } else {
9396 self.append( html );
9397 }
9398 });
9399 },
9400
9401 wrap: function( html ) {
9402 var isFunction = jQuery.isFunction( html );
9403
9404 return this.each(function(i) {
9405 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
9406 });
9407 },
9408
9409 unwrap: function() {
9410 return this.parent().each(function() {
9411 if ( !jQuery.nodeName( this, "body" ) ) {
9412 jQuery( this ).replaceWith( this.childNodes );
9413 }
9414 }).end();
9415 }
9416 });
9417
9418
9419 jQuery.expr.filters.hidden = function( elem ) {
9420 // Support: Opera <= 12.12
9421 // Opera reports offsetWidths and offsetHeights less than zero on some elements
9422 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
9423 (!support.reliableHiddenOffsets() &&
9424 ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
9425 };
9426
9427 jQuery.expr.filters.visible = function( elem ) {
9428 return !jQuery.expr.filters.hidden( elem );
9429 };
9430
9431
9432
9433
9434 var r20 = /%20/g,
9435 rbracket = /\[\]$/,
9436 rCRLF = /\r?\n/g,
9437 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
9438 rsubmittable = /^(?:input|select|textarea|keygen)/i;
9439
9440 function buildParams( prefix, obj, traditional, add ) {
9441 var name;
9442
9443 if ( jQuery.isArray( obj ) ) {
9444 // Serialize array item.
9445 jQuery.each( obj, function( i, v ) {
9446 if ( traditional || rbracket.test( prefix ) ) {
9447 // Treat each array item as a scalar.
9448 add( prefix, v );
9449
9450 } else {
9451 // Item is non-scalar (array or object), encode its numeric index.
9452 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
9453 }
9454 });
9455
9456 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
9457 // Serialize object item.
9458 for ( name in obj ) {
9459 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
9460 }
9461
9462 } else {
9463 // Serialize scalar item.
9464 add( prefix, obj );
9465 }
9466 }
9467
9468 // Serialize an array of form elements or a set of
9469 // key/values into a query string
9470 jQuery.param = function( a, traditional ) {
9471 var prefix,
9472 s = [],
9473 add = function( key, value ) {
9474 // If value is a function, invoke it and return its value
9475 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
9476 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
9477 };
9478
9479 // Set traditional to true for jQuery <= 1.3.2 behavior.
9480 if ( traditional === undefined ) {
9481 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9482 }
9483
9484 // If an array was passed in, assume that it is an array of form elements.
9485 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9486 // Serialize the form elements
9487 jQuery.each( a, function() {
9488 add( this.name, this.value );
9489 });
9490
9491 } else {
9492 // If traditional, encode the "old" way (the way 1.3.2 or older
9493 // did it), otherwise encode params recursively.
9494 for ( prefix in a ) {
9495 buildParams( prefix, a[ prefix ], traditional, add );
9496 }
9497 }
9498
9499 // Return the resulting serialization
9500 return s.join( "&" ).replace( r20, "+" );
9501 };
9502
9503 jQuery.fn.extend({
9504 serialize: function() {
9505 return jQuery.param( this.serializeArray() );
9506 },
9507 serializeArray: function() {
9508 return this.map(function() {
9509 // Can add propHook for "elements" to filter or add form elements
9510 var elements = jQuery.prop( this, "elements" );
9511 return elements ? jQuery.makeArray( elements ) : this;
9512 })
9513 .filter(function() {
9514 var type = this.type;
9515 // Use .is(":disabled") so that fieldset[disabled] works
9516 return this.name && !jQuery( this ).is( ":disabled" ) &&
9517 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9518 ( this.checked || !rcheckableType.test( type ) );
9519 })
9520 .map(function( i, elem ) {
9521 var val = jQuery( this ).val();
9522
9523 return val == null ?
9524 null :
9525 jQuery.isArray( val ) ?
9526 jQuery.map( val, function( val ) {
9527 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9528 }) :
9529 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9530 }).get();
9531 }
9532 });
9533
9534
9535 // Create the request object
9536 // (This is still attached to ajaxSettings for backward compatibility)
9537 jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
9538 // Support: IE6+
9539 function() {
9540
9541 // XHR cannot access local files, always use ActiveX for that case
9542 return !this.isLocal &&
9543
9544 // Support: IE7-8
9545 // oldIE XHR does not support non-RFC2616 methods (#13240)
9546 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
9547 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
9548 // Although this check for six methods instead of eight
9549 // since IE also does not support "trace" and "connect"
9550 /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
9551
9552 createStandardXHR() || createActiveXHR();
9553 } :
9554 // For all other browsers, use the standard XMLHttpRequest object
9555 createStandardXHR;
9556
9557 var xhrId = 0,
9558 xhrCallbacks = {},
9559 xhrSupported = jQuery.ajaxSettings.xhr();
9560
9561 // Support: IE<10
9562 // Open requests must be manually aborted on unload (#5280)
9563 if ( window.ActiveXObject ) {
9564 jQuery( window ).on( "unload", function() {
9565 for ( var key in xhrCallbacks ) {
9566 xhrCallbacks[ key ]( undefined, true );
9567 }
9568 });
9569 }
9570
9571 // Determine support properties
9572 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9573 xhrSupported = support.ajax = !!xhrSupported;
9574
9575 // Create transport if the browser can provide an xhr
9576 if ( xhrSupported ) {
9577
9578 jQuery.ajaxTransport(function( options ) {
9579 // Cross domain only allowed if supported through XMLHttpRequest
9580 if ( !options.crossDomain || support.cors ) {
9581
9582 var callback;
9583
9584 return {
9585 send: function( headers, complete ) {
9586 var i,
9587 xhr = options.xhr(),
9588 id = ++xhrId;
9589
9590 // Open the socket
9591 xhr.open( options.type, options.url, options.async, options.username, options.password );
9592
9593 // Apply custom fields if provided
9594 if ( options.xhrFields ) {
9595 for ( i in options.xhrFields ) {
9596 xhr[ i ] = options.xhrFields[ i ];
9597 }
9598 }
9599
9600 // Override mime type if needed
9601 if ( options.mimeType && xhr.overrideMimeType ) {
9602 xhr.overrideMimeType( options.mimeType );
9603 }
9604
9605 // X-Requested-With header
9606 // For cross-domain requests, seeing as conditions for a preflight are
9607 // akin to a jigsaw puzzle, we simply never set it to be sure.
9608 // (it can always be set on a per-request basis or even using ajaxSetup)
9609 // For same-domain requests, won't change header if already provided.
9610 if ( !options.crossDomain && !headers["X-Requested-With"] ) {
9611 headers["X-Requested-With"] = "XMLHttpRequest";
9612 }
9613
9614 // Set headers
9615 for ( i in headers ) {
9616 // Support: IE<9
9617 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
9618 // request header to a null-value.
9619 //
9620 // To keep consistent with other XHR implementations, cast the value
9621 // to string and ignore `undefined`.
9622 if ( headers[ i ] !== undefined ) {
9623 xhr.setRequestHeader( i, headers[ i ] + "" );
9624 }
9625 }
9626
9627 // Do send the request
9628 // This may raise an exception which is actually
9629 // handled in jQuery.ajax (so no try/catch here)
9630 xhr.send( ( options.hasContent && options.data ) || null );
9631
9632 // Listener
9633 callback = function( _, isAbort ) {
9634 var status, statusText, responses;
9635
9636 // Was never called and is aborted or complete
9637 if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
9638 // Clean up
9639 delete xhrCallbacks[ id ];
9640 callback = undefined;
9641 xhr.onreadystatechange = jQuery.noop;
9642
9643 // Abort manually if needed
9644 if ( isAbort ) {
9645 if ( xhr.readyState !== 4 ) {
9646 xhr.abort();
9647 }
9648 } else {
9649 responses = {};
9650 status = xhr.status;
9651
9652 // Support: IE<10
9653 // Accessing binary-data responseText throws an exception
9654 // (#11426)
9655 if ( typeof xhr.responseText === "string" ) {
9656 responses.text = xhr.responseText;
9657 }
9658
9659 // Firefox throws an exception when accessing
9660 // statusText for faulty cross-domain requests
9661 try {
9662 statusText = xhr.statusText;
9663 } catch( e ) {
9664 // We normalize with Webkit giving an empty statusText
9665 statusText = "";
9666 }
9667
9668 // Filter status for non standard behaviors
9669
9670 // If the request is local and we have data: assume a success
9671 // (success with no data won't get notified, that's the best we
9672 // can do given current implementations)
9673 if ( !status && options.isLocal && !options.crossDomain ) {
9674 status = responses.text ? 200 : 404;
9675 // IE - #1450: sometimes returns 1223 when it should be 204
9676 } else if ( status === 1223 ) {
9677 status = 204;
9678 }
9679 }
9680 }
9681
9682 // Call complete if needed
9683 if ( responses ) {
9684 complete( status, statusText, responses, xhr.getAllResponseHeaders() );
9685 }
9686 };
9687
9688 if ( !options.async ) {
9689 // if we're in sync mode we fire the callback
9690 callback();
9691 } else if ( xhr.readyState === 4 ) {
9692 // (IE6 & IE7) if it's in cache and has been
9693 // retrieved directly we need to fire the callback
9694 setTimeout( callback );
9695 } else {
9696 // Add to the list of active xhr callbacks
9697 xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
9698 }
9699 },
9700
9701 abort: function() {
9702 if ( callback ) {
9703 callback( undefined, true );
9704 }
9705 }
9706 };
9707 }
9708 });
9709 }
9710
9711 // Functions to create xhrs
9712 function createStandardXHR() {
9713 try {
9714 return new window.XMLHttpRequest();
9715 } catch( e ) {}
9716 }
9717
9718 function createActiveXHR() {
9719 try {
9720 return new window.ActiveXObject( "Microsoft.XMLHTTP" );
9721 } catch( e ) {}
9722 }
9723
9724
9725
9726
9727 // Install script dataType
9728 jQuery.ajaxSetup({
9729 accepts: {
9730 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
9731 },
9732 contents: {
9733 script: /(?:java|ecma)script/
9734 },
9735 converters: {
9736 "text script": function( text ) {
9737 jQuery.globalEval( text );
9738 return text;
9739 }
9740 }
9741 });
9742
9743 // Handle cache's special case and global
9744 jQuery.ajaxPrefilter( "script", function( s ) {
9745 if ( s.cache === undefined ) {
9746 s.cache = false;
9747 }
9748 if ( s.crossDomain ) {
9749 s.type = "GET";
9750 s.global = false;
9751 }
9752 });
9753
9754 // Bind script tag hack transport
9755 jQuery.ajaxTransport( "script", function(s) {
9756
9757 // This transport only deals with cross domain requests
9758 if ( s.crossDomain ) {
9759
9760 var script,
9761 head = document.head || jQuery("head")[0] || document.documentElement;
9762
9763 return {
9764
9765 send: function( _, callback ) {
9766
9767 script = document.createElement("script");
9768
9769 script.async = true;
9770
9771 if ( s.scriptCharset ) {
9772 script.charset = s.scriptCharset;
9773 }
9774
9775 script.src = s.url;
9776
9777 // Attach handlers for all browsers
9778 script.onload = script.onreadystatechange = function( _, isAbort ) {
9779
9780 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
9781
9782 // Handle memory leak in IE
9783 script.onload = script.onreadystatechange = null;
9784
9785 // Remove the script
9786 if ( script.parentNode ) {
9787 script.parentNode.removeChild( script );
9788 }
9789
9790 // Dereference the script
9791 script = null;
9792
9793 // Callback if not abort
9794 if ( !isAbort ) {
9795 callback( 200, "success" );
9796 }
9797 }
9798 };
9799
9800 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
9801 // Use native DOM manipulation to avoid our domManip AJAX trickery
9802 head.insertBefore( script, head.firstChild );
9803 },
9804
9805 abort: function() {
9806 if ( script ) {
9807 script.onload( undefined, true );
9808 }
9809 }
9810 };
9811 }
9812 });
9813
9814
9815
9816
9817 var oldCallbacks = [],
9818 rjsonp = /(=)\?(?=&|$)|\?\?/;
9819
9820 // Default jsonp settings
9821 jQuery.ajaxSetup({
9822 jsonp: "callback",
9823 jsonpCallback: function() {
9824 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9825 this[ callback ] = true;
9826 return callback;
9827 }
9828 });
9829
9830 // Detect, normalize options and install callbacks for jsonp requests
9831 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9832
9833 var callbackName, overwritten, responseContainer,
9834 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9835 "url" :
9836 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
9837 );
9838
9839 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9840 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9841
9842 // Get callback name, remembering preexisting value associated with it
9843 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9844 s.jsonpCallback() :
9845 s.jsonpCallback;
9846
9847 // Insert callback into url or form data
9848 if ( jsonProp ) {
9849 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9850 } else if ( s.jsonp !== false ) {
9851 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9852 }
9853
9854 // Use data converter to retrieve json after script execution
9855 s.converters["script json"] = function() {
9856 if ( !responseContainer ) {
9857 jQuery.error( callbackName + " was not called" );
9858 }
9859 return responseContainer[ 0 ];
9860 };
9861
9862 // force json dataType
9863 s.dataTypes[ 0 ] = "json";
9864
9865 // Install callback
9866 overwritten = window[ callbackName ];
9867 window[ callbackName ] = function() {
9868 responseContainer = arguments;
9869 };
9870
9871 // Clean-up function (fires after converters)
9872 jqXHR.always(function() {
9873 // Restore preexisting value
9874 window[ callbackName ] = overwritten;
9875
9876 // Save back as free
9877 if ( s[ callbackName ] ) {
9878 // make sure that re-using the options doesn't screw things around
9879 s.jsonpCallback = originalSettings.jsonpCallback;
9880
9881 // save the callback name for future use
9882 oldCallbacks.push( callbackName );
9883 }
9884
9885 // Call if it was a function and we have a response
9886 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9887 overwritten( responseContainer[ 0 ] );
9888 }
9889
9890 responseContainer = overwritten = undefined;
9891 });
9892
9893 // Delegate to script
9894 return "script";
9895 }
9896 });
9897
9898
9899
9900
9901 // data: string of html
9902 // context (optional): If specified, the fragment will be created in this context, defaults to document
9903 // keepScripts (optional): If true, will include scripts passed in the html string
9904 jQuery.parseHTML = function( data, context, keepScripts ) {
9905 if ( !data || typeof data !== "string" ) {
9906 return null;
9907 }
9908 if ( typeof context === "boolean" ) {
9909 keepScripts = context;
9910 context = false;
9911 }
9912 context = context || document;
9913
9914 var parsed = rsingleTag.exec( data ),
9915 scripts = !keepScripts && [];
9916
9917 // Single tag
9918 if ( parsed ) {
9919 return [ context.createElement( parsed[1] ) ];
9920 }
9921
9922 parsed = jQuery.buildFragment( [ data ], context, scripts );
9923
9924 if ( scripts && scripts.length ) {
9925 jQuery( scripts ).remove();
9926 }
9927
9928 return jQuery.merge( [], parsed.childNodes );
9929 };
9930
9931
9932 // Keep a copy of the old load method
9933 var _load = jQuery.fn.load;
9934
9935 /**
9936 * Load a url into a page
9937 */
9938 jQuery.fn.load = function( url, params, callback ) {
9939 if ( typeof url !== "string" && _load ) {
9940 return _load.apply( this, arguments );
9941 }
9942
9943 var selector, response, type,
9944 self = this,
9945 off = url.indexOf(" ");
9946
9947 if ( off >= 0 ) {
9948 selector = jQuery.trim( url.slice( off, url.length ) );
9949 url = url.slice( 0, off );
9950 }
9951
9952 // If it's a function
9953 if ( jQuery.isFunction( params ) ) {
9954
9955 // We assume that it's the callback
9956 callback = params;
9957 params = undefined;
9958
9959 // Otherwise, build a param string
9960 } else if ( params && typeof params === "object" ) {
9961 type = "POST";
9962 }
9963
9964 // If we have elements to modify, make the request
9965 if ( self.length > 0 ) {
9966 jQuery.ajax({
9967 url: url,
9968
9969 // if "type" variable is undefined, then "GET" method will be used
9970 type: type,
9971 dataType: "html",
9972 data: params
9973 }).done(function( responseText ) {
9974
9975 // Save response for use in complete callback
9976 response = arguments;
9977
9978 self.html( selector ?
9979
9980 // If a selector was specified, locate the right elements in a dummy div
9981 // Exclude scripts to avoid IE 'Permission Denied' errors
9982 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
9983
9984 // Otherwise use the full result
9985 responseText );
9986
9987 }).complete( callback && function( jqXHR, status ) {
9988 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
9989 });
9990 }
9991
9992 return this;
9993 };
9994
9995
9996
9997
9998 jQuery.expr.filters.animated = function( elem ) {
9999 return jQuery.grep(jQuery.timers, function( fn ) {
10000 return elem === fn.elem;
10001 }).length;
10002 };
10003
10004
10005
10006
10007
10008 var docElem = window.document.documentElement;
10009
10010 /**
10011 * Gets a window from an element
10012 */
10013 function getWindow( elem ) {
10014 return jQuery.isWindow( elem ) ?
10015 elem :
10016 elem.nodeType === 9 ?
10017 elem.defaultView || elem.parentWindow :
10018 false;
10019 }
10020
10021 jQuery.offset = {
10022 setOffset: function( elem, options, i ) {
10023 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10024 position = jQuery.css( elem, "position" ),
10025 curElem = jQuery( elem ),
10026 props = {};
10027
10028 // set position first, in-case top/left are set even on static elem
10029 if ( position === "static" ) {
10030 elem.style.position = "relative";
10031 }
10032
10033 curOffset = curElem.offset();
10034 curCSSTop = jQuery.css( elem, "top" );
10035 curCSSLeft = jQuery.css( elem, "left" );
10036 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10037 jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
10038
10039 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
10040 if ( calculatePosition ) {
10041 curPosition = curElem.position();
10042 curTop = curPosition.top;
10043 curLeft = curPosition.left;
10044 } else {
10045 curTop = parseFloat( curCSSTop ) || 0;
10046 curLeft = parseFloat( curCSSLeft ) || 0;
10047 }
10048
10049 if ( jQuery.isFunction( options ) ) {
10050 options = options.call( elem, i, curOffset );
10051 }
10052
10053 if ( options.top != null ) {
10054 props.top = ( options.top - curOffset.top ) + curTop;
10055 }
10056 if ( options.left != null ) {
10057 props.left = ( options.left - curOffset.left ) + curLeft;
10058 }
10059
10060 if ( "using" in options ) {
10061 options.using.call( elem, props );
10062 } else {
10063 curElem.css( props );
10064 }
10065 }
10066 };
10067
10068 jQuery.fn.extend({
10069 offset: function( options ) {
10070 if ( arguments.length ) {
10071 return options === undefined ?
10072 this :
10073 this.each(function( i ) {
10074 jQuery.offset.setOffset( this, options, i );
10075 });
10076 }
10077
10078 var docElem, win,
10079 box = { top: 0, left: 0 },
10080 elem = this[ 0 ],
10081 doc = elem && elem.ownerDocument;
10082
10083 if ( !doc ) {
10084 return;
10085 }
10086
10087 docElem = doc.documentElement;
10088
10089 // Make sure it's not a disconnected DOM node
10090 if ( !jQuery.contains( docElem, elem ) ) {
10091 return box;
10092 }
10093
10094 // If we don't have gBCR, just use 0,0 rather than error
10095 // BlackBerry 5, iOS 3 (original iPhone)
10096 if ( typeof elem.getBoundingClientRect !== strundefined ) {
10097 box = elem.getBoundingClientRect();
10098 }
10099 win = getWindow( doc );
10100 return {
10101 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
10102 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10103 };
10104 },
10105
10106 position: function() {
10107 if ( !this[ 0 ] ) {
10108 return;
10109 }
10110
10111 var offsetParent, offset,
10112 parentOffset = { top: 0, left: 0 },
10113 elem = this[ 0 ];
10114
10115 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
10116 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10117 // we assume that getBoundingClientRect is available when computed position is fixed
10118 offset = elem.getBoundingClientRect();
10119 } else {
10120 // Get *real* offsetParent
10121 offsetParent = this.offsetParent();
10122
10123 // Get correct offsets
10124 offset = this.offset();
10125 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10126 parentOffset = offsetParent.offset();
10127 }
10128
10129 // Add offsetParent borders
10130 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
10131 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
10132 }
10133
10134 // Subtract parent offsets and element margins
10135 // note: when an element has margin: auto the offsetLeft and marginLeft
10136 // are the same in Safari causing offset.left to incorrectly be 0
10137 return {
10138 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10139 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
10140 };
10141 },
10142
10143 offsetParent: function() {
10144 return this.map(function() {
10145 var offsetParent = this.offsetParent || docElem;
10146
10147 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
10148 offsetParent = offsetParent.offsetParent;
10149 }
10150 return offsetParent || docElem;
10151 });
10152 }
10153 });
10154
10155 // Create scrollLeft and scrollTop methods
10156 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10157 var top = /Y/.test( prop );
10158
10159 jQuery.fn[ method ] = function( val ) {
10160 return access( this, function( elem, method, val ) {
10161 var win = getWindow( elem );
10162
10163 if ( val === undefined ) {
10164 return win ? (prop in win) ? win[ prop ] :
10165 win.document.documentElement[ method ] :
10166 elem[ method ];
10167 }
10168
10169 if ( win ) {
10170 win.scrollTo(
10171 !top ? val : jQuery( win ).scrollLeft(),
10172 top ? val : jQuery( win ).scrollTop()
10173 );
10174
10175 } else {
10176 elem[ method ] = val;
10177 }
10178 }, method, val, arguments.length, null );
10179 };
10180 });
10181
10182 // Add the top/left cssHooks using jQuery.fn.position
10183 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10184 // getComputedStyle returns percent when specified for top/left/bottom/right
10185 // rather than make the css module depend on the offset module, we just check for it here
10186 jQuery.each( [ "top", "left" ], function( i, prop ) {
10187 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10188 function( elem, computed ) {
10189 if ( computed ) {
10190 computed = curCSS( elem, prop );
10191 // if curCSS returns percentage, fallback to offset
10192 return rnumnonpx.test( computed ) ?
10193 jQuery( elem ).position()[ prop ] + "px" :
10194 computed;
10195 }
10196 }
10197 );
10198 });
10199
10200
10201 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10202 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10203 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
10204 // margin is only for outerHeight, outerWidth
10205 jQuery.fn[ funcName ] = function( margin, value ) {
10206 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10207 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10208
10209 return access( this, function( elem, type, value ) {
10210 var doc;
10211
10212 if ( jQuery.isWindow( elem ) ) {
10213 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10214 // isn't a whole lot we can do. See pull request at this URL for discussion:
10215 // https://github.com/jquery/jquery/pull/764
10216 return elem.document.documentElement[ "client" + name ];
10217 }
10218
10219 // Get document width or height
10220 if ( elem.nodeType === 9 ) {
10221 doc = elem.documentElement;
10222
10223 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
10224 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
10225 return Math.max(
10226 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10227 elem.body[ "offset" + name ], doc[ "offset" + name ],
10228 doc[ "client" + name ]
10229 );
10230 }
10231
10232 return value === undefined ?
10233 // Get width or height on the element, requesting but not forcing parseFloat
10234 jQuery.css( elem, type, extra ) :
10235
10236 // Set width or height on the element
10237 jQuery.style( elem, type, value, extra );
10238 }, type, chainable ? margin : undefined, chainable, null );
10239 };
10240 });
10241 });
10242
10243
10244 // The number of elements contained in the matched element set
10245 jQuery.fn.size = function() {
10246 return this.length;
10247 };
10248
10249 jQuery.fn.andSelf = jQuery.fn.addBack;
10250
10251
10252
10253
10254 // Register as a named AMD module, since jQuery can be concatenated with other
10255 // files that may use define, but not via a proper concatenation script that
10256 // understands anonymous AMD modules. A named AMD is safest and most robust
10257 // way to register. Lowercase jquery is used because AMD module names are
10258 // derived from file names, and jQuery is normally delivered in a lowercase
10259 // file name. Do this after creating the global so that if an AMD module wants
10260 // to call noConflict to hide this version of jQuery, it will work.
10261
10262 // Note that for maximum portability, libraries that are not jQuery should
10263 // declare themselves as anonymous modules, and avoid setting a global if an
10264 // AMD loader is present. jQuery is a special case. For more information, see
10265 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10266
10267 if ( typeof define === "function" && define.amd ) {
10268 define( "jquery", [], function() {
10269 return jQuery;
10270 });
10271 }
10272
10273
10274
10275
10276 var
10277 // Map over jQuery in case of overwrite
10278 _jQuery = window.jQuery,
10279
10280 // Map over the $ in case of overwrite
10281 _$ = window.$;
10282
10283 jQuery.noConflict = function( deep ) {
10284 if ( window.$ === jQuery ) {
10285 window.$ = _$;
10286 }
10287
10288 if ( deep && window.jQuery === jQuery ) {
10289 window.jQuery = _jQuery;
10290 }
10291
10292 return jQuery;
10293 };
10294
10295 // Expose jQuery and $ identifiers, even in
10296 // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10297 // and CommonJS for browser emulators (#13566)
10298 if ( typeof noGlobal === strundefined ) {
10299 window.jQuery = window.$ = jQuery;
10300 }
10301
10302
10303
10304
10305 return jQuery;
10306
10307 }));
0 /*eslint-disable no-unused-vars*/
1 /*!
2 * jQuery JavaScript Library v3.1.0
3 * https://jquery.com/
4 *
5 * Includes Sizzle.js
6 * https://sizzlejs.com/
7 *
8 * Copyright jQuery Foundation and other contributors
9 * Released under the MIT license
10 * https://jquery.org/license
11 *
12 * Date: 2016-07-07T21:44Z
13 */
14 ( function( global, factory ) {
15
16 "use strict";
17
18 if ( typeof module === "object" && typeof module.exports === "object" ) {
19
20 // For CommonJS and CommonJS-like environments where a proper `window`
21 // is present, execute the factory and get jQuery.
22 // For environments that do not have a `window` with a `document`
23 // (such as Node.js), expose a factory as module.exports.
24 // This accentuates the need for the creation of a real `window`.
25 // e.g. var jQuery = require("jquery")(window);
26 // See ticket #14549 for more info.
27 module.exports = global.document ?
28 factory( global, true ) :
29 function( w ) {
30 if ( !w.document ) {
31 throw new Error( "jQuery requires a window with a document" );
32 }
33 return factory( w );
34 };
35 } else {
36 factory( global );
37 }
38
39 // Pass this if window is not defined yet
40 } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
41
42 // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
43 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
44 // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
45 // enough that all such attempts are guarded in a try block.
46 "use strict";
47
48 var arr = [];
49
50 var document = window.document;
51
52 var getProto = Object.getPrototypeOf;
53
54 var slice = arr.slice;
55
56 var concat = arr.concat;
57
58 var push = arr.push;
59
60 var indexOf = arr.indexOf;
61
62 var class2type = {};
63
64 var toString = class2type.toString;
65
66 var hasOwn = class2type.hasOwnProperty;
67
68 var fnToString = hasOwn.toString;
69
70 var ObjectFunctionString = fnToString.call( Object );
71
72 var support = {};
73
74
75
76 function DOMEval( code, doc ) {
77 doc = doc || document;
78
79 var script = doc.createElement( "script" );
80
81 script.text = code;
82 doc.head.appendChild( script ).parentNode.removeChild( script );
83 }
84 /* global Symbol */
85 // Defining this global in .eslintrc would create a danger of using the global
86 // unguarded in another place, it seems safer to define global only for this module
87
88
89
90 var
91 version = "3.1.0",
92
93 // Define a local copy of jQuery
94 jQuery = function( selector, context ) {
95
96 // The jQuery object is actually just the init constructor 'enhanced'
97 // Need init if jQuery is called (just allow error to be thrown if not included)
98 return new jQuery.fn.init( selector, context );
99 },
100
101 // Support: Android <=4.0 only
102 // Make sure we trim BOM and NBSP
103 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
104
105 // Matches dashed string for camelizing
106 rmsPrefix = /^-ms-/,
107 rdashAlpha = /-([a-z])/g,
108
109 // Used by jQuery.camelCase as callback to replace()
110 fcamelCase = function( all, letter ) {
111 return letter.toUpperCase();
112 };
113
114 jQuery.fn = jQuery.prototype = {
115
116 // The current version of jQuery being used
117 jquery: version,
118
119 constructor: jQuery,
120
121 // The default length of a jQuery object is 0
122 length: 0,
123
124 toArray: function() {
125 return slice.call( this );
126 },
127
128 // Get the Nth element in the matched element set OR
129 // Get the whole matched element set as a clean array
130 get: function( num ) {
131 return num != null ?
132
133 // Return just the one element from the set
134 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
135
136 // Return all the elements in a clean array
137 slice.call( this );
138 },
139
140 // Take an array of elements and push it onto the stack
141 // (returning the new matched element set)
142 pushStack: function( elems ) {
143
144 // Build a new jQuery matched element set
145 var ret = jQuery.merge( this.constructor(), elems );
146
147 // Add the old object onto the stack (as a reference)
148 ret.prevObject = this;
149
150 // Return the newly-formed element set
151 return ret;
152 },
153
154 // Execute a callback for every element in the matched set.
155 each: function( callback ) {
156 return jQuery.each( this, callback );
157 },
158
159 map: function( callback ) {
160 return this.pushStack( jQuery.map( this, function( elem, i ) {
161 return callback.call( elem, i, elem );
162 } ) );
163 },
164
165 slice: function() {
166 return this.pushStack( slice.apply( this, arguments ) );
167 },
168
169 first: function() {
170 return this.eq( 0 );
171 },
172
173 last: function() {
174 return this.eq( -1 );
175 },
176
177 eq: function( i ) {
178 var len = this.length,
179 j = +i + ( i < 0 ? len : 0 );
180 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
181 },
182
183 end: function() {
184 return this.prevObject || this.constructor();
185 },
186
187 // For internal use only.
188 // Behaves like an Array's method, not like a jQuery method.
189 push: push,
190 sort: arr.sort,
191 splice: arr.splice
192 };
193
194 jQuery.extend = jQuery.fn.extend = function() {
195 var options, name, src, copy, copyIsArray, clone,
196 target = arguments[ 0 ] || {},
197 i = 1,
198 length = arguments.length,
199 deep = false;
200
201 // Handle a deep copy situation
202 if ( typeof target === "boolean" ) {
203 deep = target;
204
205 // Skip the boolean and the target
206 target = arguments[ i ] || {};
207 i++;
208 }
209
210 // Handle case when target is a string or something (possible in deep copy)
211 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
212 target = {};
213 }
214
215 // Extend jQuery itself if only one argument is passed
216 if ( i === length ) {
217 target = this;
218 i--;
219 }
220
221 for ( ; i < length; i++ ) {
222
223 // Only deal with non-null/undefined values
224 if ( ( options = arguments[ i ] ) != null ) {
225
226 // Extend the base object
227 for ( name in options ) {
228 src = target[ name ];
229 copy = options[ name ];
230
231 // Prevent never-ending loop
232 if ( target === copy ) {
233 continue;
234 }
235
236 // Recurse if we're merging plain objects or arrays
237 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
238 ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
239
240 if ( copyIsArray ) {
241 copyIsArray = false;
242 clone = src && jQuery.isArray( src ) ? src : [];
243
244 } else {
245 clone = src && jQuery.isPlainObject( src ) ? src : {};
246 }
247
248 // Never move original objects, clone them
249 target[ name ] = jQuery.extend( deep, clone, copy );
250
251 // Don't bring in undefined values
252 } else if ( copy !== undefined ) {
253 target[ name ] = copy;
254 }
255 }
256 }
257 }
258
259 // Return the modified object
260 return target;
261 };
262
263 jQuery.extend( {
264
265 // Unique for each copy of jQuery on the page
266 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
267
268 // Assume jQuery is ready without the ready module
269 isReady: true,
270
271 error: function( msg ) {
272 throw new Error( msg );
273 },
274
275 noop: function() {},
276
277 isFunction: function( obj ) {
278 return jQuery.type( obj ) === "function";
279 },
280
281 isArray: Array.isArray,
282
283 isWindow: function( obj ) {
284 return obj != null && obj === obj.window;
285 },
286
287 isNumeric: function( obj ) {
288
289 // As of jQuery 3.0, isNumeric is limited to
290 // strings and numbers (primitives or objects)
291 // that can be coerced to finite numbers (gh-2662)
292 var type = jQuery.type( obj );
293 return ( type === "number" || type === "string" ) &&
294
295 // parseFloat NaNs numeric-cast false positives ("")
296 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
297 // subtraction forces infinities to NaN
298 !isNaN( obj - parseFloat( obj ) );
299 },
300
301 isPlainObject: function( obj ) {
302 var proto, Ctor;
303
304 // Detect obvious negatives
305 // Use toString instead of jQuery.type to catch host objects
306 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
307 return false;
308 }
309
310 proto = getProto( obj );
311
312 // Objects with no prototype (e.g., `Object.create( null )`) are plain
313 if ( !proto ) {
314 return true;
315 }
316
317 // Objects with prototype are plain iff they were constructed by a global Object function
318 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
319 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
320 },
321
322 isEmptyObject: function( obj ) {
323
324 /* eslint-disable no-unused-vars */
325 // See https://github.com/eslint/eslint/issues/6125
326 var name;
327
328 for ( name in obj ) {
329 return false;
330 }
331 return true;
332 },
333
334 type: function( obj ) {
335 if ( obj == null ) {
336 return obj + "";
337 }
338
339 // Support: Android <=2.3 only (functionish RegExp)
340 return typeof obj === "object" || typeof obj === "function" ?
341 class2type[ toString.call( obj ) ] || "object" :
342 typeof obj;
343 },
344
345 // Evaluates a script in a global context
346 globalEval: function( code ) {
347 DOMEval( code );
348 },
349
350 // Convert dashed to camelCase; used by the css and data modules
351 // Support: IE <=9 - 11, Edge 12 - 13
352 // Microsoft forgot to hump their vendor prefix (#9572)
353 camelCase: function( string ) {
354 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
355 },
356
357 nodeName: function( elem, name ) {
358 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
359 },
360
361 each: function( obj, callback ) {
362 var length, i = 0;
363
364 if ( isArrayLike( obj ) ) {
365 length = obj.length;
366 for ( ; i < length; i++ ) {
367 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
368 break;
369 }
370 }
371 } else {
372 for ( i in obj ) {
373 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
374 break;
375 }
376 }
377 }
378
379 return obj;
380 },
381
382 // Support: Android <=4.0 only
383 trim: function( text ) {
384 return text == null ?
385 "" :
386 ( text + "" ).replace( rtrim, "" );
387 },
388
389 // results is for internal usage only
390 makeArray: function( arr, results ) {
391 var ret = results || [];
392
393 if ( arr != null ) {
394 if ( isArrayLike( Object( arr ) ) ) {
395 jQuery.merge( ret,
396 typeof arr === "string" ?
397 [ arr ] : arr
398 );
399 } else {
400 push.call( ret, arr );
401 }
402 }
403
404 return ret;
405 },
406
407 inArray: function( elem, arr, i ) {
408 return arr == null ? -1 : indexOf.call( arr, elem, i );
409 },
410
411 // Support: Android <=4.0 only, PhantomJS 1 only
412 // push.apply(_, arraylike) throws on ancient WebKit
413 merge: function( first, second ) {
414 var len = +second.length,
415 j = 0,
416 i = first.length;
417
418 for ( ; j < len; j++ ) {
419 first[ i++ ] = second[ j ];
420 }
421
422 first.length = i;
423
424 return first;
425 },
426
427 grep: function( elems, callback, invert ) {
428 var callbackInverse,
429 matches = [],
430 i = 0,
431 length = elems.length,
432 callbackExpect = !invert;
433
434 // Go through the array, only saving the items
435 // that pass the validator function
436 for ( ; i < length; i++ ) {
437 callbackInverse = !callback( elems[ i ], i );
438 if ( callbackInverse !== callbackExpect ) {
439 matches.push( elems[ i ] );
440 }
441 }
442
443 return matches;
444 },
445
446 // arg is for internal usage only
447 map: function( elems, callback, arg ) {
448 var length, value,
449 i = 0,
450 ret = [];
451
452 // Go through the array, translating each of the items to their new values
453 if ( isArrayLike( elems ) ) {
454 length = elems.length;
455 for ( ; i < length; i++ ) {
456 value = callback( elems[ i ], i, arg );
457
458 if ( value != null ) {
459 ret.push( value );
460 }
461 }
462
463 // Go through every key on the object,
464 } else {
465 for ( i in elems ) {
466 value = callback( elems[ i ], i, arg );
467
468 if ( value != null ) {
469 ret.push( value );
470 }
471 }
472 }
473
474 // Flatten any nested arrays
475 return concat.apply( [], ret );
476 },
477
478 // A global GUID counter for objects
479 guid: 1,
480
481 // Bind a function to a context, optionally partially applying any
482 // arguments.
483 proxy: function( fn, context ) {
484 var tmp, args, proxy;
485
486 if ( typeof context === "string" ) {
487 tmp = fn[ context ];
488 context = fn;
489 fn = tmp;
490 }
491
492 // Quick check to determine if target is callable, in the spec
493 // this throws a TypeError, but we will just return undefined.
494 if ( !jQuery.isFunction( fn ) ) {
495 return undefined;
496 }
497
498 // Simulated bind
499 args = slice.call( arguments, 2 );
500 proxy = function() {
501 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
502 };
503
504 // Set the guid of unique handler to the same of original handler, so it can be removed
505 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
506
507 return proxy;
508 },
509
510 now: Date.now,
511
512 // jQuery.support is not used in Core but other projects attach their
513 // properties to it so it needs to exist.
514 support: support
515 } );
516
517 if ( typeof Symbol === "function" ) {
518 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
519 }
520
521 // Populate the class2type map
522 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
523 function( i, name ) {
524 class2type[ "[object " + name + "]" ] = name.toLowerCase();
525 } );
526
527 function isArrayLike( obj ) {
528
529 // Support: real iOS 8.2 only (not reproducible in simulator)
530 // `in` check used to prevent JIT error (gh-2145)
531 // hasOwn isn't used here due to false negatives
532 // regarding Nodelist length in IE
533 var length = !!obj && "length" in obj && obj.length,
534 type = jQuery.type( obj );
535
536 if ( type === "function" || jQuery.isWindow( obj ) ) {
537 return false;
538 }
539
540 return type === "array" || length === 0 ||
541 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
542 }
543 var Sizzle =
544 /*!
545 * Sizzle CSS Selector Engine v2.3.0
546 * https://sizzlejs.com/
547 *
548 * Copyright jQuery Foundation and other contributors
549 * Released under the MIT license
550 * http://jquery.org/license
551 *
552 * Date: 2016-01-04
553 */
554 (function( window ) {
555
556 var i,
557 support,
558 Expr,
559 getText,
560 isXML,
561 tokenize,
562 compile,
563 select,
564 outermostContext,
565 sortInput,
566 hasDuplicate,
567
568 // Local document vars
569 setDocument,
570 document,
571 docElem,
572 documentIsHTML,
573 rbuggyQSA,
574 rbuggyMatches,
575 matches,
576 contains,
577
578 // Instance-specific data
579 expando = "sizzle" + 1 * new Date(),
580 preferredDoc = window.document,
581 dirruns = 0,
582 done = 0,
583 classCache = createCache(),
584 tokenCache = createCache(),
585 compilerCache = createCache(),
586 sortOrder = function( a, b ) {
587 if ( a === b ) {
588 hasDuplicate = true;
589 }
590 return 0;
591 },
592
593 // Instance methods
594 hasOwn = ({}).hasOwnProperty,
595 arr = [],
596 pop = arr.pop,
597 push_native = arr.push,
598 push = arr.push,
599 slice = arr.slice,
600 // Use a stripped-down indexOf as it's faster than native
601 // https://jsperf.com/thor-indexof-vs-for/5
602 indexOf = function( list, elem ) {
603 var i = 0,
604 len = list.length;
605 for ( ; i < len; i++ ) {
606 if ( list[i] === elem ) {
607 return i;
608 }
609 }
610 return -1;
611 },
612
613 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
614
615 // Regular expressions
616
617 // http://www.w3.org/TR/css3-selectors/#whitespace
618 whitespace = "[\\x20\\t\\r\\n\\f]",
619
620 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
621 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
622
623 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
624 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
625 // Operator (capture 2)
626 "*([*^$|!~]?=)" + whitespace +
627 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
628 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
629 "*\\]",
630
631 pseudos = ":(" + identifier + ")(?:\\((" +
632 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
633 // 1. quoted (capture 3; capture 4 or capture 5)
634 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
635 // 2. simple (capture 6)
636 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
637 // 3. anything else (capture 2)
638 ".*" +
639 ")\\)|)",
640
641 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
642 rwhitespace = new RegExp( whitespace + "+", "g" ),
643 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
644
645 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
646 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
647
648 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
649
650 rpseudo = new RegExp( pseudos ),
651 ridentifier = new RegExp( "^" + identifier + "$" ),
652
653 matchExpr = {
654 "ID": new RegExp( "^#(" + identifier + ")" ),
655 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
656 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
657 "ATTR": new RegExp( "^" + attributes ),
658 "PSEUDO": new RegExp( "^" + pseudos ),
659 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
660 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
661 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
662 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
663 // For use in libraries implementing .is()
664 // We use this for POS matching in `select`
665 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
666 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
667 },
668
669 rinputs = /^(?:input|select|textarea|button)$/i,
670 rheader = /^h\d$/i,
671
672 rnative = /^[^{]+\{\s*\[native \w/,
673
674 // Easily-parseable/retrievable ID or TAG or CLASS selectors
675 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
676
677 rsibling = /[+~]/,
678
679 // CSS escapes
680 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
681 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
682 funescape = function( _, escaped, escapedWhitespace ) {
683 var high = "0x" + escaped - 0x10000;
684 // NaN means non-codepoint
685 // Support: Firefox<24
686 // Workaround erroneous numeric interpretation of +"0x"
687 return high !== high || escapedWhitespace ?
688 escaped :
689 high < 0 ?
690 // BMP codepoint
691 String.fromCharCode( high + 0x10000 ) :
692 // Supplemental Plane codepoint (surrogate pair)
693 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
694 },
695
696 // CSS string/identifier serialization
697 // https://drafts.csswg.org/cssom/#common-serializing-idioms
698 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,
699 fcssescape = function( ch, asCodePoint ) {
700 if ( asCodePoint ) {
701
702 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
703 if ( ch === "\0" ) {
704 return "\uFFFD";
705 }
706
707 // Control characters and (dependent upon position) numbers get escaped as code points
708 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
709 }
710
711 // Other potentially-special ASCII characters get backslash-escaped
712 return "\\" + ch;
713 },
714
715 // Used for iframes
716 // See setDocument()
717 // Removing the function wrapper causes a "Permission Denied"
718 // error in IE
719 unloadHandler = function() {
720 setDocument();
721 },
722
723 disabledAncestor = addCombinator(
724 function( elem ) {
725 return elem.disabled === true;
726 },
727 { dir: "parentNode", next: "legend" }
728 );
729
730 // Optimize for push.apply( _, NodeList )
731 try {
732 push.apply(
733 (arr = slice.call( preferredDoc.childNodes )),
734 preferredDoc.childNodes
735 );
736 // Support: Android<4.0
737 // Detect silently failing push.apply
738 arr[ preferredDoc.childNodes.length ].nodeType;
739 } catch ( e ) {
740 push = { apply: arr.length ?
741
742 // Leverage slice if possible
743 function( target, els ) {
744 push_native.apply( target, slice.call(els) );
745 } :
746
747 // Support: IE<9
748 // Otherwise append directly
749 function( target, els ) {
750 var j = target.length,
751 i = 0;
752 // Can't trust NodeList.length
753 while ( (target[j++] = els[i++]) ) {}
754 target.length = j - 1;
755 }
756 };
757 }
758
759 function Sizzle( selector, context, results, seed ) {
760 var m, i, elem, nid, match, groups, newSelector,
761 newContext = context && context.ownerDocument,
762
763 // nodeType defaults to 9, since context defaults to document
764 nodeType = context ? context.nodeType : 9;
765
766 results = results || [];
767
768 // Return early from calls with invalid selector or context
769 if ( typeof selector !== "string" || !selector ||
770 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
771
772 return results;
773 }
774
775 // Try to shortcut find operations (as opposed to filters) in HTML documents
776 if ( !seed ) {
777
778 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
779 setDocument( context );
780 }
781 context = context || document;
782
783 if ( documentIsHTML ) {
784
785 // If the selector is sufficiently simple, try using a "get*By*" DOM method
786 // (excepting DocumentFragment context, where the methods don't exist)
787 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
788
789 // ID selector
790 if ( (m = match[1]) ) {
791
792 // Document context
793 if ( nodeType === 9 ) {
794 if ( (elem = context.getElementById( m )) ) {
795
796 // Support: IE, Opera, Webkit
797 // TODO: identify versions
798 // getElementById can match elements by name instead of ID
799 if ( elem.id === m ) {
800 results.push( elem );
801 return results;
802 }
803 } else {
804 return results;
805 }
806
807 // Element context
808 } else {
809
810 // Support: IE, Opera, Webkit
811 // TODO: identify versions
812 // getElementById can match elements by name instead of ID
813 if ( newContext && (elem = newContext.getElementById( m )) &&
814 contains( context, elem ) &&
815 elem.id === m ) {
816
817 results.push( elem );
818 return results;
819 }
820 }
821
822 // Type selector
823 } else if ( match[2] ) {
824 push.apply( results, context.getElementsByTagName( selector ) );
825 return results;
826
827 // Class selector
828 } else if ( (m = match[3]) && support.getElementsByClassName &&
829 context.getElementsByClassName ) {
830
831 push.apply( results, context.getElementsByClassName( m ) );
832 return results;
833 }
834 }
835
836 // Take advantage of querySelectorAll
837 if ( support.qsa &&
838 !compilerCache[ selector + " " ] &&
839 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
840
841 if ( nodeType !== 1 ) {
842 newContext = context;
843 newSelector = selector;
844
845 // qSA looks outside Element context, which is not what we want
846 // Thanks to Andrew Dupont for this workaround technique
847 // Support: IE <=8
848 // Exclude object elements
849 } else if ( context.nodeName.toLowerCase() !== "object" ) {
850
851 // Capture the context ID, setting it first if necessary
852 if ( (nid = context.getAttribute( "id" )) ) {
853 nid = nid.replace( rcssescape, fcssescape );
854 } else {
855 context.setAttribute( "id", (nid = expando) );
856 }
857
858 // Prefix every selector in the list
859 groups = tokenize( selector );
860 i = groups.length;
861 while ( i-- ) {
862 groups[i] = "#" + nid + " " + toSelector( groups[i] );
863 }
864 newSelector = groups.join( "," );
865
866 // Expand context for sibling selectors
867 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
868 context;
869 }
870
871 if ( newSelector ) {
872 try {
873 push.apply( results,
874 newContext.querySelectorAll( newSelector )
875 );
876 return results;
877 } catch ( qsaError ) {
878 } finally {
879 if ( nid === expando ) {
880 context.removeAttribute( "id" );
881 }
882 }
883 }
884 }
885 }
886 }
887
888 // All others
889 return select( selector.replace( rtrim, "$1" ), context, results, seed );
890 }
891
892 /**
893 * Create key-value caches of limited size
894 * @returns {function(string, object)} Returns the Object data after storing it on itself with
895 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
896 * deleting the oldest entry
897 */
898 function createCache() {
899 var keys = [];
900
901 function cache( key, value ) {
902 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
903 if ( keys.push( key + " " ) > Expr.cacheLength ) {
904 // Only keep the most recent entries
905 delete cache[ keys.shift() ];
906 }
907 return (cache[ key + " " ] = value);
908 }
909 return cache;
910 }
911
912 /**
913 * Mark a function for special use by Sizzle
914 * @param {Function} fn The function to mark
915 */
916 function markFunction( fn ) {
917 fn[ expando ] = true;
918 return fn;
919 }
920
921 /**
922 * Support testing using an element
923 * @param {Function} fn Passed the created element and returns a boolean result
924 */
925 function assert( fn ) {
926 var el = document.createElement("fieldset");
927
928 try {
929 return !!fn( el );
930 } catch (e) {
931 return false;
932 } finally {
933 // Remove from its parent by default
934 if ( el.parentNode ) {
935 el.parentNode.removeChild( el );
936 }
937 // release memory in IE
938 el = null;
939 }
940 }
941
942 /**
943 * Adds the same handler for all of the specified attrs
944 * @param {String} attrs Pipe-separated list of attributes
945 * @param {Function} handler The method that will be applied
946 */
947 function addHandle( attrs, handler ) {
948 var arr = attrs.split("|"),
949 i = arr.length;
950
951 while ( i-- ) {
952 Expr.attrHandle[ arr[i] ] = handler;
953 }
954 }
955
956 /**
957 * Checks document order of two siblings
958 * @param {Element} a
959 * @param {Element} b
960 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
961 */
962 function siblingCheck( a, b ) {
963 var cur = b && a,
964 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
965 a.sourceIndex - b.sourceIndex;
966
967 // Use IE sourceIndex if available on both nodes
968 if ( diff ) {
969 return diff;
970 }
971
972 // Check if b follows a
973 if ( cur ) {
974 while ( (cur = cur.nextSibling) ) {
975 if ( cur === b ) {
976 return -1;
977 }
978 }
979 }
980
981 return a ? 1 : -1;
982 }
983
984 /**
985 * Returns a function to use in pseudos for input types
986 * @param {String} type
987 */
988 function createInputPseudo( type ) {
989 return function( elem ) {
990 var name = elem.nodeName.toLowerCase();
991 return name === "input" && elem.type === type;
992 };
993 }
994
995 /**
996 * Returns a function to use in pseudos for buttons
997 * @param {String} type
998 */
999 function createButtonPseudo( type ) {
1000 return function( elem ) {
1001 var name = elem.nodeName.toLowerCase();
1002 return (name === "input" || name === "button") && elem.type === type;
1003 };
1004 }
1005
1006 /**
1007 * Returns a function to use in pseudos for :enabled/:disabled
1008 * @param {Boolean} disabled true for :disabled; false for :enabled
1009 */
1010 function createDisabledPseudo( disabled ) {
1011 // Known :disabled false positives:
1012 // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)
1013 // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1014 return function( elem ) {
1015
1016 // Check form elements and option elements for explicit disabling
1017 return "label" in elem && elem.disabled === disabled ||
1018 "form" in elem && elem.disabled === disabled ||
1019
1020 // Check non-disabled form elements for fieldset[disabled] ancestors
1021 "form" in elem && elem.disabled === false && (
1022 // Support: IE6-11+
1023 // Ancestry is covered for us
1024 elem.isDisabled === disabled ||
1025
1026 // Otherwise, assume any non-<option> under fieldset[disabled] is disabled
1027 /* jshint -W018 */
1028 elem.isDisabled !== !disabled &&
1029 ("label" in elem || !disabledAncestor( elem )) !== disabled
1030 );
1031 };
1032 }
1033
1034 /**
1035 * Returns a function to use in pseudos for positionals
1036 * @param {Function} fn
1037 */
1038 function createPositionalPseudo( fn ) {
1039 return markFunction(function( argument ) {
1040 argument = +argument;
1041 return markFunction(function( seed, matches ) {
1042 var j,
1043 matchIndexes = fn( [], seed.length, argument ),
1044 i = matchIndexes.length;
1045
1046 // Match elements found at the specified indexes
1047 while ( i-- ) {
1048 if ( seed[ (j = matchIndexes[i]) ] ) {
1049 seed[j] = !(matches[j] = seed[j]);
1050 }
1051 }
1052 });
1053 });
1054 }
1055
1056 /**
1057 * Checks a node for validity as a Sizzle context
1058 * @param {Element|Object=} context
1059 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1060 */
1061 function testContext( context ) {
1062 return context && typeof context.getElementsByTagName !== "undefined" && context;
1063 }
1064
1065 // Expose support vars for convenience
1066 support = Sizzle.support = {};
1067
1068 /**
1069 * Detects XML nodes
1070 * @param {Element|Object} elem An element or a document
1071 * @returns {Boolean} True iff elem is a non-HTML XML node
1072 */
1073 isXML = Sizzle.isXML = function( elem ) {
1074 // documentElement is verified for cases where it doesn't yet exist
1075 // (such as loading iframes in IE - #4833)
1076 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1077 return documentElement ? documentElement.nodeName !== "HTML" : false;
1078 };
1079
1080 /**
1081 * Sets document-related variables once based on the current document
1082 * @param {Element|Object} [doc] An element or document object to use to set the document
1083 * @returns {Object} Returns the current document
1084 */
1085 setDocument = Sizzle.setDocument = function( node ) {
1086 var hasCompare, subWindow,
1087 doc = node ? node.ownerDocument || node : preferredDoc;
1088
1089 // Return early if doc is invalid or already selected
1090 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1091 return document;
1092 }
1093
1094 // Update global variables
1095 document = doc;
1096 docElem = document.documentElement;
1097 documentIsHTML = !isXML( document );
1098
1099 // Support: IE 9-11, Edge
1100 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1101 if ( preferredDoc !== document &&
1102 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
1103
1104 // Support: IE 11, Edge
1105 if ( subWindow.addEventListener ) {
1106 subWindow.addEventListener( "unload", unloadHandler, false );
1107
1108 // Support: IE 9 - 10 only
1109 } else if ( subWindow.attachEvent ) {
1110 subWindow.attachEvent( "onunload", unloadHandler );
1111 }
1112 }
1113
1114 /* Attributes
1115 ---------------------------------------------------------------------- */
1116
1117 // Support: IE<8
1118 // Verify that getAttribute really returns attributes and not properties
1119 // (excepting IE8 booleans)
1120 support.attributes = assert(function( el ) {
1121 el.className = "i";
1122 return !el.getAttribute("className");
1123 });
1124
1125 /* getElement(s)By*
1126 ---------------------------------------------------------------------- */
1127
1128 // Check if getElementsByTagName("*") returns only elements
1129 support.getElementsByTagName = assert(function( el ) {
1130 el.appendChild( document.createComment("") );
1131 return !el.getElementsByTagName("*").length;
1132 });
1133
1134 // Support: IE<9
1135 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1136
1137 // Support: IE<10
1138 // Check if getElementById returns elements by name
1139 // The broken getElementById methods don't pick up programmatically-set names,
1140 // so use a roundabout getElementsByName test
1141 support.getById = assert(function( el ) {
1142 docElem.appendChild( el ).id = expando;
1143 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1144 });
1145
1146 // ID find and filter
1147 if ( support.getById ) {
1148 Expr.find["ID"] = function( id, context ) {
1149 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1150 var m = context.getElementById( id );
1151 return m ? [ m ] : [];
1152 }
1153 };
1154 Expr.filter["ID"] = function( id ) {
1155 var attrId = id.replace( runescape, funescape );
1156 return function( elem ) {
1157 return elem.getAttribute("id") === attrId;
1158 };
1159 };
1160 } else {
1161 // Support: IE6/7
1162 // getElementById is not reliable as a find shortcut
1163 delete Expr.find["ID"];
1164
1165 Expr.filter["ID"] = function( id ) {
1166 var attrId = id.replace( runescape, funescape );
1167 return function( elem ) {
1168 var node = typeof elem.getAttributeNode !== "undefined" &&
1169 elem.getAttributeNode("id");
1170 return node && node.value === attrId;
1171 };
1172 };
1173 }
1174
1175 // Tag
1176 Expr.find["TAG"] = support.getElementsByTagName ?
1177 function( tag, context ) {
1178 if ( typeof context.getElementsByTagName !== "undefined" ) {
1179 return context.getElementsByTagName( tag );
1180
1181 // DocumentFragment nodes don't have gEBTN
1182 } else if ( support.qsa ) {
1183 return context.querySelectorAll( tag );
1184 }
1185 } :
1186
1187 function( tag, context ) {
1188 var elem,
1189 tmp = [],
1190 i = 0,
1191 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1192 results = context.getElementsByTagName( tag );
1193
1194 // Filter out possible comments
1195 if ( tag === "*" ) {
1196 while ( (elem = results[i++]) ) {
1197 if ( elem.nodeType === 1 ) {
1198 tmp.push( elem );
1199 }
1200 }
1201
1202 return tmp;
1203 }
1204 return results;
1205 };
1206
1207 // Class
1208 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1209 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1210 return context.getElementsByClassName( className );
1211 }
1212 };
1213
1214 /* QSA/matchesSelector
1215 ---------------------------------------------------------------------- */
1216
1217 // QSA and matchesSelector support
1218
1219 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1220 rbuggyMatches = [];
1221
1222 // qSa(:focus) reports false when true (Chrome 21)
1223 // We allow this because of a bug in IE8/9 that throws an error
1224 // whenever `document.activeElement` is accessed on an iframe
1225 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1226 // See https://bugs.jquery.com/ticket/13378
1227 rbuggyQSA = [];
1228
1229 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1230 // Build QSA regex
1231 // Regex strategy adopted from Diego Perini
1232 assert(function( el ) {
1233 // Select is set to empty string on purpose
1234 // This is to test IE's treatment of not explicitly
1235 // setting a boolean content attribute,
1236 // since its presence should be enough
1237 // https://bugs.jquery.com/ticket/12359
1238 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
1239 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
1240 "<option selected=''></option></select>";
1241
1242 // Support: IE8, Opera 11-12.16
1243 // Nothing should be selected when empty strings follow ^= or $= or *=
1244 // The test attribute must be unknown in Opera but "safe" for WinRT
1245 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1246 if ( el.querySelectorAll("[msallowcapture^='']").length ) {
1247 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1248 }
1249
1250 // Support: IE8
1251 // Boolean attributes and "value" are not treated correctly
1252 if ( !el.querySelectorAll("[selected]").length ) {
1253 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1254 }
1255
1256 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1257 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1258 rbuggyQSA.push("~=");
1259 }
1260
1261 // Webkit/Opera - :checked should return selected option elements
1262 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1263 // IE8 throws error here and will not see later tests
1264 if ( !el.querySelectorAll(":checked").length ) {
1265 rbuggyQSA.push(":checked");
1266 }
1267
1268 // Support: Safari 8+, iOS 8+
1269 // https://bugs.webkit.org/show_bug.cgi?id=136851
1270 // In-page `selector#id sibling-combinator selector` fails
1271 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1272 rbuggyQSA.push(".#.+[+~]");
1273 }
1274 });
1275
1276 assert(function( el ) {
1277 el.innerHTML = "<a href='' disabled='disabled'></a>" +
1278 "<select disabled='disabled'><option/></select>";
1279
1280 // Support: Windows 8 Native Apps
1281 // The type and name attributes are restricted during .innerHTML assignment
1282 var input = document.createElement("input");
1283 input.setAttribute( "type", "hidden" );
1284 el.appendChild( input ).setAttribute( "name", "D" );
1285
1286 // Support: IE8
1287 // Enforce case-sensitivity of name attribute
1288 if ( el.querySelectorAll("[name=d]").length ) {
1289 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1290 }
1291
1292 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1293 // IE8 throws error here and will not see later tests
1294 if ( el.querySelectorAll(":enabled").length !== 2 ) {
1295 rbuggyQSA.push( ":enabled", ":disabled" );
1296 }
1297
1298 // Support: IE9-11+
1299 // IE's :disabled selector does not pick up the children of disabled fieldsets
1300 docElem.appendChild( el ).disabled = true;
1301 if ( el.querySelectorAll(":disabled").length !== 2 ) {
1302 rbuggyQSA.push( ":enabled", ":disabled" );
1303 }
1304
1305 // Opera 10-11 does not throw on post-comma invalid pseudos
1306 el.querySelectorAll("*,:x");
1307 rbuggyQSA.push(",.*:");
1308 });
1309 }
1310
1311 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1312 docElem.webkitMatchesSelector ||
1313 docElem.mozMatchesSelector ||
1314 docElem.oMatchesSelector ||
1315 docElem.msMatchesSelector) )) ) {
1316
1317 assert(function( el ) {
1318 // Check to see if it's possible to do matchesSelector
1319 // on a disconnected node (IE 9)
1320 support.disconnectedMatch = matches.call( el, "*" );
1321
1322 // This should fail with an exception
1323 // Gecko does not error, returns false instead
1324 matches.call( el, "[s!='']:x" );
1325 rbuggyMatches.push( "!=", pseudos );
1326 });
1327 }
1328
1329 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1330 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1331
1332 /* Contains
1333 ---------------------------------------------------------------------- */
1334 hasCompare = rnative.test( docElem.compareDocumentPosition );
1335
1336 // Element contains another
1337 // Purposefully self-exclusive
1338 // As in, an element does not contain itself
1339 contains = hasCompare || rnative.test( docElem.contains ) ?
1340 function( a, b ) {
1341 var adown = a.nodeType === 9 ? a.documentElement : a,
1342 bup = b && b.parentNode;
1343 return a === bup || !!( bup && bup.nodeType === 1 && (
1344 adown.contains ?
1345 adown.contains( bup ) :
1346 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1347 ));
1348 } :
1349 function( a, b ) {
1350 if ( b ) {
1351 while ( (b = b.parentNode) ) {
1352 if ( b === a ) {
1353 return true;
1354 }
1355 }
1356 }
1357 return false;
1358 };
1359
1360 /* Sorting
1361 ---------------------------------------------------------------------- */
1362
1363 // Document order sorting
1364 sortOrder = hasCompare ?
1365 function( a, b ) {
1366
1367 // Flag for duplicate removal
1368 if ( a === b ) {
1369 hasDuplicate = true;
1370 return 0;
1371 }
1372
1373 // Sort on method existence if only one input has compareDocumentPosition
1374 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1375 if ( compare ) {
1376 return compare;
1377 }
1378
1379 // Calculate position if both inputs belong to the same document
1380 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1381 a.compareDocumentPosition( b ) :
1382
1383 // Otherwise we know they are disconnected
1384 1;
1385
1386 // Disconnected nodes
1387 if ( compare & 1 ||
1388 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1389
1390 // Choose the first element that is related to our preferred document
1391 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1392 return -1;
1393 }
1394 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1395 return 1;
1396 }
1397
1398 // Maintain original order
1399 return sortInput ?
1400 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1401 0;
1402 }
1403
1404 return compare & 4 ? -1 : 1;
1405 } :
1406 function( a, b ) {
1407 // Exit early if the nodes are identical
1408 if ( a === b ) {
1409 hasDuplicate = true;
1410 return 0;
1411 }
1412
1413 var cur,
1414 i = 0,
1415 aup = a.parentNode,
1416 bup = b.parentNode,
1417 ap = [ a ],
1418 bp = [ b ];
1419
1420 // Parentless nodes are either documents or disconnected
1421 if ( !aup || !bup ) {
1422 return a === document ? -1 :
1423 b === document ? 1 :
1424 aup ? -1 :
1425 bup ? 1 :
1426 sortInput ?
1427 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1428 0;
1429
1430 // If the nodes are siblings, we can do a quick check
1431 } else if ( aup === bup ) {
1432 return siblingCheck( a, b );
1433 }
1434
1435 // Otherwise we need full lists of their ancestors for comparison
1436 cur = a;
1437 while ( (cur = cur.parentNode) ) {
1438 ap.unshift( cur );
1439 }
1440 cur = b;
1441 while ( (cur = cur.parentNode) ) {
1442 bp.unshift( cur );
1443 }
1444
1445 // Walk down the tree looking for a discrepancy
1446 while ( ap[i] === bp[i] ) {
1447 i++;
1448 }
1449
1450 return i ?
1451 // Do a sibling check if the nodes have a common ancestor
1452 siblingCheck( ap[i], bp[i] ) :
1453
1454 // Otherwise nodes in our document sort first
1455 ap[i] === preferredDoc ? -1 :
1456 bp[i] === preferredDoc ? 1 :
1457 0;
1458 };
1459
1460 return document;
1461 };
1462
1463 Sizzle.matches = function( expr, elements ) {
1464 return Sizzle( expr, null, null, elements );
1465 };
1466
1467 Sizzle.matchesSelector = function( elem, expr ) {
1468 // Set document vars if needed
1469 if ( ( elem.ownerDocument || elem ) !== document ) {
1470 setDocument( elem );
1471 }
1472
1473 // Make sure that attribute selectors are quoted
1474 expr = expr.replace( rattributeQuotes, "='$1']" );
1475
1476 if ( support.matchesSelector && documentIsHTML &&
1477 !compilerCache[ expr + " " ] &&
1478 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1479 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1480
1481 try {
1482 var ret = matches.call( elem, expr );
1483
1484 // IE 9's matchesSelector returns false on disconnected nodes
1485 if ( ret || support.disconnectedMatch ||
1486 // As well, disconnected nodes are said to be in a document
1487 // fragment in IE 9
1488 elem.document && elem.document.nodeType !== 11 ) {
1489 return ret;
1490 }
1491 } catch (e) {}
1492 }
1493
1494 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1495 };
1496
1497 Sizzle.contains = function( context, elem ) {
1498 // Set document vars if needed
1499 if ( ( context.ownerDocument || context ) !== document ) {
1500 setDocument( context );
1501 }
1502 return contains( context, elem );
1503 };
1504
1505 Sizzle.attr = function( elem, name ) {
1506 // Set document vars if needed
1507 if ( ( elem.ownerDocument || elem ) !== document ) {
1508 setDocument( elem );
1509 }
1510
1511 var fn = Expr.attrHandle[ name.toLowerCase() ],
1512 // Don't get fooled by Object.prototype properties (jQuery #13807)
1513 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1514 fn( elem, name, !documentIsHTML ) :
1515 undefined;
1516
1517 return val !== undefined ?
1518 val :
1519 support.attributes || !documentIsHTML ?
1520 elem.getAttribute( name ) :
1521 (val = elem.getAttributeNode(name)) && val.specified ?
1522 val.value :
1523 null;
1524 };
1525
1526 Sizzle.escape = function( sel ) {
1527 return (sel + "").replace( rcssescape, fcssescape );
1528 };
1529
1530 Sizzle.error = function( msg ) {
1531 throw new Error( "Syntax error, unrecognized expression: " + msg );
1532 };
1533
1534 /**
1535 * Document sorting and removing duplicates
1536 * @param {ArrayLike} results
1537 */
1538 Sizzle.uniqueSort = function( results ) {
1539 var elem,
1540 duplicates = [],
1541 j = 0,
1542 i = 0;
1543
1544 // Unless we *know* we can detect duplicates, assume their presence
1545 hasDuplicate = !support.detectDuplicates;
1546 sortInput = !support.sortStable && results.slice( 0 );
1547 results.sort( sortOrder );
1548
1549 if ( hasDuplicate ) {
1550 while ( (elem = results[i++]) ) {
1551 if ( elem === results[ i ] ) {
1552 j = duplicates.push( i );
1553 }
1554 }
1555 while ( j-- ) {
1556 results.splice( duplicates[ j ], 1 );
1557 }
1558 }
1559
1560 // Clear input after sorting to release objects
1561 // See https://github.com/jquery/sizzle/pull/225
1562 sortInput = null;
1563
1564 return results;
1565 };
1566
1567 /**
1568 * Utility function for retrieving the text value of an array of DOM nodes
1569 * @param {Array|Element} elem
1570 */
1571 getText = Sizzle.getText = function( elem ) {
1572 var node,
1573 ret = "",
1574 i = 0,
1575 nodeType = elem.nodeType;
1576
1577 if ( !nodeType ) {
1578 // If no nodeType, this is expected to be an array
1579 while ( (node = elem[i++]) ) {
1580 // Do not traverse comment nodes
1581 ret += getText( node );
1582 }
1583 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1584 // Use textContent for elements
1585 // innerText usage removed for consistency of new lines (jQuery #11153)
1586 if ( typeof elem.textContent === "string" ) {
1587 return elem.textContent;
1588 } else {
1589 // Traverse its children
1590 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1591 ret += getText( elem );
1592 }
1593 }
1594 } else if ( nodeType === 3 || nodeType === 4 ) {
1595 return elem.nodeValue;
1596 }
1597 // Do not include comment or processing instruction nodes
1598
1599 return ret;
1600 };
1601
1602 Expr = Sizzle.selectors = {
1603
1604 // Can be adjusted by the user
1605 cacheLength: 50,
1606
1607 createPseudo: markFunction,
1608
1609 match: matchExpr,
1610
1611 attrHandle: {},
1612
1613 find: {},
1614
1615 relative: {
1616 ">": { dir: "parentNode", first: true },
1617 " ": { dir: "parentNode" },
1618 "+": { dir: "previousSibling", first: true },
1619 "~": { dir: "previousSibling" }
1620 },
1621
1622 preFilter: {
1623 "ATTR": function( match ) {
1624 match[1] = match[1].replace( runescape, funescape );
1625
1626 // Move the given value to match[3] whether quoted or unquoted
1627 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1628
1629 if ( match[2] === "~=" ) {
1630 match[3] = " " + match[3] + " ";
1631 }
1632
1633 return match.slice( 0, 4 );
1634 },
1635
1636 "CHILD": function( match ) {
1637 /* matches from matchExpr["CHILD"]
1638 1 type (only|nth|...)
1639 2 what (child|of-type)
1640 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1641 4 xn-component of xn+y argument ([+-]?\d*n|)
1642 5 sign of xn-component
1643 6 x of xn-component
1644 7 sign of y-component
1645 8 y of y-component
1646 */
1647 match[1] = match[1].toLowerCase();
1648
1649 if ( match[1].slice( 0, 3 ) === "nth" ) {
1650 // nth-* requires argument
1651 if ( !match[3] ) {
1652 Sizzle.error( match[0] );
1653 }
1654
1655 // numeric x and y parameters for Expr.filter.CHILD
1656 // remember that false/true cast respectively to 0/1
1657 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1658 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1659
1660 // other types prohibit arguments
1661 } else if ( match[3] ) {
1662 Sizzle.error( match[0] );
1663 }
1664
1665 return match;
1666 },
1667
1668 "PSEUDO": function( match ) {
1669 var excess,
1670 unquoted = !match[6] && match[2];
1671
1672 if ( matchExpr["CHILD"].test( match[0] ) ) {
1673 return null;
1674 }
1675
1676 // Accept quoted arguments as-is
1677 if ( match[3] ) {
1678 match[2] = match[4] || match[5] || "";
1679
1680 // Strip excess characters from unquoted arguments
1681 } else if ( unquoted && rpseudo.test( unquoted ) &&
1682 // Get excess from tokenize (recursively)
1683 (excess = tokenize( unquoted, true )) &&
1684 // advance to the next closing parenthesis
1685 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1686
1687 // excess is a negative index
1688 match[0] = match[0].slice( 0, excess );
1689 match[2] = unquoted.slice( 0, excess );
1690 }
1691
1692 // Return only captures needed by the pseudo filter method (type and argument)
1693 return match.slice( 0, 3 );
1694 }
1695 },
1696
1697 filter: {
1698
1699 "TAG": function( nodeNameSelector ) {
1700 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1701 return nodeNameSelector === "*" ?
1702 function() { return true; } :
1703 function( elem ) {
1704 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1705 };
1706 },
1707
1708 "CLASS": function( className ) {
1709 var pattern = classCache[ className + " " ];
1710
1711 return pattern ||
1712 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1713 classCache( className, function( elem ) {
1714 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1715 });
1716 },
1717
1718 "ATTR": function( name, operator, check ) {
1719 return function( elem ) {
1720 var result = Sizzle.attr( elem, name );
1721
1722 if ( result == null ) {
1723 return operator === "!=";
1724 }
1725 if ( !operator ) {
1726 return true;
1727 }
1728
1729 result += "";
1730
1731 return operator === "=" ? result === check :
1732 operator === "!=" ? result !== check :
1733 operator === "^=" ? check && result.indexOf( check ) === 0 :
1734 operator === "*=" ? check && result.indexOf( check ) > -1 :
1735 operator === "$=" ? check && result.slice( -check.length ) === check :
1736 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1737 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1738 false;
1739 };
1740 },
1741
1742 "CHILD": function( type, what, argument, first, last ) {
1743 var simple = type.slice( 0, 3 ) !== "nth",
1744 forward = type.slice( -4 ) !== "last",
1745 ofType = what === "of-type";
1746
1747 return first === 1 && last === 0 ?
1748
1749 // Shortcut for :nth-*(n)
1750 function( elem ) {
1751 return !!elem.parentNode;
1752 } :
1753
1754 function( elem, context, xml ) {
1755 var cache, uniqueCache, outerCache, node, nodeIndex, start,
1756 dir = simple !== forward ? "nextSibling" : "previousSibling",
1757 parent = elem.parentNode,
1758 name = ofType && elem.nodeName.toLowerCase(),
1759 useCache = !xml && !ofType,
1760 diff = false;
1761
1762 if ( parent ) {
1763
1764 // :(first|last|only)-(child|of-type)
1765 if ( simple ) {
1766 while ( dir ) {
1767 node = elem;
1768 while ( (node = node[ dir ]) ) {
1769 if ( ofType ?
1770 node.nodeName.toLowerCase() === name :
1771 node.nodeType === 1 ) {
1772
1773 return false;
1774 }
1775 }
1776 // Reverse direction for :only-* (if we haven't yet done so)
1777 start = dir = type === "only" && !start && "nextSibling";
1778 }
1779 return true;
1780 }
1781
1782 start = [ forward ? parent.firstChild : parent.lastChild ];
1783
1784 // non-xml :nth-child(...) stores cache data on `parent`
1785 if ( forward && useCache ) {
1786
1787 // Seek `elem` from a previously-cached index
1788
1789 // ...in a gzip-friendly way
1790 node = parent;
1791 outerCache = node[ expando ] || (node[ expando ] = {});
1792
1793 // Support: IE <9 only
1794 // Defend against cloned attroperties (jQuery gh-1709)
1795 uniqueCache = outerCache[ node.uniqueID ] ||
1796 (outerCache[ node.uniqueID ] = {});
1797
1798 cache = uniqueCache[ type ] || [];
1799 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1800 diff = nodeIndex && cache[ 2 ];
1801 node = nodeIndex && parent.childNodes[ nodeIndex ];
1802
1803 while ( (node = ++nodeIndex && node && node[ dir ] ||
1804
1805 // Fallback to seeking `elem` from the start
1806 (diff = nodeIndex = 0) || start.pop()) ) {
1807
1808 // When found, cache indexes on `parent` and break
1809 if ( node.nodeType === 1 && ++diff && node === elem ) {
1810 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1811 break;
1812 }
1813 }
1814
1815 } else {
1816 // Use previously-cached element index if available
1817 if ( useCache ) {
1818 // ...in a gzip-friendly way
1819 node = elem;
1820 outerCache = node[ expando ] || (node[ expando ] = {});
1821
1822 // Support: IE <9 only
1823 // Defend against cloned attroperties (jQuery gh-1709)
1824 uniqueCache = outerCache[ node.uniqueID ] ||
1825 (outerCache[ node.uniqueID ] = {});
1826
1827 cache = uniqueCache[ type ] || [];
1828 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1829 diff = nodeIndex;
1830 }
1831
1832 // xml :nth-child(...)
1833 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1834 if ( diff === false ) {
1835 // Use the same loop as above to seek `elem` from the start
1836 while ( (node = ++nodeIndex && node && node[ dir ] ||
1837 (diff = nodeIndex = 0) || start.pop()) ) {
1838
1839 if ( ( ofType ?
1840 node.nodeName.toLowerCase() === name :
1841 node.nodeType === 1 ) &&
1842 ++diff ) {
1843
1844 // Cache the index of each encountered element
1845 if ( useCache ) {
1846 outerCache = node[ expando ] || (node[ expando ] = {});
1847
1848 // Support: IE <9 only
1849 // Defend against cloned attroperties (jQuery gh-1709)
1850 uniqueCache = outerCache[ node.uniqueID ] ||
1851 (outerCache[ node.uniqueID ] = {});
1852
1853 uniqueCache[ type ] = [ dirruns, diff ];
1854 }
1855
1856 if ( node === elem ) {
1857 break;
1858 }
1859 }
1860 }
1861 }
1862 }
1863
1864 // Incorporate the offset, then check against cycle size
1865 diff -= last;
1866 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1867 }
1868 };
1869 },
1870
1871 "PSEUDO": function( pseudo, argument ) {
1872 // pseudo-class names are case-insensitive
1873 // http://www.w3.org/TR/selectors/#pseudo-classes
1874 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1875 // Remember that setFilters inherits from pseudos
1876 var args,
1877 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1878 Sizzle.error( "unsupported pseudo: " + pseudo );
1879
1880 // The user may use createPseudo to indicate that
1881 // arguments are needed to create the filter function
1882 // just as Sizzle does
1883 if ( fn[ expando ] ) {
1884 return fn( argument );
1885 }
1886
1887 // But maintain support for old signatures
1888 if ( fn.length > 1 ) {
1889 args = [ pseudo, pseudo, "", argument ];
1890 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1891 markFunction(function( seed, matches ) {
1892 var idx,
1893 matched = fn( seed, argument ),
1894 i = matched.length;
1895 while ( i-- ) {
1896 idx = indexOf( seed, matched[i] );
1897 seed[ idx ] = !( matches[ idx ] = matched[i] );
1898 }
1899 }) :
1900 function( elem ) {
1901 return fn( elem, 0, args );
1902 };
1903 }
1904
1905 return fn;
1906 }
1907 },
1908
1909 pseudos: {
1910 // Potentially complex pseudos
1911 "not": markFunction(function( selector ) {
1912 // Trim the selector passed to compile
1913 // to avoid treating leading and trailing
1914 // spaces as combinators
1915 var input = [],
1916 results = [],
1917 matcher = compile( selector.replace( rtrim, "$1" ) );
1918
1919 return matcher[ expando ] ?
1920 markFunction(function( seed, matches, context, xml ) {
1921 var elem,
1922 unmatched = matcher( seed, null, xml, [] ),
1923 i = seed.length;
1924
1925 // Match elements unmatched by `matcher`
1926 while ( i-- ) {
1927 if ( (elem = unmatched[i]) ) {
1928 seed[i] = !(matches[i] = elem);
1929 }
1930 }
1931 }) :
1932 function( elem, context, xml ) {
1933 input[0] = elem;
1934 matcher( input, null, xml, results );
1935 // Don't keep the element (issue #299)
1936 input[0] = null;
1937 return !results.pop();
1938 };
1939 }),
1940
1941 "has": markFunction(function( selector ) {
1942 return function( elem ) {
1943 return Sizzle( selector, elem ).length > 0;
1944 };
1945 }),
1946
1947 "contains": markFunction(function( text ) {
1948 text = text.replace( runescape, funescape );
1949 return function( elem ) {
1950 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1951 };
1952 }),
1953
1954 // "Whether an element is represented by a :lang() selector
1955 // is based solely on the element's language value
1956 // being equal to the identifier C,
1957 // or beginning with the identifier C immediately followed by "-".
1958 // The matching of C against the element's language value is performed case-insensitively.
1959 // The identifier C does not have to be a valid language name."
1960 // http://www.w3.org/TR/selectors/#lang-pseudo
1961 "lang": markFunction( function( lang ) {
1962 // lang value must be a valid identifier
1963 if ( !ridentifier.test(lang || "") ) {
1964 Sizzle.error( "unsupported lang: " + lang );
1965 }
1966 lang = lang.replace( runescape, funescape ).toLowerCase();
1967 return function( elem ) {
1968 var elemLang;
1969 do {
1970 if ( (elemLang = documentIsHTML ?
1971 elem.lang :
1972 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1973
1974 elemLang = elemLang.toLowerCase();
1975 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1976 }
1977 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1978 return false;
1979 };
1980 }),
1981
1982 // Miscellaneous
1983 "target": function( elem ) {
1984 var hash = window.location && window.location.hash;
1985 return hash && hash.slice( 1 ) === elem.id;
1986 },
1987
1988 "root": function( elem ) {
1989 return elem === docElem;
1990 },
1991
1992 "focus": function( elem ) {
1993 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1994 },
1995
1996 // Boolean properties
1997 "enabled": createDisabledPseudo( false ),
1998 "disabled": createDisabledPseudo( true ),
1999
2000 "checked": function( elem ) {
2001 // In CSS3, :checked should return both checked and selected elements
2002 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2003 var nodeName = elem.nodeName.toLowerCase();
2004 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2005 },
2006
2007 "selected": function( elem ) {
2008 // Accessing this property makes selected-by-default
2009 // options in Safari work properly
2010 if ( elem.parentNode ) {
2011 elem.parentNode.selectedIndex;
2012 }
2013
2014 return elem.selected === true;
2015 },
2016
2017 // Contents
2018 "empty": function( elem ) {
2019 // http://www.w3.org/TR/selectors/#empty-pseudo
2020 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2021 // but not by others (comment: 8; processing instruction: 7; etc.)
2022 // nodeType < 6 works because attributes (2) do not appear as children
2023 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2024 if ( elem.nodeType < 6 ) {
2025 return false;
2026 }
2027 }
2028 return true;
2029 },
2030
2031 "parent": function( elem ) {
2032 return !Expr.pseudos["empty"]( elem );
2033 },
2034
2035 // Element/input types
2036 "header": function( elem ) {
2037 return rheader.test( elem.nodeName );
2038 },
2039
2040 "input": function( elem ) {
2041 return rinputs.test( elem.nodeName );
2042 },
2043
2044 "button": function( elem ) {
2045 var name = elem.nodeName.toLowerCase();
2046 return name === "input" && elem.type === "button" || name === "button";
2047 },
2048
2049 "text": function( elem ) {
2050 var attr;
2051 return elem.nodeName.toLowerCase() === "input" &&
2052 elem.type === "text" &&
2053
2054 // Support: IE<8
2055 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2056 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2057 },
2058
2059 // Position-in-collection
2060 "first": createPositionalPseudo(function() {
2061 return [ 0 ];
2062 }),
2063
2064 "last": createPositionalPseudo(function( matchIndexes, length ) {
2065 return [ length - 1 ];
2066 }),
2067
2068 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2069 return [ argument < 0 ? argument + length : argument ];
2070 }),
2071
2072 "even": createPositionalPseudo(function( matchIndexes, length ) {
2073 var i = 0;
2074 for ( ; i < length; i += 2 ) {
2075 matchIndexes.push( i );
2076 }
2077 return matchIndexes;
2078 }),
2079
2080 "odd": createPositionalPseudo(function( matchIndexes, length ) {
2081 var i = 1;
2082 for ( ; i < length; i += 2 ) {
2083 matchIndexes.push( i );
2084 }
2085 return matchIndexes;
2086 }),
2087
2088 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2089 var i = argument < 0 ? argument + length : argument;
2090 for ( ; --i >= 0; ) {
2091 matchIndexes.push( i );
2092 }
2093 return matchIndexes;
2094 }),
2095
2096 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2097 var i = argument < 0 ? argument + length : argument;
2098 for ( ; ++i < length; ) {
2099 matchIndexes.push( i );
2100 }
2101 return matchIndexes;
2102 })
2103 }
2104 };
2105
2106 Expr.pseudos["nth"] = Expr.pseudos["eq"];
2107
2108 // Add button/input type pseudos
2109 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2110 Expr.pseudos[ i ] = createInputPseudo( i );
2111 }
2112 for ( i in { submit: true, reset: true } ) {
2113 Expr.pseudos[ i ] = createButtonPseudo( i );
2114 }
2115
2116 // Easy API for creating new setFilters
2117 function setFilters() {}
2118 setFilters.prototype = Expr.filters = Expr.pseudos;
2119 Expr.setFilters = new setFilters();
2120
2121 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2122 var matched, match, tokens, type,
2123 soFar, groups, preFilters,
2124 cached = tokenCache[ selector + " " ];
2125
2126 if ( cached ) {
2127 return parseOnly ? 0 : cached.slice( 0 );
2128 }
2129
2130 soFar = selector;
2131 groups = [];
2132 preFilters = Expr.preFilter;
2133
2134 while ( soFar ) {
2135
2136 // Comma and first run
2137 if ( !matched || (match = rcomma.exec( soFar )) ) {
2138 if ( match ) {
2139 // Don't consume trailing commas as valid
2140 soFar = soFar.slice( match[0].length ) || soFar;
2141 }
2142 groups.push( (tokens = []) );
2143 }
2144
2145 matched = false;
2146
2147 // Combinators
2148 if ( (match = rcombinators.exec( soFar )) ) {
2149 matched = match.shift();
2150 tokens.push({
2151 value: matched,
2152 // Cast descendant combinators to space
2153 type: match[0].replace( rtrim, " " )
2154 });
2155 soFar = soFar.slice( matched.length );
2156 }
2157
2158 // Filters
2159 for ( type in Expr.filter ) {
2160 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2161 (match = preFilters[ type ]( match ))) ) {
2162 matched = match.shift();
2163 tokens.push({
2164 value: matched,
2165 type: type,
2166 matches: match
2167 });
2168 soFar = soFar.slice( matched.length );
2169 }
2170 }
2171
2172 if ( !matched ) {
2173 break;
2174 }
2175 }
2176
2177 // Return the length of the invalid excess
2178 // if we're just parsing
2179 // Otherwise, throw an error or return tokens
2180 return parseOnly ?
2181 soFar.length :
2182 soFar ?
2183 Sizzle.error( selector ) :
2184 // Cache the tokens
2185 tokenCache( selector, groups ).slice( 0 );
2186 };
2187
2188 function toSelector( tokens ) {
2189 var i = 0,
2190 len = tokens.length,
2191 selector = "";
2192 for ( ; i < len; i++ ) {
2193 selector += tokens[i].value;
2194 }
2195 return selector;
2196 }
2197
2198 function addCombinator( matcher, combinator, base ) {
2199 var dir = combinator.dir,
2200 skip = combinator.next,
2201 key = skip || dir,
2202 checkNonElements = base && key === "parentNode",
2203 doneName = done++;
2204
2205 return combinator.first ?
2206 // Check against closest ancestor/preceding element
2207 function( elem, context, xml ) {
2208 while ( (elem = elem[ dir ]) ) {
2209 if ( elem.nodeType === 1 || checkNonElements ) {
2210 return matcher( elem, context, xml );
2211 }
2212 }
2213 } :
2214
2215 // Check against all ancestor/preceding elements
2216 function( elem, context, xml ) {
2217 var oldCache, uniqueCache, outerCache,
2218 newCache = [ dirruns, doneName ];
2219
2220 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2221 if ( xml ) {
2222 while ( (elem = elem[ dir ]) ) {
2223 if ( elem.nodeType === 1 || checkNonElements ) {
2224 if ( matcher( elem, context, xml ) ) {
2225 return true;
2226 }
2227 }
2228 }
2229 } else {
2230 while ( (elem = elem[ dir ]) ) {
2231 if ( elem.nodeType === 1 || checkNonElements ) {
2232 outerCache = elem[ expando ] || (elem[ expando ] = {});
2233
2234 // Support: IE <9 only
2235 // Defend against cloned attroperties (jQuery gh-1709)
2236 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2237
2238 if ( skip && skip === elem.nodeName.toLowerCase() ) {
2239 elem = elem[ dir ] || elem;
2240 } else if ( (oldCache = uniqueCache[ key ]) &&
2241 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2242
2243 // Assign to newCache so results back-propagate to previous elements
2244 return (newCache[ 2 ] = oldCache[ 2 ]);
2245 } else {
2246 // Reuse newcache so results back-propagate to previous elements
2247 uniqueCache[ key ] = newCache;
2248
2249 // A match means we're done; a fail means we have to keep checking
2250 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2251 return true;
2252 }
2253 }
2254 }
2255 }
2256 }
2257 };
2258 }
2259
2260 function elementMatcher( matchers ) {
2261 return matchers.length > 1 ?
2262 function( elem, context, xml ) {
2263 var i = matchers.length;
2264 while ( i-- ) {
2265 if ( !matchers[i]( elem, context, xml ) ) {
2266 return false;
2267 }
2268 }
2269 return true;
2270 } :
2271 matchers[0];
2272 }
2273
2274 function multipleContexts( selector, contexts, results ) {
2275 var i = 0,
2276 len = contexts.length;
2277 for ( ; i < len; i++ ) {
2278 Sizzle( selector, contexts[i], results );
2279 }
2280 return results;
2281 }
2282
2283 function condense( unmatched, map, filter, context, xml ) {
2284 var elem,
2285 newUnmatched = [],
2286 i = 0,
2287 len = unmatched.length,
2288 mapped = map != null;
2289
2290 for ( ; i < len; i++ ) {
2291 if ( (elem = unmatched[i]) ) {
2292 if ( !filter || filter( elem, context, xml ) ) {
2293 newUnmatched.push( elem );
2294 if ( mapped ) {
2295 map.push( i );
2296 }
2297 }
2298 }
2299 }
2300
2301 return newUnmatched;
2302 }
2303
2304 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2305 if ( postFilter && !postFilter[ expando ] ) {
2306 postFilter = setMatcher( postFilter );
2307 }
2308 if ( postFinder && !postFinder[ expando ] ) {
2309 postFinder = setMatcher( postFinder, postSelector );
2310 }
2311 return markFunction(function( seed, results, context, xml ) {
2312 var temp, i, elem,
2313 preMap = [],
2314 postMap = [],
2315 preexisting = results.length,
2316
2317 // Get initial elements from seed or context
2318 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2319
2320 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2321 matcherIn = preFilter && ( seed || !selector ) ?
2322 condense( elems, preMap, preFilter, context, xml ) :
2323 elems,
2324
2325 matcherOut = matcher ?
2326 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2327 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2328
2329 // ...intermediate processing is necessary
2330 [] :
2331
2332 // ...otherwise use results directly
2333 results :
2334 matcherIn;
2335
2336 // Find primary matches
2337 if ( matcher ) {
2338 matcher( matcherIn, matcherOut, context, xml );
2339 }
2340
2341 // Apply postFilter
2342 if ( postFilter ) {
2343 temp = condense( matcherOut, postMap );
2344 postFilter( temp, [], context, xml );
2345
2346 // Un-match failing elements by moving them back to matcherIn
2347 i = temp.length;
2348 while ( i-- ) {
2349 if ( (elem = temp[i]) ) {
2350 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2351 }
2352 }
2353 }
2354
2355 if ( seed ) {
2356 if ( postFinder || preFilter ) {
2357 if ( postFinder ) {
2358 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2359 temp = [];
2360 i = matcherOut.length;
2361 while ( i-- ) {
2362 if ( (elem = matcherOut[i]) ) {
2363 // Restore matcherIn since elem is not yet a final match
2364 temp.push( (matcherIn[i] = elem) );
2365 }
2366 }
2367 postFinder( null, (matcherOut = []), temp, xml );
2368 }
2369
2370 // Move matched elements from seed to results to keep them synchronized
2371 i = matcherOut.length;
2372 while ( i-- ) {
2373 if ( (elem = matcherOut[i]) &&
2374 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2375
2376 seed[temp] = !(results[temp] = elem);
2377 }
2378 }
2379 }
2380
2381 // Add elements to results, through postFinder if defined
2382 } else {
2383 matcherOut = condense(
2384 matcherOut === results ?
2385 matcherOut.splice( preexisting, matcherOut.length ) :
2386 matcherOut
2387 );
2388 if ( postFinder ) {
2389 postFinder( null, results, matcherOut, xml );
2390 } else {
2391 push.apply( results, matcherOut );
2392 }
2393 }
2394 });
2395 }
2396
2397 function matcherFromTokens( tokens ) {
2398 var checkContext, matcher, j,
2399 len = tokens.length,
2400 leadingRelative = Expr.relative[ tokens[0].type ],
2401 implicitRelative = leadingRelative || Expr.relative[" "],
2402 i = leadingRelative ? 1 : 0,
2403
2404 // The foundational matcher ensures that elements are reachable from top-level context(s)
2405 matchContext = addCombinator( function( elem ) {
2406 return elem === checkContext;
2407 }, implicitRelative, true ),
2408 matchAnyContext = addCombinator( function( elem ) {
2409 return indexOf( checkContext, elem ) > -1;
2410 }, implicitRelative, true ),
2411 matchers = [ function( elem, context, xml ) {
2412 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2413 (checkContext = context).nodeType ?
2414 matchContext( elem, context, xml ) :
2415 matchAnyContext( elem, context, xml ) );
2416 // Avoid hanging onto element (issue #299)
2417 checkContext = null;
2418 return ret;
2419 } ];
2420
2421 for ( ; i < len; i++ ) {
2422 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2423 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2424 } else {
2425 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2426
2427 // Return special upon seeing a positional matcher
2428 if ( matcher[ expando ] ) {
2429 // Find the next relative operator (if any) for proper handling
2430 j = ++i;
2431 for ( ; j < len; j++ ) {
2432 if ( Expr.relative[ tokens[j].type ] ) {
2433 break;
2434 }
2435 }
2436 return setMatcher(
2437 i > 1 && elementMatcher( matchers ),
2438 i > 1 && toSelector(
2439 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2440 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2441 ).replace( rtrim, "$1" ),
2442 matcher,
2443 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2444 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2445 j < len && toSelector( tokens )
2446 );
2447 }
2448 matchers.push( matcher );
2449 }
2450 }
2451
2452 return elementMatcher( matchers );
2453 }
2454
2455 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2456 var bySet = setMatchers.length > 0,
2457 byElement = elementMatchers.length > 0,
2458 superMatcher = function( seed, context, xml, results, outermost ) {
2459 var elem, j, matcher,
2460 matchedCount = 0,
2461 i = "0",
2462 unmatched = seed && [],
2463 setMatched = [],
2464 contextBackup = outermostContext,
2465 // We must always have either seed elements or outermost context
2466 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2467 // Use integer dirruns iff this is the outermost matcher
2468 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2469 len = elems.length;
2470
2471 if ( outermost ) {
2472 outermostContext = context === document || context || outermost;
2473 }
2474
2475 // Add elements passing elementMatchers directly to results
2476 // Support: IE<9, Safari
2477 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2478 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2479 if ( byElement && elem ) {
2480 j = 0;
2481 if ( !context && elem.ownerDocument !== document ) {
2482 setDocument( elem );
2483 xml = !documentIsHTML;
2484 }
2485 while ( (matcher = elementMatchers[j++]) ) {
2486 if ( matcher( elem, context || document, xml) ) {
2487 results.push( elem );
2488 break;
2489 }
2490 }
2491 if ( outermost ) {
2492 dirruns = dirrunsUnique;
2493 }
2494 }
2495
2496 // Track unmatched elements for set filters
2497 if ( bySet ) {
2498 // They will have gone through all possible matchers
2499 if ( (elem = !matcher && elem) ) {
2500 matchedCount--;
2501 }
2502
2503 // Lengthen the array for every element, matched or not
2504 if ( seed ) {
2505 unmatched.push( elem );
2506 }
2507 }
2508 }
2509
2510 // `i` is now the count of elements visited above, and adding it to `matchedCount`
2511 // makes the latter nonnegative.
2512 matchedCount += i;
2513
2514 // Apply set filters to unmatched elements
2515 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2516 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2517 // no element matchers and no seed.
2518 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2519 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
2520 // numerically zero.
2521 if ( bySet && i !== matchedCount ) {
2522 j = 0;
2523 while ( (matcher = setMatchers[j++]) ) {
2524 matcher( unmatched, setMatched, context, xml );
2525 }
2526
2527 if ( seed ) {
2528 // Reintegrate element matches to eliminate the need for sorting
2529 if ( matchedCount > 0 ) {
2530 while ( i-- ) {
2531 if ( !(unmatched[i] || setMatched[i]) ) {
2532 setMatched[i] = pop.call( results );
2533 }
2534 }
2535 }
2536
2537 // Discard index placeholder values to get only actual matches
2538 setMatched = condense( setMatched );
2539 }
2540
2541 // Add matches to results
2542 push.apply( results, setMatched );
2543
2544 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2545 if ( outermost && !seed && setMatched.length > 0 &&
2546 ( matchedCount + setMatchers.length ) > 1 ) {
2547
2548 Sizzle.uniqueSort( results );
2549 }
2550 }
2551
2552 // Override manipulation of globals by nested matchers
2553 if ( outermost ) {
2554 dirruns = dirrunsUnique;
2555 outermostContext = contextBackup;
2556 }
2557
2558 return unmatched;
2559 };
2560
2561 return bySet ?
2562 markFunction( superMatcher ) :
2563 superMatcher;
2564 }
2565
2566 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2567 var i,
2568 setMatchers = [],
2569 elementMatchers = [],
2570 cached = compilerCache[ selector + " " ];
2571
2572 if ( !cached ) {
2573 // Generate a function of recursive functions that can be used to check each element
2574 if ( !match ) {
2575 match = tokenize( selector );
2576 }
2577 i = match.length;
2578 while ( i-- ) {
2579 cached = matcherFromTokens( match[i] );
2580 if ( cached[ expando ] ) {
2581 setMatchers.push( cached );
2582 } else {
2583 elementMatchers.push( cached );
2584 }
2585 }
2586
2587 // Cache the compiled function
2588 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2589
2590 // Save selector and tokenization
2591 cached.selector = selector;
2592 }
2593 return cached;
2594 };
2595
2596 /**
2597 * A low-level selection function that works with Sizzle's compiled
2598 * selector functions
2599 * @param {String|Function} selector A selector or a pre-compiled
2600 * selector function built with Sizzle.compile
2601 * @param {Element} context
2602 * @param {Array} [results]
2603 * @param {Array} [seed] A set of elements to match against
2604 */
2605 select = Sizzle.select = function( selector, context, results, seed ) {
2606 var i, tokens, token, type, find,
2607 compiled = typeof selector === "function" && selector,
2608 match = !seed && tokenize( (selector = compiled.selector || selector) );
2609
2610 results = results || [];
2611
2612 // Try to minimize operations if there is only one selector in the list and no seed
2613 // (the latter of which guarantees us context)
2614 if ( match.length === 1 ) {
2615
2616 // Reduce context if the leading compound selector is an ID
2617 tokens = match[0] = match[0].slice( 0 );
2618 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2619 support.getById && context.nodeType === 9 && documentIsHTML &&
2620 Expr.relative[ tokens[1].type ] ) {
2621
2622 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2623 if ( !context ) {
2624 return results;
2625
2626 // Precompiled matchers will still verify ancestry, so step up a level
2627 } else if ( compiled ) {
2628 context = context.parentNode;
2629 }
2630
2631 selector = selector.slice( tokens.shift().value.length );
2632 }
2633
2634 // Fetch a seed set for right-to-left matching
2635 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2636 while ( i-- ) {
2637 token = tokens[i];
2638
2639 // Abort if we hit a combinator
2640 if ( Expr.relative[ (type = token.type) ] ) {
2641 break;
2642 }
2643 if ( (find = Expr.find[ type ]) ) {
2644 // Search, expanding context for leading sibling combinators
2645 if ( (seed = find(
2646 token.matches[0].replace( runescape, funescape ),
2647 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2648 )) ) {
2649
2650 // If seed is empty or no tokens remain, we can return early
2651 tokens.splice( i, 1 );
2652 selector = seed.length && toSelector( tokens );
2653 if ( !selector ) {
2654 push.apply( results, seed );
2655 return results;
2656 }
2657
2658 break;
2659 }
2660 }
2661 }
2662 }
2663
2664 // Compile and execute a filtering function if one is not provided
2665 // Provide `match` to avoid retokenization if we modified the selector above
2666 ( compiled || compile( selector, match ) )(
2667 seed,
2668 context,
2669 !documentIsHTML,
2670 results,
2671 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2672 );
2673 return results;
2674 };
2675
2676 // One-time assignments
2677
2678 // Sort stability
2679 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2680
2681 // Support: Chrome 14-35+
2682 // Always assume duplicates if they aren't passed to the comparison function
2683 support.detectDuplicates = !!hasDuplicate;
2684
2685 // Initialize against the default document
2686 setDocument();
2687
2688 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2689 // Detached nodes confoundingly follow *each other*
2690 support.sortDetached = assert(function( el ) {
2691 // Should return 1, but returns 4 (following)
2692 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
2693 });
2694
2695 // Support: IE<8
2696 // Prevent attribute/property "interpolation"
2697 // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2698 if ( !assert(function( el ) {
2699 el.innerHTML = "<a href='#'></a>";
2700 return el.firstChild.getAttribute("href") === "#" ;
2701 }) ) {
2702 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2703 if ( !isXML ) {
2704 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2705 }
2706 });
2707 }
2708
2709 // Support: IE<9
2710 // Use defaultValue in place of getAttribute("value")
2711 if ( !support.attributes || !assert(function( el ) {
2712 el.innerHTML = "<input/>";
2713 el.firstChild.setAttribute( "value", "" );
2714 return el.firstChild.getAttribute( "value" ) === "";
2715 }) ) {
2716 addHandle( "value", function( elem, name, isXML ) {
2717 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2718 return elem.defaultValue;
2719 }
2720 });
2721 }
2722
2723 // Support: IE<9
2724 // Use getAttributeNode to fetch booleans when getAttribute lies
2725 if ( !assert(function( el ) {
2726 return el.getAttribute("disabled") == null;
2727 }) ) {
2728 addHandle( booleans, function( elem, name, isXML ) {
2729 var val;
2730 if ( !isXML ) {
2731 return elem[ name ] === true ? name.toLowerCase() :
2732 (val = elem.getAttributeNode( name )) && val.specified ?
2733 val.value :
2734 null;
2735 }
2736 });
2737 }
2738
2739 return Sizzle;
2740
2741 })( window );
2742
2743
2744
2745 jQuery.find = Sizzle;
2746 jQuery.expr = Sizzle.selectors;
2747
2748 // Deprecated
2749 jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2750 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2751 jQuery.text = Sizzle.getText;
2752 jQuery.isXMLDoc = Sizzle.isXML;
2753 jQuery.contains = Sizzle.contains;
2754 jQuery.escapeSelector = Sizzle.escape;
2755
2756
2757
2758
2759 var dir = function( elem, dir, until ) {
2760 var matched = [],
2761 truncate = until !== undefined;
2762
2763 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2764 if ( elem.nodeType === 1 ) {
2765 if ( truncate && jQuery( elem ).is( until ) ) {
2766 break;
2767 }
2768 matched.push( elem );
2769 }
2770 }
2771 return matched;
2772 };
2773
2774
2775 var siblings = function( n, elem ) {
2776 var matched = [];
2777
2778 for ( ; n; n = n.nextSibling ) {
2779 if ( n.nodeType === 1 && n !== elem ) {
2780 matched.push( n );
2781 }
2782 }
2783
2784 return matched;
2785 };
2786
2787
2788 var rneedsContext = jQuery.expr.match.needsContext;
2789
2790 var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
2791
2792
2793
2794 var risSimple = /^.[^:#\[\.,]*$/;
2795
2796 // Implement the identical functionality for filter and not
2797 function winnow( elements, qualifier, not ) {
2798 if ( jQuery.isFunction( qualifier ) ) {
2799 return jQuery.grep( elements, function( elem, i ) {
2800 return !!qualifier.call( elem, i, elem ) !== not;
2801 } );
2802
2803 }
2804
2805 if ( qualifier.nodeType ) {
2806 return jQuery.grep( elements, function( elem ) {
2807 return ( elem === qualifier ) !== not;
2808 } );
2809
2810 }
2811
2812 if ( typeof qualifier === "string" ) {
2813 if ( risSimple.test( qualifier ) ) {
2814 return jQuery.filter( qualifier, elements, not );
2815 }
2816
2817 qualifier = jQuery.filter( qualifier, elements );
2818 }
2819
2820 return jQuery.grep( elements, function( elem ) {
2821 return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
2822 } );
2823 }
2824
2825 jQuery.filter = function( expr, elems, not ) {
2826 var elem = elems[ 0 ];
2827
2828 if ( not ) {
2829 expr = ":not(" + expr + ")";
2830 }
2831
2832 return elems.length === 1 && elem.nodeType === 1 ?
2833 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2834 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2835 return elem.nodeType === 1;
2836 } ) );
2837 };
2838
2839 jQuery.fn.extend( {
2840 find: function( selector ) {
2841 var i, ret,
2842 len = this.length,
2843 self = this;
2844
2845 if ( typeof selector !== "string" ) {
2846 return this.pushStack( jQuery( selector ).filter( function() {
2847 for ( i = 0; i < len; i++ ) {
2848 if ( jQuery.contains( self[ i ], this ) ) {
2849 return true;
2850 }
2851 }
2852 } ) );
2853 }
2854
2855 ret = this.pushStack( [] );
2856
2857 for ( i = 0; i < len; i++ ) {
2858 jQuery.find( selector, self[ i ], ret );
2859 }
2860
2861 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
2862 },
2863 filter: function( selector ) {
2864 return this.pushStack( winnow( this, selector || [], false ) );
2865 },
2866 not: function( selector ) {
2867 return this.pushStack( winnow( this, selector || [], true ) );
2868 },
2869 is: function( selector ) {
2870 return !!winnow(
2871 this,
2872
2873 // If this is a positional/relative selector, check membership in the returned set
2874 // so $("p:first").is("p:last") won't return true for a doc with two "p".
2875 typeof selector === "string" && rneedsContext.test( selector ) ?
2876 jQuery( selector ) :
2877 selector || [],
2878 false
2879 ).length;
2880 }
2881 } );
2882
2883
2884 // Initialize a jQuery object
2885
2886
2887 // A central reference to the root jQuery(document)
2888 var rootjQuery,
2889
2890 // A simple way to check for HTML strings
2891 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2892 // Strict HTML recognition (#11290: must start with <)
2893 // Shortcut simple #id case for speed
2894 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
2895
2896 init = jQuery.fn.init = function( selector, context, root ) {
2897 var match, elem;
2898
2899 // HANDLE: $(""), $(null), $(undefined), $(false)
2900 if ( !selector ) {
2901 return this;
2902 }
2903
2904 // Method init() accepts an alternate rootjQuery
2905 // so migrate can support jQuery.sub (gh-2101)
2906 root = root || rootjQuery;
2907
2908 // Handle HTML strings
2909 if ( typeof selector === "string" ) {
2910 if ( selector[ 0 ] === "<" &&
2911 selector[ selector.length - 1 ] === ">" &&
2912 selector.length >= 3 ) {
2913
2914 // Assume that strings that start and end with <> are HTML and skip the regex check
2915 match = [ null, selector, null ];
2916
2917 } else {
2918 match = rquickExpr.exec( selector );
2919 }
2920
2921 // Match html or make sure no context is specified for #id
2922 if ( match && ( match[ 1 ] || !context ) ) {
2923
2924 // HANDLE: $(html) -> $(array)
2925 if ( match[ 1 ] ) {
2926 context = context instanceof jQuery ? context[ 0 ] : context;
2927
2928 // Option to run scripts is true for back-compat
2929 // Intentionally let the error be thrown if parseHTML is not present
2930 jQuery.merge( this, jQuery.parseHTML(
2931 match[ 1 ],
2932 context && context.nodeType ? context.ownerDocument || context : document,
2933 true
2934 ) );
2935
2936 // HANDLE: $(html, props)
2937 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
2938 for ( match in context ) {
2939
2940 // Properties of context are called as methods if possible
2941 if ( jQuery.isFunction( this[ match ] ) ) {
2942 this[ match ]( context[ match ] );
2943
2944 // ...and otherwise set as attributes
2945 } else {
2946 this.attr( match, context[ match ] );
2947 }
2948 }
2949 }
2950
2951 return this;
2952
2953 // HANDLE: $(#id)
2954 } else {
2955 elem = document.getElementById( match[ 2 ] );
2956
2957 if ( elem ) {
2958
2959 // Inject the element directly into the jQuery object
2960 this[ 0 ] = elem;
2961 this.length = 1;
2962 }
2963 return this;
2964 }
2965
2966 // HANDLE: $(expr, $(...))
2967 } else if ( !context || context.jquery ) {
2968 return ( context || root ).find( selector );
2969
2970 // HANDLE: $(expr, context)
2971 // (which is just equivalent to: $(context).find(expr)
2972 } else {
2973 return this.constructor( context ).find( selector );
2974 }
2975
2976 // HANDLE: $(DOMElement)
2977 } else if ( selector.nodeType ) {
2978 this[ 0 ] = selector;
2979 this.length = 1;
2980 return this;
2981
2982 // HANDLE: $(function)
2983 // Shortcut for document ready
2984 } else if ( jQuery.isFunction( selector ) ) {
2985 return root.ready !== undefined ?
2986 root.ready( selector ) :
2987
2988 // Execute immediately if ready is not present
2989 selector( jQuery );
2990 }
2991
2992 return jQuery.makeArray( selector, this );
2993 };
2994
2995 // Give the init function the jQuery prototype for later instantiation
2996 init.prototype = jQuery.fn;
2997
2998 // Initialize central reference
2999 rootjQuery = jQuery( document );
3000
3001
3002 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3003
3004 // Methods guaranteed to produce a unique set when starting from a unique set
3005 guaranteedUnique = {
3006 children: true,
3007 contents: true,
3008 next: true,
3009 prev: true
3010 };
3011
3012 jQuery.fn.extend( {
3013 has: function( target ) {
3014 var targets = jQuery( target, this ),
3015 l = targets.length;
3016
3017 return this.filter( function() {
3018 var i = 0;
3019 for ( ; i < l; i++ ) {
3020 if ( jQuery.contains( this, targets[ i ] ) ) {
3021 return true;
3022 }
3023 }
3024 } );
3025 },
3026
3027 closest: function( selectors, context ) {
3028 var cur,
3029 i = 0,
3030 l = this.length,
3031 matched = [],
3032 targets = typeof selectors !== "string" && jQuery( selectors );
3033
3034 // Positional selectors never match, since there's no _selection_ context
3035 if ( !rneedsContext.test( selectors ) ) {
3036 for ( ; i < l; i++ ) {
3037 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3038
3039 // Always skip document fragments
3040 if ( cur.nodeType < 11 && ( targets ?
3041 targets.index( cur ) > -1 :
3042
3043 // Don't pass non-elements to Sizzle
3044 cur.nodeType === 1 &&
3045 jQuery.find.matchesSelector( cur, selectors ) ) ) {
3046
3047 matched.push( cur );
3048 break;
3049 }
3050 }
3051 }
3052 }
3053
3054 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3055 },
3056
3057 // Determine the position of an element within the set
3058 index: function( elem ) {
3059
3060 // No argument, return index in parent
3061 if ( !elem ) {
3062 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3063 }
3064
3065 // Index in selector
3066 if ( typeof elem === "string" ) {
3067 return indexOf.call( jQuery( elem ), this[ 0 ] );
3068 }
3069
3070 // Locate the position of the desired element
3071 return indexOf.call( this,
3072
3073 // If it receives a jQuery object, the first element is used
3074 elem.jquery ? elem[ 0 ] : elem
3075 );
3076 },
3077
3078 add: function( selector, context ) {
3079 return this.pushStack(
3080 jQuery.uniqueSort(
3081 jQuery.merge( this.get(), jQuery( selector, context ) )
3082 )
3083 );
3084 },
3085
3086 addBack: function( selector ) {
3087 return this.add( selector == null ?
3088 this.prevObject : this.prevObject.filter( selector )
3089 );
3090 }
3091 } );
3092
3093 function sibling( cur, dir ) {
3094 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3095 return cur;
3096 }
3097
3098 jQuery.each( {
3099 parent: function( elem ) {
3100 var parent = elem.parentNode;
3101 return parent && parent.nodeType !== 11 ? parent : null;
3102 },
3103 parents: function( elem ) {
3104 return dir( elem, "parentNode" );
3105 },
3106 parentsUntil: function( elem, i, until ) {
3107 return dir( elem, "parentNode", until );
3108 },
3109 next: function( elem ) {
3110 return sibling( elem, "nextSibling" );
3111 },
3112 prev: function( elem ) {
3113 return sibling( elem, "previousSibling" );
3114 },
3115 nextAll: function( elem ) {
3116 return dir( elem, "nextSibling" );
3117 },
3118 prevAll: function( elem ) {
3119 return dir( elem, "previousSibling" );
3120 },
3121 nextUntil: function( elem, i, until ) {
3122 return dir( elem, "nextSibling", until );
3123 },
3124 prevUntil: function( elem, i, until ) {
3125 return dir( elem, "previousSibling", until );
3126 },
3127 siblings: function( elem ) {
3128 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3129 },
3130 children: function( elem ) {
3131 return siblings( elem.firstChild );
3132 },
3133 contents: function( elem ) {
3134 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
3135 }
3136 }, function( name, fn ) {
3137 jQuery.fn[ name ] = function( until, selector ) {
3138 var matched = jQuery.map( this, fn, until );
3139
3140 if ( name.slice( -5 ) !== "Until" ) {
3141 selector = until;
3142 }
3143
3144 if ( selector && typeof selector === "string" ) {
3145 matched = jQuery.filter( selector, matched );
3146 }
3147
3148 if ( this.length > 1 ) {
3149
3150 // Remove duplicates
3151 if ( !guaranteedUnique[ name ] ) {
3152 jQuery.uniqueSort( matched );
3153 }
3154
3155 // Reverse order for parents* and prev-derivatives
3156 if ( rparentsprev.test( name ) ) {
3157 matched.reverse();
3158 }
3159 }
3160
3161 return this.pushStack( matched );
3162 };
3163 } );
3164 var rnotwhite = ( /\S+/g );
3165
3166
3167
3168 // Convert String-formatted options into Object-formatted ones
3169 function createOptions( options ) {
3170 var object = {};
3171 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3172 object[ flag ] = true;
3173 } );
3174 return object;
3175 }
3176
3177 /*
3178 * Create a callback list using the following parameters:
3179 *
3180 * options: an optional list of space-separated options that will change how
3181 * the callback list behaves or a more traditional option object
3182 *
3183 * By default a callback list will act like an event callback list and can be
3184 * "fired" multiple times.
3185 *
3186 * Possible options:
3187 *
3188 * once: will ensure the callback list can only be fired once (like a Deferred)
3189 *
3190 * memory: will keep track of previous values and will call any callback added
3191 * after the list has been fired right away with the latest "memorized"
3192 * values (like a Deferred)
3193 *
3194 * unique: will ensure a callback can only be added once (no duplicate in the list)
3195 *
3196 * stopOnFalse: interrupt callings when a callback returns false
3197 *
3198 */
3199 jQuery.Callbacks = function( options ) {
3200
3201 // Convert options from String-formatted to Object-formatted if needed
3202 // (we check in cache first)
3203 options = typeof options === "string" ?
3204 createOptions( options ) :
3205 jQuery.extend( {}, options );
3206
3207 var // Flag to know if list is currently firing
3208 firing,
3209
3210 // Last fire value for non-forgettable lists
3211 memory,
3212
3213 // Flag to know if list was already fired
3214 fired,
3215
3216 // Flag to prevent firing
3217 locked,
3218
3219 // Actual callback list
3220 list = [],
3221
3222 // Queue of execution data for repeatable lists
3223 queue = [],
3224
3225 // Index of currently firing callback (modified by add/remove as needed)
3226 firingIndex = -1,
3227
3228 // Fire callbacks
3229 fire = function() {
3230
3231 // Enforce single-firing
3232 locked = options.once;
3233
3234 // Execute callbacks for all pending executions,
3235 // respecting firingIndex overrides and runtime changes
3236 fired = firing = true;
3237 for ( ; queue.length; firingIndex = -1 ) {
3238 memory = queue.shift();
3239 while ( ++firingIndex < list.length ) {
3240
3241 // Run callback and check for early termination
3242 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3243 options.stopOnFalse ) {
3244
3245 // Jump to end and forget the data so .add doesn't re-fire
3246 firingIndex = list.length;
3247 memory = false;
3248 }
3249 }
3250 }
3251
3252 // Forget the data if we're done with it
3253 if ( !options.memory ) {
3254 memory = false;
3255 }
3256
3257 firing = false;
3258
3259 // Clean up if we're done firing for good
3260 if ( locked ) {
3261
3262 // Keep an empty list if we have data for future add calls
3263 if ( memory ) {
3264 list = [];
3265
3266 // Otherwise, this object is spent
3267 } else {
3268 list = "";
3269 }
3270 }
3271 },
3272
3273 // Actual Callbacks object
3274 self = {
3275
3276 // Add a callback or a collection of callbacks to the list
3277 add: function() {
3278 if ( list ) {
3279
3280 // If we have memory from a past run, we should fire after adding
3281 if ( memory && !firing ) {
3282 firingIndex = list.length - 1;
3283 queue.push( memory );
3284 }
3285
3286 ( function add( args ) {
3287 jQuery.each( args, function( _, arg ) {
3288 if ( jQuery.isFunction( arg ) ) {
3289 if ( !options.unique || !self.has( arg ) ) {
3290 list.push( arg );
3291 }
3292 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
3293
3294 // Inspect recursively
3295 add( arg );
3296 }
3297 } );
3298 } )( arguments );
3299
3300 if ( memory && !firing ) {
3301 fire();
3302 }
3303 }
3304 return this;
3305 },
3306
3307 // Remove a callback from the list
3308 remove: function() {
3309 jQuery.each( arguments, function( _, arg ) {
3310 var index;
3311 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3312 list.splice( index, 1 );
3313
3314 // Handle firing indexes
3315 if ( index <= firingIndex ) {
3316 firingIndex--;
3317 }
3318 }
3319 } );
3320 return this;
3321 },
3322
3323 // Check if a given callback is in the list.
3324 // If no argument is given, return whether or not list has callbacks attached.
3325 has: function( fn ) {
3326 return fn ?
3327 jQuery.inArray( fn, list ) > -1 :
3328 list.length > 0;
3329 },
3330
3331 // Remove all callbacks from the list
3332 empty: function() {
3333 if ( list ) {
3334 list = [];
3335 }
3336 return this;
3337 },
3338
3339 // Disable .fire and .add
3340 // Abort any current/pending executions
3341 // Clear all callbacks and values
3342 disable: function() {
3343 locked = queue = [];
3344 list = memory = "";
3345 return this;
3346 },
3347 disabled: function() {
3348 return !list;
3349 },
3350
3351 // Disable .fire
3352 // Also disable .add unless we have memory (since it would have no effect)
3353 // Abort any pending executions
3354 lock: function() {
3355 locked = queue = [];
3356 if ( !memory && !firing ) {
3357 list = memory = "";
3358 }
3359 return this;
3360 },
3361 locked: function() {
3362 return !!locked;
3363 },
3364
3365 // Call all callbacks with the given context and arguments
3366 fireWith: function( context, args ) {
3367 if ( !locked ) {
3368 args = args || [];
3369 args = [ context, args.slice ? args.slice() : args ];
3370 queue.push( args );
3371 if ( !firing ) {
3372 fire();
3373 }
3374 }
3375 return this;
3376 },
3377
3378 // Call all the callbacks with the given arguments
3379 fire: function() {
3380 self.fireWith( this, arguments );
3381 return this;
3382 },
3383
3384 // To know if the callbacks have already been called at least once
3385 fired: function() {
3386 return !!fired;
3387 }
3388 };
3389
3390 return self;
3391 };
3392
3393
3394 function Identity( v ) {
3395 return v;
3396 }
3397 function Thrower( ex ) {
3398 throw ex;
3399 }
3400
3401 function adoptValue( value, resolve, reject ) {
3402 var method;
3403
3404 try {
3405
3406 // Check for promise aspect first to privilege synchronous behavior
3407 if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
3408 method.call( value ).done( resolve ).fail( reject );
3409
3410 // Other thenables
3411 } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
3412 method.call( value, resolve, reject );
3413
3414 // Other non-thenables
3415 } else {
3416
3417 // Support: Android 4.0 only
3418 // Strict mode functions invoked without .call/.apply get global-object context
3419 resolve.call( undefined, value );
3420 }
3421
3422 // For Promises/A+, convert exceptions into rejections
3423 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3424 // Deferred#then to conditionally suppress rejection.
3425 } catch ( value ) {
3426
3427 // Support: Android 4.0 only
3428 // Strict mode functions invoked without .call/.apply get global-object context
3429 reject.call( undefined, value );
3430 }
3431 }
3432
3433 jQuery.extend( {
3434
3435 Deferred: function( func ) {
3436 var tuples = [
3437
3438 // action, add listener, callbacks,
3439 // ... .then handlers, argument index, [final state]
3440 [ "notify", "progress", jQuery.Callbacks( "memory" ),
3441 jQuery.Callbacks( "memory" ), 2 ],
3442 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
3443 jQuery.Callbacks( "once memory" ), 0, "resolved" ],
3444 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
3445 jQuery.Callbacks( "once memory" ), 1, "rejected" ]
3446 ],
3447 state = "pending",
3448 promise = {
3449 state: function() {
3450 return state;
3451 },
3452 always: function() {
3453 deferred.done( arguments ).fail( arguments );
3454 return this;
3455 },
3456 "catch": function( fn ) {
3457 return promise.then( null, fn );
3458 },
3459
3460 // Keep pipe for back-compat
3461 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
3462 var fns = arguments;
3463
3464 return jQuery.Deferred( function( newDefer ) {
3465 jQuery.each( tuples, function( i, tuple ) {
3466
3467 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3468 var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
3469
3470 // deferred.progress(function() { bind to newDefer or newDefer.notify })
3471 // deferred.done(function() { bind to newDefer or newDefer.resolve })
3472 // deferred.fail(function() { bind to newDefer or newDefer.reject })
3473 deferred[ tuple[ 1 ] ]( function() {
3474 var returned = fn && fn.apply( this, arguments );
3475 if ( returned && jQuery.isFunction( returned.promise ) ) {
3476 returned.promise()
3477 .progress( newDefer.notify )
3478 .done( newDefer.resolve )
3479 .fail( newDefer.reject );
3480 } else {
3481 newDefer[ tuple[ 0 ] + "With" ](
3482 this,
3483 fn ? [ returned ] : arguments
3484 );
3485 }
3486 } );
3487 } );
3488 fns = null;
3489 } ).promise();
3490 },
3491 then: function( onFulfilled, onRejected, onProgress ) {
3492 var maxDepth = 0;
3493 function resolve( depth, deferred, handler, special ) {
3494 return function() {
3495 var that = this,
3496 args = arguments,
3497 mightThrow = function() {
3498 var returned, then;
3499
3500 // Support: Promises/A+ section 2.3.3.3.3
3501 // https://promisesaplus.com/#point-59
3502 // Ignore double-resolution attempts
3503 if ( depth < maxDepth ) {
3504 return;
3505 }
3506
3507 returned = handler.apply( that, args );
3508
3509 // Support: Promises/A+ section 2.3.1
3510 // https://promisesaplus.com/#point-48
3511 if ( returned === deferred.promise() ) {
3512 throw new TypeError( "Thenable self-resolution" );
3513 }
3514
3515 // Support: Promises/A+ sections 2.3.3.1, 3.5
3516 // https://promisesaplus.com/#point-54
3517 // https://promisesaplus.com/#point-75
3518 // Retrieve `then` only once
3519 then = returned &&
3520
3521 // Support: Promises/A+ section 2.3.4
3522 // https://promisesaplus.com/#point-64
3523 // Only check objects and functions for thenability
3524 ( typeof returned === "object" ||
3525 typeof returned === "function" ) &&
3526 returned.then;
3527
3528 // Handle a returned thenable
3529 if ( jQuery.isFunction( then ) ) {
3530
3531 // Special processors (notify) just wait for resolution
3532 if ( special ) {
3533 then.call(
3534 returned,
3535 resolve( maxDepth, deferred, Identity, special ),
3536 resolve( maxDepth, deferred, Thrower, special )
3537 );
3538
3539 // Normal processors (resolve) also hook into progress
3540 } else {
3541
3542 // ...and disregard older resolution values
3543 maxDepth++;
3544
3545 then.call(
3546 returned,
3547 resolve( maxDepth, deferred, Identity, special ),
3548 resolve( maxDepth, deferred, Thrower, special ),
3549 resolve( maxDepth, deferred, Identity,
3550 deferred.notifyWith )
3551 );
3552 }
3553
3554 // Handle all other returned values
3555 } else {
3556
3557 // Only substitute handlers pass on context
3558 // and multiple values (non-spec behavior)
3559 if ( handler !== Identity ) {
3560 that = undefined;
3561 args = [ returned ];
3562 }
3563
3564 // Process the value(s)
3565 // Default process is resolve
3566 ( special || deferred.resolveWith )( that, args );
3567 }
3568 },
3569
3570 // Only normal processors (resolve) catch and reject exceptions
3571 process = special ?
3572 mightThrow :
3573 function() {
3574 try {
3575 mightThrow();
3576 } catch ( e ) {
3577
3578 if ( jQuery.Deferred.exceptionHook ) {
3579 jQuery.Deferred.exceptionHook( e,
3580 process.stackTrace );
3581 }
3582
3583 // Support: Promises/A+ section 2.3.3.3.4.1
3584 // https://promisesaplus.com/#point-61
3585 // Ignore post-resolution exceptions
3586 if ( depth + 1 >= maxDepth ) {
3587
3588 // Only substitute handlers pass on context
3589 // and multiple values (non-spec behavior)
3590 if ( handler !== Thrower ) {
3591 that = undefined;
3592 args = [ e ];
3593 }
3594
3595 deferred.rejectWith( that, args );
3596 }
3597 }
3598 };
3599
3600 // Support: Promises/A+ section 2.3.3.3.1
3601 // https://promisesaplus.com/#point-57
3602 // Re-resolve promises immediately to dodge false rejection from
3603 // subsequent errors
3604 if ( depth ) {
3605 process();
3606 } else {
3607
3608 // Call an optional hook to record the stack, in case of exception
3609 // since it's otherwise lost when execution goes async
3610 if ( jQuery.Deferred.getStackHook ) {
3611 process.stackTrace = jQuery.Deferred.getStackHook();
3612 }
3613 window.setTimeout( process );
3614 }
3615 };
3616 }
3617
3618 return jQuery.Deferred( function( newDefer ) {
3619
3620 // progress_handlers.add( ... )
3621 tuples[ 0 ][ 3 ].add(
3622 resolve(
3623 0,
3624 newDefer,
3625 jQuery.isFunction( onProgress ) ?
3626 onProgress :
3627 Identity,
3628 newDefer.notifyWith
3629 )
3630 );
3631
3632 // fulfilled_handlers.add( ... )
3633 tuples[ 1 ][ 3 ].add(
3634 resolve(
3635 0,
3636 newDefer,
3637 jQuery.isFunction( onFulfilled ) ?
3638 onFulfilled :
3639 Identity
3640 )
3641 );
3642
3643 // rejected_handlers.add( ... )
3644 tuples[ 2 ][ 3 ].add(
3645 resolve(
3646 0,
3647 newDefer,
3648 jQuery.isFunction( onRejected ) ?
3649 onRejected :
3650 Thrower
3651 )
3652 );
3653 } ).promise();
3654 },
3655
3656 // Get a promise for this deferred
3657 // If obj is provided, the promise aspect is added to the object
3658 promise: function( obj ) {
3659 return obj != null ? jQuery.extend( obj, promise ) : promise;
3660 }
3661 },
3662 deferred = {};
3663
3664 // Add list-specific methods
3665 jQuery.each( tuples, function( i, tuple ) {
3666 var list = tuple[ 2 ],
3667 stateString = tuple[ 5 ];
3668
3669 // promise.progress = list.add
3670 // promise.done = list.add
3671 // promise.fail = list.add
3672 promise[ tuple[ 1 ] ] = list.add;
3673
3674 // Handle state
3675 if ( stateString ) {
3676 list.add(
3677 function() {
3678
3679 // state = "resolved" (i.e., fulfilled)
3680 // state = "rejected"
3681 state = stateString;
3682 },
3683
3684 // rejected_callbacks.disable
3685 // fulfilled_callbacks.disable
3686 tuples[ 3 - i ][ 2 ].disable,
3687
3688 // progress_callbacks.lock
3689 tuples[ 0 ][ 2 ].lock
3690 );
3691 }
3692
3693 // progress_handlers.fire
3694 // fulfilled_handlers.fire
3695 // rejected_handlers.fire
3696 list.add( tuple[ 3 ].fire );
3697
3698 // deferred.notify = function() { deferred.notifyWith(...) }
3699 // deferred.resolve = function() { deferred.resolveWith(...) }
3700 // deferred.reject = function() { deferred.rejectWith(...) }
3701 deferred[ tuple[ 0 ] ] = function() {
3702 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
3703 return this;
3704 };
3705
3706 // deferred.notifyWith = list.fireWith
3707 // deferred.resolveWith = list.fireWith
3708 // deferred.rejectWith = list.fireWith
3709 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3710 } );
3711
3712 // Make the deferred a promise
3713 promise.promise( deferred );
3714
3715 // Call given func if any
3716 if ( func ) {
3717 func.call( deferred, deferred );
3718 }
3719
3720 // All done!
3721 return deferred;
3722 },
3723
3724 // Deferred helper
3725 when: function( singleValue ) {
3726 var
3727
3728 // count of uncompleted subordinates
3729 remaining = arguments.length,
3730
3731 // count of unprocessed arguments
3732 i = remaining,
3733
3734 // subordinate fulfillment data
3735 resolveContexts = Array( i ),
3736 resolveValues = slice.call( arguments ),
3737
3738 // the master Deferred
3739 master = jQuery.Deferred(),
3740
3741 // subordinate callback factory
3742 updateFunc = function( i ) {
3743 return function( value ) {
3744 resolveContexts[ i ] = this;
3745 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3746 if ( !( --remaining ) ) {
3747 master.resolveWith( resolveContexts, resolveValues );
3748 }
3749 };
3750 };
3751
3752 // Single- and empty arguments are adopted like Promise.resolve
3753 if ( remaining <= 1 ) {
3754 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject );
3755
3756 // Use .then() to unwrap secondary thenables (cf. gh-3000)
3757 if ( master.state() === "pending" ||
3758 jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
3759
3760 return master.then();
3761 }
3762 }
3763
3764 // Multiple arguments are aggregated like Promise.all array elements
3765 while ( i-- ) {
3766 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
3767 }
3768
3769 return master.promise();
3770 }
3771 } );
3772
3773
3774 // These usually indicate a programmer mistake during development,
3775 // warn about them ASAP rather than swallowing them by default.
3776 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
3777
3778 jQuery.Deferred.exceptionHook = function( error, stack ) {
3779
3780 // Support: IE 8 - 9 only
3781 // Console exists when dev tools are open, which can happen at any time
3782 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
3783 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
3784 }
3785 };
3786
3787
3788
3789
3790 jQuery.readyException = function( error ) {
3791 window.setTimeout( function() {
3792 throw error;
3793 } );
3794 };
3795
3796
3797
3798
3799 // The deferred used on DOM ready
3800 var readyList = jQuery.Deferred();
3801
3802 jQuery.fn.ready = function( fn ) {
3803
3804 readyList
3805 .then( fn )
3806
3807 // Wrap jQuery.readyException in a function so that the lookup
3808 // happens at the time of error handling instead of callback
3809 // registration.
3810 .catch( function( error ) {
3811 jQuery.readyException( error );
3812 } );
3813
3814 return this;
3815 };
3816
3817 jQuery.extend( {
3818
3819 // Is the DOM ready to be used? Set to true once it occurs.
3820 isReady: false,
3821
3822 // A counter to track how many items to wait for before
3823 // the ready event fires. See #6781
3824 readyWait: 1,
3825
3826 // Hold (or release) the ready event
3827 holdReady: function( hold ) {
3828 if ( hold ) {
3829 jQuery.readyWait++;
3830 } else {
3831 jQuery.ready( true );
3832 }
3833 },
3834
3835 // Handle when the DOM is ready
3836 ready: function( wait ) {
3837
3838 // Abort if there are pending holds or we're already ready
3839 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3840 return;
3841 }
3842
3843 // Remember that the DOM is ready
3844 jQuery.isReady = true;
3845
3846 // If a normal DOM Ready event fired, decrement, and wait if need be
3847 if ( wait !== true && --jQuery.readyWait > 0 ) {
3848 return;
3849 }
3850
3851 // If there are functions bound, to execute
3852 readyList.resolveWith( document, [ jQuery ] );
3853 }
3854 } );
3855
3856 jQuery.ready.then = readyList.then;
3857
3858 // The ready event handler and self cleanup method
3859 function completed() {
3860 document.removeEventListener( "DOMContentLoaded", completed );
3861 window.removeEventListener( "load", completed );
3862 jQuery.ready();
3863 }
3864
3865 // Catch cases where $(document).ready() is called
3866 // after the browser event has already occurred.
3867 // Support: IE <=9 - 10 only
3868 // Older IE sometimes signals "interactive" too soon
3869 if ( document.readyState === "complete" ||
3870 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
3871
3872 // Handle it asynchronously to allow scripts the opportunity to delay ready
3873 window.setTimeout( jQuery.ready );
3874
3875 } else {
3876
3877 // Use the handy event callback
3878 document.addEventListener( "DOMContentLoaded", completed );
3879
3880 // A fallback to window.onload, that will always work
3881 window.addEventListener( "load", completed );
3882 }
3883
3884
3885
3886
3887 // Multifunctional method to get and set values of a collection
3888 // The value/s can optionally be executed if it's a function
3889 var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3890 var i = 0,
3891 len = elems.length,
3892 bulk = key == null;
3893
3894 // Sets many values
3895 if ( jQuery.type( key ) === "object" ) {
3896 chainable = true;
3897 for ( i in key ) {
3898 access( elems, fn, i, key[ i ], true, emptyGet, raw );
3899 }
3900
3901 // Sets one value
3902 } else if ( value !== undefined ) {
3903 chainable = true;
3904
3905 if ( !jQuery.isFunction( value ) ) {
3906 raw = true;
3907 }
3908
3909 if ( bulk ) {
3910
3911 // Bulk operations run against the entire set
3912 if ( raw ) {
3913 fn.call( elems, value );
3914 fn = null;
3915
3916 // ...except when executing function values
3917 } else {
3918 bulk = fn;
3919 fn = function( elem, key, value ) {
3920 return bulk.call( jQuery( elem ), value );
3921 };
3922 }
3923 }
3924
3925 if ( fn ) {
3926 for ( ; i < len; i++ ) {
3927 fn(
3928 elems[ i ], key, raw ?
3929 value :
3930 value.call( elems[ i ], i, fn( elems[ i ], key ) )
3931 );
3932 }
3933 }
3934 }
3935
3936 return chainable ?
3937 elems :
3938
3939 // Gets
3940 bulk ?
3941 fn.call( elems ) :
3942 len ? fn( elems[ 0 ], key ) : emptyGet;
3943 };
3944 var acceptData = function( owner ) {
3945
3946 // Accepts only:
3947 // - Node
3948 // - Node.ELEMENT_NODE
3949 // - Node.DOCUMENT_NODE
3950 // - Object
3951 // - Any
3952 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
3953 };
3954
3955
3956
3957
3958 function Data() {
3959 this.expando = jQuery.expando + Data.uid++;
3960 }
3961
3962 Data.uid = 1;
3963
3964 Data.prototype = {
3965
3966 cache: function( owner ) {
3967
3968 // Check if the owner object already has a cache
3969 var value = owner[ this.expando ];
3970
3971 // If not, create one
3972 if ( !value ) {
3973 value = {};
3974
3975 // We can accept data for non-element nodes in modern browsers,
3976 // but we should not, see #8335.
3977 // Always return an empty object.
3978 if ( acceptData( owner ) ) {
3979
3980 // If it is a node unlikely to be stringify-ed or looped over
3981 // use plain assignment
3982 if ( owner.nodeType ) {
3983 owner[ this.expando ] = value;
3984
3985 // Otherwise secure it in a non-enumerable property
3986 // configurable must be true to allow the property to be
3987 // deleted when data is removed
3988 } else {
3989 Object.defineProperty( owner, this.expando, {
3990 value: value,
3991 configurable: true
3992 } );
3993 }
3994 }
3995 }
3996
3997 return value;
3998 },
3999 set: function( owner, data, value ) {
4000 var prop,
4001 cache = this.cache( owner );
4002
4003 // Handle: [ owner, key, value ] args
4004 // Always use camelCase key (gh-2257)
4005 if ( typeof data === "string" ) {
4006 cache[ jQuery.camelCase( data ) ] = value;
4007
4008 // Handle: [ owner, { properties } ] args
4009 } else {
4010
4011 // Copy the properties one-by-one to the cache object
4012 for ( prop in data ) {
4013 cache[ jQuery.camelCase( prop ) ] = data[ prop ];
4014 }
4015 }
4016 return cache;
4017 },
4018 get: function( owner, key ) {
4019 return key === undefined ?
4020 this.cache( owner ) :
4021
4022 // Always use camelCase key (gh-2257)
4023 owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
4024 },
4025 access: function( owner, key, value ) {
4026
4027 // In cases where either:
4028 //
4029 // 1. No key was specified
4030 // 2. A string key was specified, but no value provided
4031 //
4032 // Take the "read" path and allow the get method to determine
4033 // which value to return, respectively either:
4034 //
4035 // 1. The entire cache object
4036 // 2. The data stored at the key
4037 //
4038 if ( key === undefined ||
4039 ( ( key && typeof key === "string" ) && value === undefined ) ) {
4040
4041 return this.get( owner, key );
4042 }
4043
4044 // When the key is not a string, or both a key and value
4045 // are specified, set or extend (existing objects) with either:
4046 //
4047 // 1. An object of properties
4048 // 2. A key and value
4049 //
4050 this.set( owner, key, value );
4051
4052 // Since the "set" path can have two possible entry points
4053 // return the expected data based on which path was taken[*]
4054 return value !== undefined ? value : key;
4055 },
4056 remove: function( owner, key ) {
4057 var i,
4058 cache = owner[ this.expando ];
4059
4060 if ( cache === undefined ) {
4061 return;
4062 }
4063
4064 if ( key !== undefined ) {
4065
4066 // Support array or space separated string of keys
4067 if ( jQuery.isArray( key ) ) {
4068
4069 // If key is an array of keys...
4070 // We always set camelCase keys, so remove that.
4071 key = key.map( jQuery.camelCase );
4072 } else {
4073 key = jQuery.camelCase( key );
4074
4075 // If a key with the spaces exists, use it.
4076 // Otherwise, create an array by matching non-whitespace
4077 key = key in cache ?
4078 [ key ] :
4079 ( key.match( rnotwhite ) || [] );
4080 }
4081
4082 i = key.length;
4083
4084 while ( i-- ) {
4085 delete cache[ key[ i ] ];
4086 }
4087 }
4088
4089 // Remove the expando if there's no more data
4090 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
4091
4092 // Support: Chrome <=35 - 45
4093 // Webkit & Blink performance suffers when deleting properties
4094 // from DOM nodes, so set to undefined instead
4095 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4096 if ( owner.nodeType ) {
4097 owner[ this.expando ] = undefined;
4098 } else {
4099 delete owner[ this.expando ];
4100 }
4101 }
4102 },
4103 hasData: function( owner ) {
4104 var cache = owner[ this.expando ];
4105 return cache !== undefined && !jQuery.isEmptyObject( cache );
4106 }
4107 };
4108 var dataPriv = new Data();
4109
4110 var dataUser = new Data();
4111
4112
4113
4114 // Implementation Summary
4115 //
4116 // 1. Enforce API surface and semantic compatibility with 1.9.x branch
4117 // 2. Improve the module's maintainability by reducing the storage
4118 // paths to a single mechanism.
4119 // 3. Use the same single mechanism to support "private" and "user" data.
4120 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4121 // 5. Avoid exposing implementation details on user objects (eg. expando properties)
4122 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
4123
4124 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4125 rmultiDash = /[A-Z]/g;
4126
4127 function dataAttr( elem, key, data ) {
4128 var name;
4129
4130 // If nothing was found internally, try to fetch any
4131 // data from the HTML5 data-* attribute
4132 if ( data === undefined && elem.nodeType === 1 ) {
4133 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
4134 data = elem.getAttribute( name );
4135
4136 if ( typeof data === "string" ) {
4137 try {
4138 data = data === "true" ? true :
4139 data === "false" ? false :
4140 data === "null" ? null :
4141
4142 // Only convert to a number if it doesn't change the string
4143 +data + "" === data ? +data :
4144 rbrace.test( data ) ? JSON.parse( data ) :
4145 data;
4146 } catch ( e ) {}
4147
4148 // Make sure we set the data so it isn't changed later
4149 dataUser.set( elem, key, data );
4150 } else {
4151 data = undefined;
4152 }
4153 }
4154 return data;
4155 }
4156
4157 jQuery.extend( {
4158 hasData: function( elem ) {
4159 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
4160 },
4161
4162 data: function( elem, name, data ) {
4163 return dataUser.access( elem, name, data );
4164 },
4165
4166 removeData: function( elem, name ) {
4167 dataUser.remove( elem, name );
4168 },
4169
4170 // TODO: Now that all calls to _data and _removeData have been replaced
4171 // with direct calls to dataPriv methods, these can be deprecated.
4172 _data: function( elem, name, data ) {
4173 return dataPriv.access( elem, name, data );
4174 },
4175
4176 _removeData: function( elem, name ) {
4177 dataPriv.remove( elem, name );
4178 }
4179 } );
4180
4181 jQuery.fn.extend( {
4182 data: function( key, value ) {
4183 var i, name, data,
4184 elem = this[ 0 ],
4185 attrs = elem && elem.attributes;
4186
4187 // Gets all values
4188 if ( key === undefined ) {
4189 if ( this.length ) {
4190 data = dataUser.get( elem );
4191
4192 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
4193 i = attrs.length;
4194 while ( i-- ) {
4195
4196 // Support: IE 11 only
4197 // The attrs elements can be null (#14894)
4198 if ( attrs[ i ] ) {
4199 name = attrs[ i ].name;
4200 if ( name.indexOf( "data-" ) === 0 ) {
4201 name = jQuery.camelCase( name.slice( 5 ) );
4202 dataAttr( elem, name, data[ name ] );
4203 }
4204 }
4205 }
4206 dataPriv.set( elem, "hasDataAttrs", true );
4207 }
4208 }
4209
4210 return data;
4211 }
4212
4213 // Sets multiple values
4214 if ( typeof key === "object" ) {
4215 return this.each( function() {
4216 dataUser.set( this, key );
4217 } );
4218 }
4219
4220 return access( this, function( value ) {
4221 var data;
4222
4223 // The calling jQuery object (element matches) is not empty
4224 // (and therefore has an element appears at this[ 0 ]) and the
4225 // `value` parameter was not undefined. An empty jQuery object
4226 // will result in `undefined` for elem = this[ 0 ] which will
4227 // throw an exception if an attempt to read a data cache is made.
4228 if ( elem && value === undefined ) {
4229
4230 // Attempt to get data from the cache
4231 // The key will always be camelCased in Data
4232 data = dataUser.get( elem, key );
4233 if ( data !== undefined ) {
4234 return data;
4235 }
4236
4237 // Attempt to "discover" the data in
4238 // HTML5 custom data-* attrs
4239 data = dataAttr( elem, key );
4240 if ( data !== undefined ) {
4241 return data;
4242 }
4243
4244 // We tried really hard, but the data doesn't exist.
4245 return;
4246 }
4247
4248 // Set the data...
4249 this.each( function() {
4250
4251 // We always store the camelCased key
4252 dataUser.set( this, key, value );
4253 } );
4254 }, null, value, arguments.length > 1, null, true );
4255 },
4256
4257 removeData: function( key ) {
4258 return this.each( function() {
4259 dataUser.remove( this, key );
4260 } );
4261 }
4262 } );
4263
4264
4265 jQuery.extend( {
4266 queue: function( elem, type, data ) {
4267 var queue;
4268
4269 if ( elem ) {
4270 type = ( type || "fx" ) + "queue";
4271 queue = dataPriv.get( elem, type );
4272
4273 // Speed up dequeue by getting out quickly if this is just a lookup
4274 if ( data ) {
4275 if ( !queue || jQuery.isArray( data ) ) {
4276 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4277 } else {
4278 queue.push( data );
4279 }
4280 }
4281 return queue || [];
4282 }
4283 },
4284
4285 dequeue: function( elem, type ) {
4286 type = type || "fx";
4287
4288 var queue = jQuery.queue( elem, type ),
4289 startLength = queue.length,
4290 fn = queue.shift(),
4291 hooks = jQuery._queueHooks( elem, type ),
4292 next = function() {
4293 jQuery.dequeue( elem, type );
4294 };
4295
4296 // If the fx queue is dequeued, always remove the progress sentinel
4297 if ( fn === "inprogress" ) {
4298 fn = queue.shift();
4299 startLength--;
4300 }
4301
4302 if ( fn ) {
4303
4304 // Add a progress sentinel to prevent the fx queue from being
4305 // automatically dequeued
4306 if ( type === "fx" ) {
4307 queue.unshift( "inprogress" );
4308 }
4309
4310 // Clear up the last queue stop function
4311 delete hooks.stop;
4312 fn.call( elem, next, hooks );
4313 }
4314
4315 if ( !startLength && hooks ) {
4316 hooks.empty.fire();
4317 }
4318 },
4319
4320 // Not public - generate a queueHooks object, or return the current one
4321 _queueHooks: function( elem, type ) {
4322 var key = type + "queueHooks";
4323 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4324 empty: jQuery.Callbacks( "once memory" ).add( function() {
4325 dataPriv.remove( elem, [ type + "queue", key ] );
4326 } )
4327 } );
4328 }
4329 } );
4330
4331 jQuery.fn.extend( {
4332 queue: function( type, data ) {
4333 var setter = 2;
4334
4335 if ( typeof type !== "string" ) {
4336 data = type;
4337 type = "fx";
4338 setter--;
4339 }
4340
4341 if ( arguments.length < setter ) {
4342 return jQuery.queue( this[ 0 ], type );
4343 }
4344
4345 return data === undefined ?
4346 this :
4347 this.each( function() {
4348 var queue = jQuery.queue( this, type, data );
4349
4350 // Ensure a hooks for this queue
4351 jQuery._queueHooks( this, type );
4352
4353 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4354 jQuery.dequeue( this, type );
4355 }
4356 } );
4357 },
4358 dequeue: function( type ) {
4359 return this.each( function() {
4360 jQuery.dequeue( this, type );
4361 } );
4362 },
4363 clearQueue: function( type ) {
4364 return this.queue( type || "fx", [] );
4365 },
4366
4367 // Get a promise resolved when queues of a certain type
4368 // are emptied (fx is the type by default)
4369 promise: function( type, obj ) {
4370 var tmp,
4371 count = 1,
4372 defer = jQuery.Deferred(),
4373 elements = this,
4374 i = this.length,
4375 resolve = function() {
4376 if ( !( --count ) ) {
4377 defer.resolveWith( elements, [ elements ] );
4378 }
4379 };
4380
4381 if ( typeof type !== "string" ) {
4382 obj = type;
4383 type = undefined;
4384 }
4385 type = type || "fx";
4386
4387 while ( i-- ) {
4388 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4389 if ( tmp && tmp.empty ) {
4390 count++;
4391 tmp.empty.add( resolve );
4392 }
4393 }
4394 resolve();
4395 return defer.promise( obj );
4396 }
4397 } );
4398 var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4399
4400 var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4401
4402
4403 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4404
4405 var isHiddenWithinTree = function( elem, el ) {
4406
4407 // isHiddenWithinTree might be called from jQuery#filter function;
4408 // in that case, element will be second argument
4409 elem = el || elem;
4410
4411 // Inline style trumps all
4412 return elem.style.display === "none" ||
4413 elem.style.display === "" &&
4414
4415 // Otherwise, check computed style
4416 // Support: Firefox <=43 - 45
4417 // Disconnected elements can have computed display: none, so first confirm that elem is
4418 // in the document.
4419 jQuery.contains( elem.ownerDocument, elem ) &&
4420
4421 jQuery.css( elem, "display" ) === "none";
4422 };
4423
4424 var swap = function( elem, options, callback, args ) {
4425 var ret, name,
4426 old = {};
4427
4428 // Remember the old values, and insert the new ones
4429 for ( name in options ) {
4430 old[ name ] = elem.style[ name ];
4431 elem.style[ name ] = options[ name ];
4432 }
4433
4434 ret = callback.apply( elem, args || [] );
4435
4436 // Revert the old values
4437 for ( name in options ) {
4438 elem.style[ name ] = old[ name ];
4439 }
4440
4441 return ret;
4442 };
4443
4444
4445
4446
4447 function adjustCSS( elem, prop, valueParts, tween ) {
4448 var adjusted,
4449 scale = 1,
4450 maxIterations = 20,
4451 currentValue = tween ?
4452 function() {
4453 return tween.cur();
4454 } :
4455 function() {
4456 return jQuery.css( elem, prop, "" );
4457 },
4458 initial = currentValue(),
4459 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4460
4461 // Starting value computation is required for potential unit mismatches
4462 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4463 rcssNum.exec( jQuery.css( elem, prop ) );
4464
4465 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4466
4467 // Trust units reported by jQuery.css
4468 unit = unit || initialInUnit[ 3 ];
4469
4470 // Make sure we update the tween properties later on
4471 valueParts = valueParts || [];
4472
4473 // Iteratively approximate from a nonzero starting point
4474 initialInUnit = +initial || 1;
4475
4476 do {
4477
4478 // If previous iteration zeroed out, double until we get *something*.
4479 // Use string for doubling so we don't accidentally see scale as unchanged below
4480 scale = scale || ".5";
4481
4482 // Adjust and apply
4483 initialInUnit = initialInUnit / scale;
4484 jQuery.style( elem, prop, initialInUnit + unit );
4485
4486 // Update scale, tolerating zero or NaN from tween.cur()
4487 // Break the loop if scale is unchanged or perfect, or if we've just had enough.
4488 } while (
4489 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
4490 );
4491 }
4492
4493 if ( valueParts ) {
4494 initialInUnit = +initialInUnit || +initial || 0;
4495
4496 // Apply relative offset (+=/-=) if specified
4497 adjusted = valueParts[ 1 ] ?
4498 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4499 +valueParts[ 2 ];
4500 if ( tween ) {
4501 tween.unit = unit;
4502 tween.start = initialInUnit;
4503 tween.end = adjusted;
4504 }
4505 }
4506 return adjusted;
4507 }
4508
4509
4510 var defaultDisplayMap = {};
4511
4512 function getDefaultDisplay( elem ) {
4513 var temp,
4514 doc = elem.ownerDocument,
4515 nodeName = elem.nodeName,
4516 display = defaultDisplayMap[ nodeName ];
4517
4518 if ( display ) {
4519 return display;
4520 }
4521
4522 temp = doc.body.appendChild( doc.createElement( nodeName ) ),
4523 display = jQuery.css( temp, "display" );
4524
4525 temp.parentNode.removeChild( temp );
4526
4527 if ( display === "none" ) {
4528 display = "block";
4529 }
4530 defaultDisplayMap[ nodeName ] = display;
4531
4532 return display;
4533 }
4534
4535 function showHide( elements, show ) {
4536 var display, elem,
4537 values = [],
4538 index = 0,
4539 length = elements.length;
4540
4541 // Determine new display value for elements that need to change
4542 for ( ; index < length; index++ ) {
4543 elem = elements[ index ];
4544 if ( !elem.style ) {
4545 continue;
4546 }
4547
4548 display = elem.style.display;
4549 if ( show ) {
4550
4551 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4552 // check is required in this first loop unless we have a nonempty display value (either
4553 // inline or about-to-be-restored)
4554 if ( display === "none" ) {
4555 values[ index ] = dataPriv.get( elem, "display" ) || null;
4556 if ( !values[ index ] ) {
4557 elem.style.display = "";
4558 }
4559 }
4560 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
4561 values[ index ] = getDefaultDisplay( elem );
4562 }
4563 } else {
4564 if ( display !== "none" ) {
4565 values[ index ] = "none";
4566
4567 // Remember what we're overwriting
4568 dataPriv.set( elem, "display", display );
4569 }
4570 }
4571 }
4572
4573 // Set the display of the elements in a second loop to avoid constant reflow
4574 for ( index = 0; index < length; index++ ) {
4575 if ( values[ index ] != null ) {
4576 elements[ index ].style.display = values[ index ];
4577 }
4578 }
4579
4580 return elements;
4581 }
4582
4583 jQuery.fn.extend( {
4584 show: function() {
4585 return showHide( this, true );
4586 },
4587 hide: function() {
4588 return showHide( this );
4589 },
4590 toggle: function( state ) {
4591 if ( typeof state === "boolean" ) {
4592 return state ? this.show() : this.hide();
4593 }
4594
4595 return this.each( function() {
4596 if ( isHiddenWithinTree( this ) ) {
4597 jQuery( this ).show();
4598 } else {
4599 jQuery( this ).hide();
4600 }
4601 } );
4602 }
4603 } );
4604 var rcheckableType = ( /^(?:checkbox|radio)$/i );
4605
4606 var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
4607
4608 var rscriptType = ( /^$|\/(?:java|ecma)script/i );
4609
4610
4611
4612 // We have to close these tags to support XHTML (#13200)
4613 var wrapMap = {
4614
4615 // Support: IE <=9 only
4616 option: [ 1, "<select multiple='multiple'>", "</select>" ],
4617
4618 // XHTML parsers do not magically insert elements in the
4619 // same way that tag soup parsers do. So we cannot shorten
4620 // this by omitting <tbody> or other required elements.
4621 thead: [ 1, "<table>", "</table>" ],
4622 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4623 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4624 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4625
4626 _default: [ 0, "", "" ]
4627 };
4628
4629 // Support: IE <=9 only
4630 wrapMap.optgroup = wrapMap.option;
4631
4632 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4633 wrapMap.th = wrapMap.td;
4634
4635
4636 function getAll( context, tag ) {
4637
4638 // Support: IE <=9 - 11 only
4639 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4640 var ret = typeof context.getElementsByTagName !== "undefined" ?
4641 context.getElementsByTagName( tag || "*" ) :
4642 typeof context.querySelectorAll !== "undefined" ?
4643 context.querySelectorAll( tag || "*" ) :
4644 [];
4645
4646 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4647 jQuery.merge( [ context ], ret ) :
4648 ret;
4649 }
4650
4651
4652 // Mark scripts as having already been evaluated
4653 function setGlobalEval( elems, refElements ) {
4654 var i = 0,
4655 l = elems.length;
4656
4657 for ( ; i < l; i++ ) {
4658 dataPriv.set(
4659 elems[ i ],
4660 "globalEval",
4661 !refElements || dataPriv.get( refElements[ i ], "globalEval" )
4662 );
4663 }
4664 }
4665
4666
4667 var rhtml = /<|&#?\w+;/;
4668
4669 function buildFragment( elems, context, scripts, selection, ignored ) {
4670 var elem, tmp, tag, wrap, contains, j,
4671 fragment = context.createDocumentFragment(),
4672 nodes = [],
4673 i = 0,
4674 l = elems.length;
4675
4676 for ( ; i < l; i++ ) {
4677 elem = elems[ i ];
4678
4679 if ( elem || elem === 0 ) {
4680
4681 // Add nodes directly
4682 if ( jQuery.type( elem ) === "object" ) {
4683
4684 // Support: Android <=4.0 only, PhantomJS 1 only
4685 // push.apply(_, arraylike) throws on ancient WebKit
4686 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4687
4688 // Convert non-html into a text node
4689 } else if ( !rhtml.test( elem ) ) {
4690 nodes.push( context.createTextNode( elem ) );
4691
4692 // Convert html into DOM nodes
4693 } else {
4694 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
4695
4696 // Deserialize a standard representation
4697 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4698 wrap = wrapMap[ tag ] || wrapMap._default;
4699 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4700
4701 // Descend through wrappers to the right content
4702 j = wrap[ 0 ];
4703 while ( j-- ) {
4704 tmp = tmp.lastChild;
4705 }
4706
4707 // Support: Android <=4.0 only, PhantomJS 1 only
4708 // push.apply(_, arraylike) throws on ancient WebKit
4709 jQuery.merge( nodes, tmp.childNodes );
4710
4711 // Remember the top-level container
4712 tmp = fragment.firstChild;
4713
4714 // Ensure the created nodes are orphaned (#12392)
4715 tmp.textContent = "";
4716 }
4717 }
4718 }
4719
4720 // Remove wrapper from fragment
4721 fragment.textContent = "";
4722
4723 i = 0;
4724 while ( ( elem = nodes[ i++ ] ) ) {
4725
4726 // Skip elements already in the context collection (trac-4087)
4727 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4728 if ( ignored ) {
4729 ignored.push( elem );
4730 }
4731 continue;
4732 }
4733
4734 contains = jQuery.contains( elem.ownerDocument, elem );
4735
4736 // Append to fragment
4737 tmp = getAll( fragment.appendChild( elem ), "script" );
4738
4739 // Preserve script evaluation history
4740 if ( contains ) {
4741 setGlobalEval( tmp );
4742 }
4743
4744 // Capture executables
4745 if ( scripts ) {
4746 j = 0;
4747 while ( ( elem = tmp[ j++ ] ) ) {
4748 if ( rscriptType.test( elem.type || "" ) ) {
4749 scripts.push( elem );
4750 }
4751 }
4752 }
4753 }
4754
4755 return fragment;
4756 }
4757
4758
4759 ( function() {
4760 var fragment = document.createDocumentFragment(),
4761 div = fragment.appendChild( document.createElement( "div" ) ),
4762 input = document.createElement( "input" );
4763
4764 // Support: Android 4.0 - 4.3 only
4765 // Check state lost if the name is set (#11217)
4766 // Support: Windows Web Apps (WWA)
4767 // `name` and `type` must use .setAttribute for WWA (#14901)
4768 input.setAttribute( "type", "radio" );
4769 input.setAttribute( "checked", "checked" );
4770 input.setAttribute( "name", "t" );
4771
4772 div.appendChild( input );
4773
4774 // Support: Android <=4.1 only
4775 // Older WebKit doesn't clone checked state correctly in fragments
4776 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4777
4778 // Support: IE <=11 only
4779 // Make sure textarea (and checkbox) defaultValue is properly cloned
4780 div.innerHTML = "<textarea>x</textarea>";
4781 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4782 } )();
4783 var documentElement = document.documentElement;
4784
4785
4786
4787 var
4788 rkeyEvent = /^key/,
4789 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
4790 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
4791
4792 function returnTrue() {
4793 return true;
4794 }
4795
4796 function returnFalse() {
4797 return false;
4798 }
4799
4800 // Support: IE <=9 only
4801 // See #13393 for more info
4802 function safeActiveElement() {
4803 try {
4804 return document.activeElement;
4805 } catch ( err ) { }
4806 }
4807
4808 function on( elem, types, selector, data, fn, one ) {
4809 var origFn, type;
4810
4811 // Types can be a map of types/handlers
4812 if ( typeof types === "object" ) {
4813
4814 // ( types-Object, selector, data )
4815 if ( typeof selector !== "string" ) {
4816
4817 // ( types-Object, data )
4818 data = data || selector;
4819 selector = undefined;
4820 }
4821 for ( type in types ) {
4822 on( elem, type, selector, data, types[ type ], one );
4823 }
4824 return elem;
4825 }
4826
4827 if ( data == null && fn == null ) {
4828
4829 // ( types, fn )
4830 fn = selector;
4831 data = selector = undefined;
4832 } else if ( fn == null ) {
4833 if ( typeof selector === "string" ) {
4834
4835 // ( types, selector, fn )
4836 fn = data;
4837 data = undefined;
4838 } else {
4839
4840 // ( types, data, fn )
4841 fn = data;
4842 data = selector;
4843 selector = undefined;
4844 }
4845 }
4846 if ( fn === false ) {
4847 fn = returnFalse;
4848 } else if ( !fn ) {
4849 return elem;
4850 }
4851
4852 if ( one === 1 ) {
4853 origFn = fn;
4854 fn = function( event ) {
4855
4856 // Can use an empty set, since event contains the info
4857 jQuery().off( event );
4858 return origFn.apply( this, arguments );
4859 };
4860
4861 // Use same guid so caller can remove using origFn
4862 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
4863 }
4864 return elem.each( function() {
4865 jQuery.event.add( this, types, fn, data, selector );
4866 } );
4867 }
4868
4869 /*
4870 * Helper functions for managing events -- not part of the public interface.
4871 * Props to Dean Edwards' addEvent library for many of the ideas.
4872 */
4873 jQuery.event = {
4874
4875 global: {},
4876
4877 add: function( elem, types, handler, data, selector ) {
4878
4879 var handleObjIn, eventHandle, tmp,
4880 events, t, handleObj,
4881 special, handlers, type, namespaces, origType,
4882 elemData = dataPriv.get( elem );
4883
4884 // Don't attach events to noData or text/comment nodes (but allow plain objects)
4885 if ( !elemData ) {
4886 return;
4887 }
4888
4889 // Caller can pass in an object of custom data in lieu of the handler
4890 if ( handler.handler ) {
4891 handleObjIn = handler;
4892 handler = handleObjIn.handler;
4893 selector = handleObjIn.selector;
4894 }
4895
4896 // Ensure that invalid selectors throw exceptions at attach time
4897 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
4898 if ( selector ) {
4899 jQuery.find.matchesSelector( documentElement, selector );
4900 }
4901
4902 // Make sure that the handler has a unique ID, used to find/remove it later
4903 if ( !handler.guid ) {
4904 handler.guid = jQuery.guid++;
4905 }
4906
4907 // Init the element's event structure and main handler, if this is the first
4908 if ( !( events = elemData.events ) ) {
4909 events = elemData.events = {};
4910 }
4911 if ( !( eventHandle = elemData.handle ) ) {
4912 eventHandle = elemData.handle = function( e ) {
4913
4914 // Discard the second event of a jQuery.event.trigger() and
4915 // when an event is called after a page has unloaded
4916 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
4917 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
4918 };
4919 }
4920
4921 // Handle multiple events separated by a space
4922 types = ( types || "" ).match( rnotwhite ) || [ "" ];
4923 t = types.length;
4924 while ( t-- ) {
4925 tmp = rtypenamespace.exec( types[ t ] ) || [];
4926 type = origType = tmp[ 1 ];
4927 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
4928
4929 // There *must* be a type, no attaching namespace-only handlers
4930 if ( !type ) {
4931 continue;
4932 }
4933
4934 // If event changes its type, use the special event handlers for the changed type
4935 special = jQuery.event.special[ type ] || {};
4936
4937 // If selector defined, determine special event api type, otherwise given type
4938 type = ( selector ? special.delegateType : special.bindType ) || type;
4939
4940 // Update special based on newly reset type
4941 special = jQuery.event.special[ type ] || {};
4942
4943 // handleObj is passed to all event handlers
4944 handleObj = jQuery.extend( {
4945 type: type,
4946 origType: origType,
4947 data: data,
4948 handler: handler,
4949 guid: handler.guid,
4950 selector: selector,
4951 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4952 namespace: namespaces.join( "." )
4953 }, handleObjIn );
4954
4955 // Init the event handler queue if we're the first
4956 if ( !( handlers = events[ type ] ) ) {
4957 handlers = events[ type ] = [];
4958 handlers.delegateCount = 0;
4959
4960 // Only use addEventListener if the special events handler returns false
4961 if ( !special.setup ||
4962 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4963
4964 if ( elem.addEventListener ) {
4965 elem.addEventListener( type, eventHandle );
4966 }
4967 }
4968 }
4969
4970 if ( special.add ) {
4971 special.add.call( elem, handleObj );
4972
4973 if ( !handleObj.handler.guid ) {
4974 handleObj.handler.guid = handler.guid;
4975 }
4976 }
4977
4978 // Add to the element's handler list, delegates in front
4979 if ( selector ) {
4980 handlers.splice( handlers.delegateCount++, 0, handleObj );
4981 } else {
4982 handlers.push( handleObj );
4983 }
4984
4985 // Keep track of which events have ever been used, for event optimization
4986 jQuery.event.global[ type ] = true;
4987 }
4988
4989 },
4990
4991 // Detach an event or set of events from an element
4992 remove: function( elem, types, handler, selector, mappedTypes ) {
4993
4994 var j, origCount, tmp,
4995 events, t, handleObj,
4996 special, handlers, type, namespaces, origType,
4997 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
4998
4999 if ( !elemData || !( events = elemData.events ) ) {
5000 return;
5001 }
5002
5003 // Once for each type.namespace in types; type may be omitted
5004 types = ( types || "" ).match( rnotwhite ) || [ "" ];
5005 t = types.length;
5006 while ( t-- ) {
5007 tmp = rtypenamespace.exec( types[ t ] ) || [];
5008 type = origType = tmp[ 1 ];
5009 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5010
5011 // Unbind all events (on this namespace, if provided) for the element
5012 if ( !type ) {
5013 for ( type in events ) {
5014 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5015 }
5016 continue;
5017 }
5018
5019 special = jQuery.event.special[ type ] || {};
5020 type = ( selector ? special.delegateType : special.bindType ) || type;
5021 handlers = events[ type ] || [];
5022 tmp = tmp[ 2 ] &&
5023 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
5024
5025 // Remove matching events
5026 origCount = j = handlers.length;
5027 while ( j-- ) {
5028 handleObj = handlers[ j ];
5029
5030 if ( ( mappedTypes || origType === handleObj.origType ) &&
5031 ( !handler || handler.guid === handleObj.guid ) &&
5032 ( !tmp || tmp.test( handleObj.namespace ) ) &&
5033 ( !selector || selector === handleObj.selector ||
5034 selector === "**" && handleObj.selector ) ) {
5035 handlers.splice( j, 1 );
5036
5037 if ( handleObj.selector ) {
5038 handlers.delegateCount--;
5039 }
5040 if ( special.remove ) {
5041 special.remove.call( elem, handleObj );
5042 }
5043 }
5044 }
5045
5046 // Remove generic event handler if we removed something and no more handlers exist
5047 // (avoids potential for endless recursion during removal of special event handlers)
5048 if ( origCount && !handlers.length ) {
5049 if ( !special.teardown ||
5050 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5051
5052 jQuery.removeEvent( elem, type, elemData.handle );
5053 }
5054
5055 delete events[ type ];
5056 }
5057 }
5058
5059 // Remove data and the expando if it's no longer used
5060 if ( jQuery.isEmptyObject( events ) ) {
5061 dataPriv.remove( elem, "handle events" );
5062 }
5063 },
5064
5065 dispatch: function( nativeEvent ) {
5066
5067 // Make a writable jQuery.Event from the native event object
5068 var event = jQuery.event.fix( nativeEvent );
5069
5070 var i, j, ret, matched, handleObj, handlerQueue,
5071 args = new Array( arguments.length ),
5072 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
5073 special = jQuery.event.special[ event.type ] || {};
5074
5075 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5076 args[ 0 ] = event;
5077
5078 for ( i = 1; i < arguments.length; i++ ) {
5079 args[ i ] = arguments[ i ];
5080 }
5081
5082 event.delegateTarget = this;
5083
5084 // Call the preDispatch hook for the mapped type, and let it bail if desired
5085 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5086 return;
5087 }
5088
5089 // Determine handlers
5090 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5091
5092 // Run delegates first; they may want to stop propagation beneath us
5093 i = 0;
5094 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5095 event.currentTarget = matched.elem;
5096
5097 j = 0;
5098 while ( ( handleObj = matched.handlers[ j++ ] ) &&
5099 !event.isImmediatePropagationStopped() ) {
5100
5101 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
5102 // a subset or equal to those in the bound event (both can have no namespace).
5103 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
5104
5105 event.handleObj = handleObj;
5106 event.data = handleObj.data;
5107
5108 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5109 handleObj.handler ).apply( matched.elem, args );
5110
5111 if ( ret !== undefined ) {
5112 if ( ( event.result = ret ) === false ) {
5113 event.preventDefault();
5114 event.stopPropagation();
5115 }
5116 }
5117 }
5118 }
5119 }
5120
5121 // Call the postDispatch hook for the mapped type
5122 if ( special.postDispatch ) {
5123 special.postDispatch.call( this, event );
5124 }
5125
5126 return event.result;
5127 },
5128
5129 handlers: function( event, handlers ) {
5130 var i, matches, sel, handleObj,
5131 handlerQueue = [],
5132 delegateCount = handlers.delegateCount,
5133 cur = event.target;
5134
5135 // Support: IE <=9
5136 // Find delegate handlers
5137 // Black-hole SVG <use> instance trees (#13180)
5138 //
5139 // Support: Firefox <=42
5140 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
5141 if ( delegateCount && cur.nodeType &&
5142 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
5143
5144 for ( ; cur !== this; cur = cur.parentNode || this ) {
5145
5146 // Don't check non-elements (#13208)
5147 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5148 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
5149 matches = [];
5150 for ( i = 0; i < delegateCount; i++ ) {
5151 handleObj = handlers[ i ];
5152
5153 // Don't conflict with Object.prototype properties (#13203)
5154 sel = handleObj.selector + " ";
5155
5156 if ( matches[ sel ] === undefined ) {
5157 matches[ sel ] = handleObj.needsContext ?
5158 jQuery( sel, this ).index( cur ) > -1 :
5159 jQuery.find( sel, this, null, [ cur ] ).length;
5160 }
5161 if ( matches[ sel ] ) {
5162 matches.push( handleObj );
5163 }
5164 }
5165 if ( matches.length ) {
5166 handlerQueue.push( { elem: cur, handlers: matches } );
5167 }
5168 }
5169 }
5170 }
5171
5172 // Add the remaining (directly-bound) handlers
5173 if ( delegateCount < handlers.length ) {
5174 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
5175 }
5176
5177 return handlerQueue;
5178 },
5179
5180 addProp: function( name, hook ) {
5181 Object.defineProperty( jQuery.Event.prototype, name, {
5182 enumerable: true,
5183 configurable: true,
5184
5185 get: jQuery.isFunction( hook ) ?
5186 function() {
5187 if ( this.originalEvent ) {
5188 return hook( this.originalEvent );
5189 }
5190 } :
5191 function() {
5192 if ( this.originalEvent ) {
5193 return this.originalEvent[ name ];
5194 }
5195 },
5196
5197 set: function( value ) {
5198 Object.defineProperty( this, name, {
5199 enumerable: true,
5200 configurable: true,
5201 writable: true,
5202 value: value
5203 } );
5204 }
5205 } );
5206 },
5207
5208 fix: function( originalEvent ) {
5209 return originalEvent[ jQuery.expando ] ?
5210 originalEvent :
5211 new jQuery.Event( originalEvent );
5212 },
5213
5214 special: {
5215 load: {
5216
5217 // Prevent triggered image.load events from bubbling to window.load
5218 noBubble: true
5219 },
5220 focus: {
5221
5222 // Fire native event if possible so blur/focus sequence is correct
5223 trigger: function() {
5224 if ( this !== safeActiveElement() && this.focus ) {
5225 this.focus();
5226 return false;
5227 }
5228 },
5229 delegateType: "focusin"
5230 },
5231 blur: {
5232 trigger: function() {
5233 if ( this === safeActiveElement() && this.blur ) {
5234 this.blur();
5235 return false;
5236 }
5237 },
5238 delegateType: "focusout"
5239 },
5240 click: {
5241
5242 // For checkbox, fire native event so checked state will be right
5243 trigger: function() {
5244 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
5245 this.click();
5246 return false;
5247 }
5248 },
5249
5250 // For cross-browser consistency, don't fire native .click() on links
5251 _default: function( event ) {
5252 return jQuery.nodeName( event.target, "a" );
5253 }
5254 },
5255
5256 beforeunload: {
5257 postDispatch: function( event ) {
5258
5259 // Support: Firefox 20+
5260 // Firefox doesn't alert if the returnValue field is not set.
5261 if ( event.result !== undefined && event.originalEvent ) {
5262 event.originalEvent.returnValue = event.result;
5263 }
5264 }
5265 }
5266 }
5267 };
5268
5269 jQuery.removeEvent = function( elem, type, handle ) {
5270
5271 // This "if" is needed for plain objects
5272 if ( elem.removeEventListener ) {
5273 elem.removeEventListener( type, handle );
5274 }
5275 };
5276
5277 jQuery.Event = function( src, props ) {
5278
5279 // Allow instantiation without the 'new' keyword
5280 if ( !( this instanceof jQuery.Event ) ) {
5281 return new jQuery.Event( src, props );
5282 }
5283
5284 // Event object
5285 if ( src && src.type ) {
5286 this.originalEvent = src;
5287 this.type = src.type;
5288
5289 // Events bubbling up the document may have been marked as prevented
5290 // by a handler lower down the tree; reflect the correct value.
5291 this.isDefaultPrevented = src.defaultPrevented ||
5292 src.defaultPrevented === undefined &&
5293
5294 // Support: Android <=2.3 only
5295 src.returnValue === false ?
5296 returnTrue :
5297 returnFalse;
5298
5299 // Create target properties
5300 // Support: Safari <=6 - 7 only
5301 // Target should not be a text node (#504, #13143)
5302 this.target = ( src.target && src.target.nodeType === 3 ) ?
5303 src.target.parentNode :
5304 src.target;
5305
5306 this.currentTarget = src.currentTarget;
5307 this.relatedTarget = src.relatedTarget;
5308
5309 // Event type
5310 } else {
5311 this.type = src;
5312 }
5313
5314 // Put explicitly provided properties onto the event object
5315 if ( props ) {
5316 jQuery.extend( this, props );
5317 }
5318
5319 // Create a timestamp if incoming event doesn't have one
5320 this.timeStamp = src && src.timeStamp || jQuery.now();
5321
5322 // Mark it as fixed
5323 this[ jQuery.expando ] = true;
5324 };
5325
5326 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5327 // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5328 jQuery.Event.prototype = {
5329 constructor: jQuery.Event,
5330 isDefaultPrevented: returnFalse,
5331 isPropagationStopped: returnFalse,
5332 isImmediatePropagationStopped: returnFalse,
5333 isSimulated: false,
5334
5335 preventDefault: function() {
5336 var e = this.originalEvent;
5337
5338 this.isDefaultPrevented = returnTrue;
5339
5340 if ( e && !this.isSimulated ) {
5341 e.preventDefault();
5342 }
5343 },
5344 stopPropagation: function() {
5345 var e = this.originalEvent;
5346
5347 this.isPropagationStopped = returnTrue;
5348
5349 if ( e && !this.isSimulated ) {
5350 e.stopPropagation();
5351 }
5352 },
5353 stopImmediatePropagation: function() {
5354 var e = this.originalEvent;
5355
5356 this.isImmediatePropagationStopped = returnTrue;
5357
5358 if ( e && !this.isSimulated ) {
5359 e.stopImmediatePropagation();
5360 }
5361
5362 this.stopPropagation();
5363 }
5364 };
5365
5366 // Includes all common event props including KeyEvent and MouseEvent specific props
5367 jQuery.each( {
5368 altKey: true,
5369 bubbles: true,
5370 cancelable: true,
5371 changedTouches: true,
5372 ctrlKey: true,
5373 detail: true,
5374 eventPhase: true,
5375 metaKey: true,
5376 pageX: true,
5377 pageY: true,
5378 shiftKey: true,
5379 view: true,
5380 "char": true,
5381 charCode: true,
5382 key: true,
5383 keyCode: true,
5384 button: true,
5385 buttons: true,
5386 clientX: true,
5387 clientY: true,
5388 offsetX: true,
5389 offsetY: true,
5390 pointerId: true,
5391 pointerType: true,
5392 screenX: true,
5393 screenY: true,
5394 targetTouches: true,
5395 toElement: true,
5396 touches: true,
5397
5398 which: function( event ) {
5399 var button = event.button;
5400
5401 // Add which for key events
5402 if ( event.which == null && rkeyEvent.test( event.type ) ) {
5403 return event.charCode != null ? event.charCode : event.keyCode;
5404 }
5405
5406 // Add which for click: 1 === left; 2 === middle; 3 === right
5407 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5408 return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
5409 }
5410
5411 return event.which;
5412 }
5413 }, jQuery.event.addProp );
5414
5415 // Create mouseenter/leave events using mouseover/out and event-time checks
5416 // so that event delegation works in jQuery.
5417 // Do the same for pointerenter/pointerleave and pointerover/pointerout
5418 //
5419 // Support: Safari 7 only
5420 // Safari sends mouseenter too often; see:
5421 // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5422 // for the description of the bug (it existed in older Chrome versions as well).
5423 jQuery.each( {
5424 mouseenter: "mouseover",
5425 mouseleave: "mouseout",
5426 pointerenter: "pointerover",
5427 pointerleave: "pointerout"
5428 }, function( orig, fix ) {
5429 jQuery.event.special[ orig ] = {
5430 delegateType: fix,
5431 bindType: fix,
5432
5433 handle: function( event ) {
5434 var ret,
5435 target = this,
5436 related = event.relatedTarget,
5437 handleObj = event.handleObj;
5438
5439 // For mouseenter/leave call the handler if related is outside the target.
5440 // NB: No relatedTarget if the mouse left/entered the browser window
5441 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5442 event.type = handleObj.origType;
5443 ret = handleObj.handler.apply( this, arguments );
5444 event.type = fix;
5445 }
5446 return ret;
5447 }
5448 };
5449 } );
5450
5451 jQuery.fn.extend( {
5452
5453 on: function( types, selector, data, fn ) {
5454 return on( this, types, selector, data, fn );
5455 },
5456 one: function( types, selector, data, fn ) {
5457 return on( this, types, selector, data, fn, 1 );
5458 },
5459 off: function( types, selector, fn ) {
5460 var handleObj, type;
5461 if ( types && types.preventDefault && types.handleObj ) {
5462
5463 // ( event ) dispatched jQuery.Event
5464 handleObj = types.handleObj;
5465 jQuery( types.delegateTarget ).off(
5466 handleObj.namespace ?
5467 handleObj.origType + "." + handleObj.namespace :
5468 handleObj.origType,
5469 handleObj.selector,
5470 handleObj.handler
5471 );
5472 return this;
5473 }
5474 if ( typeof types === "object" ) {
5475
5476 // ( types-object [, selector] )
5477 for ( type in types ) {
5478 this.off( type, selector, types[ type ] );
5479 }
5480 return this;
5481 }
5482 if ( selector === false || typeof selector === "function" ) {
5483
5484 // ( types [, fn] )
5485 fn = selector;
5486 selector = undefined;
5487 }
5488 if ( fn === false ) {
5489 fn = returnFalse;
5490 }
5491 return this.each( function() {
5492 jQuery.event.remove( this, types, fn, selector );
5493 } );
5494 }
5495 } );
5496
5497
5498 var
5499
5500 /* eslint-disable max-len */
5501
5502 // See https://github.com/eslint/eslint/issues/3229
5503 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5504
5505 /* eslint-enable */
5506
5507 // Support: IE <=10 - 11, Edge 12 - 13
5508 // In IE/Edge using regex groups here causes severe slowdowns.
5509 // See https://connect.microsoft.com/IE/feedback/details/1736512/
5510 rnoInnerhtml = /<script|<style|<link/i,
5511
5512 // checked="checked" or checked
5513 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5514 rscriptTypeMasked = /^true\/(.*)/,
5515 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5516
5517 function manipulationTarget( elem, content ) {
5518 if ( jQuery.nodeName( elem, "table" ) &&
5519 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
5520
5521 return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
5522 }
5523
5524 return elem;
5525 }
5526
5527 // Replace/restore the type attribute of script elements for safe DOM manipulation
5528 function disableScript( elem ) {
5529 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5530 return elem;
5531 }
5532 function restoreScript( elem ) {
5533 var match = rscriptTypeMasked.exec( elem.type );
5534
5535 if ( match ) {
5536 elem.type = match[ 1 ];
5537 } else {
5538 elem.removeAttribute( "type" );
5539 }
5540
5541 return elem;
5542 }
5543
5544 function cloneCopyEvent( src, dest ) {
5545 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5546
5547 if ( dest.nodeType !== 1 ) {
5548 return;
5549 }
5550
5551 // 1. Copy private data: events, handlers, etc.
5552 if ( dataPriv.hasData( src ) ) {
5553 pdataOld = dataPriv.access( src );
5554 pdataCur = dataPriv.set( dest, pdataOld );
5555 events = pdataOld.events;
5556
5557 if ( events ) {
5558 delete pdataCur.handle;
5559 pdataCur.events = {};
5560
5561 for ( type in events ) {
5562 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5563 jQuery.event.add( dest, type, events[ type ][ i ] );
5564 }
5565 }
5566 }
5567 }
5568
5569 // 2. Copy user data
5570 if ( dataUser.hasData( src ) ) {
5571 udataOld = dataUser.access( src );
5572 udataCur = jQuery.extend( {}, udataOld );
5573
5574 dataUser.set( dest, udataCur );
5575 }
5576 }
5577
5578 // Fix IE bugs, see support tests
5579 function fixInput( src, dest ) {
5580 var nodeName = dest.nodeName.toLowerCase();
5581
5582 // Fails to persist the checked state of a cloned checkbox or radio button.
5583 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5584 dest.checked = src.checked;
5585
5586 // Fails to return the selected option to the default selected state when cloning options
5587 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5588 dest.defaultValue = src.defaultValue;
5589 }
5590 }
5591
5592 function domManip( collection, args, callback, ignored ) {
5593
5594 // Flatten any nested arrays
5595 args = concat.apply( [], args );
5596
5597 var fragment, first, scripts, hasScripts, node, doc,
5598 i = 0,
5599 l = collection.length,
5600 iNoClone = l - 1,
5601 value = args[ 0 ],
5602 isFunction = jQuery.isFunction( value );
5603
5604 // We can't cloneNode fragments that contain checked, in WebKit
5605 if ( isFunction ||
5606 ( l > 1 && typeof value === "string" &&
5607 !support.checkClone && rchecked.test( value ) ) ) {
5608 return collection.each( function( index ) {
5609 var self = collection.eq( index );
5610 if ( isFunction ) {
5611 args[ 0 ] = value.call( this, index, self.html() );
5612 }
5613 domManip( self, args, callback, ignored );
5614 } );
5615 }
5616
5617 if ( l ) {
5618 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
5619 first = fragment.firstChild;
5620
5621 if ( fragment.childNodes.length === 1 ) {
5622 fragment = first;
5623 }
5624
5625 // Require either new content or an interest in ignored elements to invoke the callback
5626 if ( first || ignored ) {
5627 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5628 hasScripts = scripts.length;
5629
5630 // Use the original fragment for the last item
5631 // instead of the first because it can end up
5632 // being emptied incorrectly in certain situations (#8070).
5633 for ( ; i < l; i++ ) {
5634 node = fragment;
5635
5636 if ( i !== iNoClone ) {
5637 node = jQuery.clone( node, true, true );
5638
5639 // Keep references to cloned scripts for later restoration
5640 if ( hasScripts ) {
5641
5642 // Support: Android <=4.0 only, PhantomJS 1 only
5643 // push.apply(_, arraylike) throws on ancient WebKit
5644 jQuery.merge( scripts, getAll( node, "script" ) );
5645 }
5646 }
5647
5648 callback.call( collection[ i ], node, i );
5649 }
5650
5651 if ( hasScripts ) {
5652 doc = scripts[ scripts.length - 1 ].ownerDocument;
5653
5654 // Reenable scripts
5655 jQuery.map( scripts, restoreScript );
5656
5657 // Evaluate executable scripts on first document insertion
5658 for ( i = 0; i < hasScripts; i++ ) {
5659 node = scripts[ i ];
5660 if ( rscriptType.test( node.type || "" ) &&
5661 !dataPriv.access( node, "globalEval" ) &&
5662 jQuery.contains( doc, node ) ) {
5663
5664 if ( node.src ) {
5665
5666 // Optional AJAX dependency, but won't run scripts if not present
5667 if ( jQuery._evalUrl ) {
5668 jQuery._evalUrl( node.src );
5669 }
5670 } else {
5671 DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
5672 }
5673 }
5674 }
5675 }
5676 }
5677 }
5678
5679 return collection;
5680 }
5681
5682 function remove( elem, selector, keepData ) {
5683 var node,
5684 nodes = selector ? jQuery.filter( selector, elem ) : elem,
5685 i = 0;
5686
5687 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
5688 if ( !keepData && node.nodeType === 1 ) {
5689 jQuery.cleanData( getAll( node ) );
5690 }
5691
5692 if ( node.parentNode ) {
5693 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
5694 setGlobalEval( getAll( node, "script" ) );
5695 }
5696 node.parentNode.removeChild( node );
5697 }
5698 }
5699
5700 return elem;
5701 }
5702
5703 jQuery.extend( {
5704 htmlPrefilter: function( html ) {
5705 return html.replace( rxhtmlTag, "<$1></$2>" );
5706 },
5707
5708 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5709 var i, l, srcElements, destElements,
5710 clone = elem.cloneNode( true ),
5711 inPage = jQuery.contains( elem.ownerDocument, elem );
5712
5713 // Fix IE cloning issues
5714 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
5715 !jQuery.isXMLDoc( elem ) ) {
5716
5717 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
5718 destElements = getAll( clone );
5719 srcElements = getAll( elem );
5720
5721 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5722 fixInput( srcElements[ i ], destElements[ i ] );
5723 }
5724 }
5725
5726 // Copy the events from the original to the clone
5727 if ( dataAndEvents ) {
5728 if ( deepDataAndEvents ) {
5729 srcElements = srcElements || getAll( elem );
5730 destElements = destElements || getAll( clone );
5731
5732 for ( i = 0, l = srcElements.length; i < l; i++ ) {
5733 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
5734 }
5735 } else {
5736 cloneCopyEvent( elem, clone );
5737 }
5738 }
5739
5740 // Preserve script evaluation history
5741 destElements = getAll( clone, "script" );
5742 if ( destElements.length > 0 ) {
5743 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5744 }
5745
5746 // Return the cloned set
5747 return clone;
5748 },
5749
5750 cleanData: function( elems ) {
5751 var data, elem, type,
5752 special = jQuery.event.special,
5753 i = 0;
5754
5755 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
5756 if ( acceptData( elem ) ) {
5757 if ( ( data = elem[ dataPriv.expando ] ) ) {
5758 if ( data.events ) {
5759 for ( type in data.events ) {
5760 if ( special[ type ] ) {
5761 jQuery.event.remove( elem, type );
5762
5763 // This is a shortcut to avoid jQuery.event.remove's overhead
5764 } else {
5765 jQuery.removeEvent( elem, type, data.handle );
5766 }
5767 }
5768 }
5769
5770 // Support: Chrome <=35 - 45+
5771 // Assign undefined instead of using delete, see Data#remove
5772 elem[ dataPriv.expando ] = undefined;
5773 }
5774 if ( elem[ dataUser.expando ] ) {
5775
5776 // Support: Chrome <=35 - 45+
5777 // Assign undefined instead of using delete, see Data#remove
5778 elem[ dataUser.expando ] = undefined;
5779 }
5780 }
5781 }
5782 }
5783 } );
5784
5785 jQuery.fn.extend( {
5786 detach: function( selector ) {
5787 return remove( this, selector, true );
5788 },
5789
5790 remove: function( selector ) {
5791 return remove( this, selector );
5792 },
5793
5794 text: function( value ) {
5795 return access( this, function( value ) {
5796 return value === undefined ?
5797 jQuery.text( this ) :
5798 this.empty().each( function() {
5799 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5800 this.textContent = value;
5801 }
5802 } );
5803 }, null, value, arguments.length );
5804 },
5805
5806 append: function() {
5807 return domManip( this, arguments, function( elem ) {
5808 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5809 var target = manipulationTarget( this, elem );
5810 target.appendChild( elem );
5811 }
5812 } );
5813 },
5814
5815 prepend: function() {
5816 return domManip( this, arguments, function( elem ) {
5817 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5818 var target = manipulationTarget( this, elem );
5819 target.insertBefore( elem, target.firstChild );
5820 }
5821 } );
5822 },
5823
5824 before: function() {
5825 return domManip( this, arguments, function( elem ) {
5826 if ( this.parentNode ) {
5827 this.parentNode.insertBefore( elem, this );
5828 }
5829 } );
5830 },
5831
5832 after: function() {
5833 return domManip( this, arguments, function( elem ) {
5834 if ( this.parentNode ) {
5835 this.parentNode.insertBefore( elem, this.nextSibling );
5836 }
5837 } );
5838 },
5839
5840 empty: function() {
5841 var elem,
5842 i = 0;
5843
5844 for ( ; ( elem = this[ i ] ) != null; i++ ) {
5845 if ( elem.nodeType === 1 ) {
5846
5847 // Prevent memory leaks
5848 jQuery.cleanData( getAll( elem, false ) );
5849
5850 // Remove any remaining nodes
5851 elem.textContent = "";
5852 }
5853 }
5854
5855 return this;
5856 },
5857
5858 clone: function( dataAndEvents, deepDataAndEvents ) {
5859 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5860 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5861
5862 return this.map( function() {
5863 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5864 } );
5865 },
5866
5867 html: function( value ) {
5868 return access( this, function( value ) {
5869 var elem = this[ 0 ] || {},
5870 i = 0,
5871 l = this.length;
5872
5873 if ( value === undefined && elem.nodeType === 1 ) {
5874 return elem.innerHTML;
5875 }
5876
5877 // See if we can take a shortcut and just use innerHTML
5878 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5879 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
5880
5881 value = jQuery.htmlPrefilter( value );
5882
5883 try {
5884 for ( ; i < l; i++ ) {
5885 elem = this[ i ] || {};
5886
5887 // Remove element nodes and prevent memory leaks
5888 if ( elem.nodeType === 1 ) {
5889 jQuery.cleanData( getAll( elem, false ) );
5890 elem.innerHTML = value;
5891 }
5892 }
5893
5894 elem = 0;
5895
5896 // If using innerHTML throws an exception, use the fallback method
5897 } catch ( e ) {}
5898 }
5899
5900 if ( elem ) {
5901 this.empty().append( value );
5902 }
5903 }, null, value, arguments.length );
5904 },
5905
5906 replaceWith: function() {
5907 var ignored = [];
5908
5909 // Make the changes, replacing each non-ignored context element with the new content
5910 return domManip( this, arguments, function( elem ) {
5911 var parent = this.parentNode;
5912
5913 if ( jQuery.inArray( this, ignored ) < 0 ) {
5914 jQuery.cleanData( getAll( this ) );
5915 if ( parent ) {
5916 parent.replaceChild( elem, this );
5917 }
5918 }
5919
5920 // Force callback invocation
5921 }, ignored );
5922 }
5923 } );
5924
5925 jQuery.each( {
5926 appendTo: "append",
5927 prependTo: "prepend",
5928 insertBefore: "before",
5929 insertAfter: "after",
5930 replaceAll: "replaceWith"
5931 }, function( name, original ) {
5932 jQuery.fn[ name ] = function( selector ) {
5933 var elems,
5934 ret = [],
5935 insert = jQuery( selector ),
5936 last = insert.length - 1,
5937 i = 0;
5938
5939 for ( ; i <= last; i++ ) {
5940 elems = i === last ? this : this.clone( true );
5941 jQuery( insert[ i ] )[ original ]( elems );
5942
5943 // Support: Android <=4.0 only, PhantomJS 1 only
5944 // .get() because push.apply(_, arraylike) throws on ancient WebKit
5945 push.apply( ret, elems.get() );
5946 }
5947
5948 return this.pushStack( ret );
5949 };
5950 } );
5951 var rmargin = ( /^margin/ );
5952
5953 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
5954
5955 var getStyles = function( elem ) {
5956
5957 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
5958 // IE throws on elements created in popups
5959 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
5960 var view = elem.ownerDocument.defaultView;
5961
5962 if ( !view || !view.opener ) {
5963 view = window;
5964 }
5965
5966 return view.getComputedStyle( elem );
5967 };
5968
5969
5970
5971 ( function() {
5972
5973 // Executing both pixelPosition & boxSizingReliable tests require only one layout
5974 // so they're executed at the same time to save the second computation.
5975 function computeStyleTests() {
5976
5977 // This is a singleton, we need to execute it only once
5978 if ( !div ) {
5979 return;
5980 }
5981
5982 div.style.cssText =
5983 "box-sizing:border-box;" +
5984 "position:relative;display:block;" +
5985 "margin:auto;border:1px;padding:1px;" +
5986 "top:1%;width:50%";
5987 div.innerHTML = "";
5988 documentElement.appendChild( container );
5989
5990 var divStyle = window.getComputedStyle( div );
5991 pixelPositionVal = divStyle.top !== "1%";
5992
5993 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
5994 reliableMarginLeftVal = divStyle.marginLeft === "2px";
5995 boxSizingReliableVal = divStyle.width === "4px";
5996
5997 // Support: Android 4.0 - 4.3 only
5998 // Some styles come back with percentage values, even though they shouldn't
5999 div.style.marginRight = "50%";
6000 pixelMarginRightVal = divStyle.marginRight === "4px";
6001
6002 documentElement.removeChild( container );
6003
6004 // Nullify the div so it wouldn't be stored in the memory and
6005 // it will also be a sign that checks already performed
6006 div = null;
6007 }
6008
6009 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
6010 container = document.createElement( "div" ),
6011 div = document.createElement( "div" );
6012
6013 // Finish early in limited (non-browser) environments
6014 if ( !div.style ) {
6015 return;
6016 }
6017
6018 // Support: IE <=9 - 11 only
6019 // Style of cloned element affects source element cloned (#8908)
6020 div.style.backgroundClip = "content-box";
6021 div.cloneNode( true ).style.backgroundClip = "";
6022 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6023
6024 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
6025 "padding:0;margin-top:1px;position:absolute";
6026 container.appendChild( div );
6027
6028 jQuery.extend( support, {
6029 pixelPosition: function() {
6030 computeStyleTests();
6031 return pixelPositionVal;
6032 },
6033 boxSizingReliable: function() {
6034 computeStyleTests();
6035 return boxSizingReliableVal;
6036 },
6037 pixelMarginRight: function() {
6038 computeStyleTests();
6039 return pixelMarginRightVal;
6040 },
6041 reliableMarginLeft: function() {
6042 computeStyleTests();
6043 return reliableMarginLeftVal;
6044 }
6045 } );
6046 } )();
6047
6048
6049 function curCSS( elem, name, computed ) {
6050 var width, minWidth, maxWidth, ret,
6051 style = elem.style;
6052
6053 computed = computed || getStyles( elem );
6054
6055 // Support: IE <=9 only
6056 // getPropertyValue is only needed for .css('filter') (#12537)
6057 if ( computed ) {
6058 ret = computed.getPropertyValue( name ) || computed[ name ];
6059
6060 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6061 ret = jQuery.style( elem, name );
6062 }
6063
6064 // A tribute to the "awesome hack by Dean Edwards"
6065 // Android Browser returns percentage for some values,
6066 // but width seems to be reliably pixels.
6067 // This is against the CSSOM draft spec:
6068 // https://drafts.csswg.org/cssom/#resolved-values
6069 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6070
6071 // Remember the original values
6072 width = style.width;
6073 minWidth = style.minWidth;
6074 maxWidth = style.maxWidth;
6075
6076 // Put in the new values to get a computed value out
6077 style.minWidth = style.maxWidth = style.width = ret;
6078 ret = computed.width;
6079
6080 // Revert the changed values
6081 style.width = width;
6082 style.minWidth = minWidth;
6083 style.maxWidth = maxWidth;
6084 }
6085 }
6086
6087 return ret !== undefined ?
6088
6089 // Support: IE <=9 - 11 only
6090 // IE returns zIndex value as an integer.
6091 ret + "" :
6092 ret;
6093 }
6094
6095
6096 function addGetHookIf( conditionFn, hookFn ) {
6097
6098 // Define the hook, we'll check on the first run if it's really needed.
6099 return {
6100 get: function() {
6101 if ( conditionFn() ) {
6102
6103 // Hook not needed (or it's not possible to use it due
6104 // to missing dependency), remove it.
6105 delete this.get;
6106 return;
6107 }
6108
6109 // Hook needed; redefine it so that the support test is not executed again.
6110 return ( this.get = hookFn ).apply( this, arguments );
6111 }
6112 };
6113 }
6114
6115
6116 var
6117
6118 // Swappable if display is none or starts with table
6119 // except "table", "table-cell", or "table-caption"
6120 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6121 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6122 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6123 cssNormalTransform = {
6124 letterSpacing: "0",
6125 fontWeight: "400"
6126 },
6127
6128 cssPrefixes = [ "Webkit", "Moz", "ms" ],
6129 emptyStyle = document.createElement( "div" ).style;
6130
6131 // Return a css property mapped to a potentially vendor prefixed property
6132 function vendorPropName( name ) {
6133
6134 // Shortcut for names that are not vendor prefixed
6135 if ( name in emptyStyle ) {
6136 return name;
6137 }
6138
6139 // Check for vendor prefixed names
6140 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
6141 i = cssPrefixes.length;
6142
6143 while ( i-- ) {
6144 name = cssPrefixes[ i ] + capName;
6145 if ( name in emptyStyle ) {
6146 return name;
6147 }
6148 }
6149 }
6150
6151 function setPositiveNumber( elem, value, subtract ) {
6152
6153 // Any relative (+/-) values have already been
6154 // normalized at this point
6155 var matches = rcssNum.exec( value );
6156 return matches ?
6157
6158 // Guard against undefined "subtract", e.g., when used as in cssHooks
6159 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
6160 value;
6161 }
6162
6163 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6164 var i = extra === ( isBorderBox ? "border" : "content" ) ?
6165
6166 // If we already have the right measurement, avoid augmentation
6167 4 :
6168
6169 // Otherwise initialize for horizontal or vertical properties
6170 name === "width" ? 1 : 0,
6171
6172 val = 0;
6173
6174 for ( ; i < 4; i += 2 ) {
6175
6176 // Both box models exclude margin, so add it if we want it
6177 if ( extra === "margin" ) {
6178 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6179 }
6180
6181 if ( isBorderBox ) {
6182
6183 // border-box includes padding, so remove it if we want content
6184 if ( extra === "content" ) {
6185 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6186 }
6187
6188 // At this point, extra isn't border nor margin, so remove border
6189 if ( extra !== "margin" ) {
6190 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6191 }
6192 } else {
6193
6194 // At this point, extra isn't content, so add padding
6195 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6196
6197 // At this point, extra isn't content nor padding, so add border
6198 if ( extra !== "padding" ) {
6199 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6200 }
6201 }
6202 }
6203
6204 return val;
6205 }
6206
6207 function getWidthOrHeight( elem, name, extra ) {
6208
6209 // Start with offset property, which is equivalent to the border-box value
6210 var val,
6211 valueIsBorderBox = true,
6212 styles = getStyles( elem ),
6213 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6214
6215 // Support: IE <=11 only
6216 // Running getBoundingClientRect on a disconnected node
6217 // in IE throws an error.
6218 if ( elem.getClientRects().length ) {
6219 val = elem.getBoundingClientRect()[ name ];
6220 }
6221
6222 // Some non-html elements return undefined for offsetWidth, so check for null/undefined
6223 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6224 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6225 if ( val <= 0 || val == null ) {
6226
6227 // Fall back to computed then uncomputed css if necessary
6228 val = curCSS( elem, name, styles );
6229 if ( val < 0 || val == null ) {
6230 val = elem.style[ name ];
6231 }
6232
6233 // Computed unit is not pixels. Stop here and return.
6234 if ( rnumnonpx.test( val ) ) {
6235 return val;
6236 }
6237
6238 // Check for style in case a browser which returns unreliable values
6239 // for getComputedStyle silently falls back to the reliable elem.style
6240 valueIsBorderBox = isBorderBox &&
6241 ( support.boxSizingReliable() || val === elem.style[ name ] );
6242
6243 // Normalize "", auto, and prepare for extra
6244 val = parseFloat( val ) || 0;
6245 }
6246
6247 // Use the active box-sizing model to add/subtract irrelevant styles
6248 return ( val +
6249 augmentWidthOrHeight(
6250 elem,
6251 name,
6252 extra || ( isBorderBox ? "border" : "content" ),
6253 valueIsBorderBox,
6254 styles
6255 )
6256 ) + "px";
6257 }
6258
6259 jQuery.extend( {
6260
6261 // Add in style property hooks for overriding the default
6262 // behavior of getting and setting a style property
6263 cssHooks: {
6264 opacity: {
6265 get: function( elem, computed ) {
6266 if ( computed ) {
6267
6268 // We should always get a number back from opacity
6269 var ret = curCSS( elem, "opacity" );
6270 return ret === "" ? "1" : ret;
6271 }
6272 }
6273 }
6274 },
6275
6276 // Don't automatically add "px" to these possibly-unitless properties
6277 cssNumber: {
6278 "animationIterationCount": true,
6279 "columnCount": true,
6280 "fillOpacity": true,
6281 "flexGrow": true,
6282 "flexShrink": true,
6283 "fontWeight": true,
6284 "lineHeight": true,
6285 "opacity": true,
6286 "order": true,
6287 "orphans": true,
6288 "widows": true,
6289 "zIndex": true,
6290 "zoom": true
6291 },
6292
6293 // Add in properties whose names you wish to fix before
6294 // setting or getting the value
6295 cssProps: {
6296 "float": "cssFloat"
6297 },
6298
6299 // Get and set the style property on a DOM Node
6300 style: function( elem, name, value, extra ) {
6301
6302 // Don't set styles on text and comment nodes
6303 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6304 return;
6305 }
6306
6307 // Make sure that we're working with the right name
6308 var ret, type, hooks,
6309 origName = jQuery.camelCase( name ),
6310 style = elem.style;
6311
6312 name = jQuery.cssProps[ origName ] ||
6313 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6314
6315 // Gets hook for the prefixed version, then unprefixed version
6316 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6317
6318 // Check if we're setting a value
6319 if ( value !== undefined ) {
6320 type = typeof value;
6321
6322 // Convert "+=" or "-=" to relative numbers (#7345)
6323 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6324 value = adjustCSS( elem, name, ret );
6325
6326 // Fixes bug #9237
6327 type = "number";
6328 }
6329
6330 // Make sure that null and NaN values aren't set (#7116)
6331 if ( value == null || value !== value ) {
6332 return;
6333 }
6334
6335 // If a number was passed in, add the unit (except for certain CSS properties)
6336 if ( type === "number" ) {
6337 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
6338 }
6339
6340 // background-* props affect original clone's values
6341 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
6342 style[ name ] = "inherit";
6343 }
6344
6345 // If a hook was provided, use that value, otherwise just set the specified value
6346 if ( !hooks || !( "set" in hooks ) ||
6347 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6348
6349 style[ name ] = value;
6350 }
6351
6352 } else {
6353
6354 // If a hook was provided get the non-computed value from there
6355 if ( hooks && "get" in hooks &&
6356 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
6357
6358 return ret;
6359 }
6360
6361 // Otherwise just get the value from the style object
6362 return style[ name ];
6363 }
6364 },
6365
6366 css: function( elem, name, extra, styles ) {
6367 var val, num, hooks,
6368 origName = jQuery.camelCase( name );
6369
6370 // Make sure that we're working with the right name
6371 name = jQuery.cssProps[ origName ] ||
6372 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
6373
6374 // Try prefixed name followed by the unprefixed name
6375 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6376
6377 // If a hook was provided get the computed value from there
6378 if ( hooks && "get" in hooks ) {
6379 val = hooks.get( elem, true, extra );
6380 }
6381
6382 // Otherwise, if a way to get the computed value exists, use that
6383 if ( val === undefined ) {
6384 val = curCSS( elem, name, styles );
6385 }
6386
6387 // Convert "normal" to computed value
6388 if ( val === "normal" && name in cssNormalTransform ) {
6389 val = cssNormalTransform[ name ];
6390 }
6391
6392 // Make numeric if forced or a qualifier was provided and val looks numeric
6393 if ( extra === "" || extra ) {
6394 num = parseFloat( val );
6395 return extra === true || isFinite( num ) ? num || 0 : val;
6396 }
6397 return val;
6398 }
6399 } );
6400
6401 jQuery.each( [ "height", "width" ], function( i, name ) {
6402 jQuery.cssHooks[ name ] = {
6403 get: function( elem, computed, extra ) {
6404 if ( computed ) {
6405
6406 // Certain elements can have dimension info if we invisibly show them
6407 // but it must have a current display style that would benefit
6408 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
6409
6410 // Support: Safari 8+
6411 // Table columns in Safari have non-zero offsetWidth & zero
6412 // getBoundingClientRect().width unless display is changed.
6413 // Support: IE <=11 only
6414 // Running getBoundingClientRect on a disconnected node
6415 // in IE throws an error.
6416 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
6417 swap( elem, cssShow, function() {
6418 return getWidthOrHeight( elem, name, extra );
6419 } ) :
6420 getWidthOrHeight( elem, name, extra );
6421 }
6422 },
6423
6424 set: function( elem, value, extra ) {
6425 var matches,
6426 styles = extra && getStyles( elem ),
6427 subtract = extra && augmentWidthOrHeight(
6428 elem,
6429 name,
6430 extra,
6431 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6432 styles
6433 );
6434
6435 // Convert to pixels if value adjustment is needed
6436 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6437 ( matches[ 3 ] || "px" ) !== "px" ) {
6438
6439 elem.style[ name ] = value;
6440 value = jQuery.css( elem, name );
6441 }
6442
6443 return setPositiveNumber( elem, value, subtract );
6444 }
6445 };
6446 } );
6447
6448 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6449 function( elem, computed ) {
6450 if ( computed ) {
6451 return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
6452 elem.getBoundingClientRect().left -
6453 swap( elem, { marginLeft: 0 }, function() {
6454 return elem.getBoundingClientRect().left;
6455 } )
6456 ) + "px";
6457 }
6458 }
6459 );
6460
6461 // These hooks are used by animate to expand properties
6462 jQuery.each( {
6463 margin: "",
6464 padding: "",
6465 border: "Width"
6466 }, function( prefix, suffix ) {
6467 jQuery.cssHooks[ prefix + suffix ] = {
6468 expand: function( value ) {
6469 var i = 0,
6470 expanded = {},
6471
6472 // Assumes a single number if not a string
6473 parts = typeof value === "string" ? value.split( " " ) : [ value ];
6474
6475 for ( ; i < 4; i++ ) {
6476 expanded[ prefix + cssExpand[ i ] + suffix ] =
6477 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6478 }
6479
6480 return expanded;
6481 }
6482 };
6483
6484 if ( !rmargin.test( prefix ) ) {
6485 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6486 }
6487 } );
6488
6489 jQuery.fn.extend( {
6490 css: function( name, value ) {
6491 return access( this, function( elem, name, value ) {
6492 var styles, len,
6493 map = {},
6494 i = 0;
6495
6496 if ( jQuery.isArray( name ) ) {
6497 styles = getStyles( elem );
6498 len = name.length;
6499
6500 for ( ; i < len; i++ ) {
6501 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6502 }
6503
6504 return map;
6505 }
6506
6507 return value !== undefined ?
6508 jQuery.style( elem, name, value ) :
6509 jQuery.css( elem, name );
6510 }, name, value, arguments.length > 1 );
6511 }
6512 } );
6513
6514
6515 function Tween( elem, options, prop, end, easing ) {
6516 return new Tween.prototype.init( elem, options, prop, end, easing );
6517 }
6518 jQuery.Tween = Tween;
6519
6520 Tween.prototype = {
6521 constructor: Tween,
6522 init: function( elem, options, prop, end, easing, unit ) {
6523 this.elem = elem;
6524 this.prop = prop;
6525 this.easing = easing || jQuery.easing._default;
6526 this.options = options;
6527 this.start = this.now = this.cur();
6528 this.end = end;
6529 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6530 },
6531 cur: function() {
6532 var hooks = Tween.propHooks[ this.prop ];
6533
6534 return hooks && hooks.get ?
6535 hooks.get( this ) :
6536 Tween.propHooks._default.get( this );
6537 },
6538 run: function( percent ) {
6539 var eased,
6540 hooks = Tween.propHooks[ this.prop ];
6541
6542 if ( this.options.duration ) {
6543 this.pos = eased = jQuery.easing[ this.easing ](
6544 percent, this.options.duration * percent, 0, 1, this.options.duration
6545 );
6546 } else {
6547 this.pos = eased = percent;
6548 }
6549 this.now = ( this.end - this.start ) * eased + this.start;
6550
6551 if ( this.options.step ) {
6552 this.options.step.call( this.elem, this.now, this );
6553 }
6554
6555 if ( hooks && hooks.set ) {
6556 hooks.set( this );
6557 } else {
6558 Tween.propHooks._default.set( this );
6559 }
6560 return this;
6561 }
6562 };
6563
6564 Tween.prototype.init.prototype = Tween.prototype;
6565
6566 Tween.propHooks = {
6567 _default: {
6568 get: function( tween ) {
6569 var result;
6570
6571 // Use a property on the element directly when it is not a DOM element,
6572 // or when there is no matching style property that exists.
6573 if ( tween.elem.nodeType !== 1 ||
6574 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
6575 return tween.elem[ tween.prop ];
6576 }
6577
6578 // Passing an empty string as a 3rd parameter to .css will automatically
6579 // attempt a parseFloat and fallback to a string if the parse fails.
6580 // Simple values such as "10px" are parsed to Float;
6581 // complex values such as "rotate(1rad)" are returned as-is.
6582 result = jQuery.css( tween.elem, tween.prop, "" );
6583
6584 // Empty strings, null, undefined and "auto" are converted to 0.
6585 return !result || result === "auto" ? 0 : result;
6586 },
6587 set: function( tween ) {
6588
6589 // Use step hook for back compat.
6590 // Use cssHook if its there.
6591 // Use .style if available and use plain properties where available.
6592 if ( jQuery.fx.step[ tween.prop ] ) {
6593 jQuery.fx.step[ tween.prop ]( tween );
6594 } else if ( tween.elem.nodeType === 1 &&
6595 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
6596 jQuery.cssHooks[ tween.prop ] ) ) {
6597 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6598 } else {
6599 tween.elem[ tween.prop ] = tween.now;
6600 }
6601 }
6602 }
6603 };
6604
6605 // Support: IE <=9 only
6606 // Panic based approach to setting things on disconnected nodes
6607 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6608 set: function( tween ) {
6609 if ( tween.elem.nodeType && tween.elem.parentNode ) {
6610 tween.elem[ tween.prop ] = tween.now;
6611 }
6612 }
6613 };
6614
6615 jQuery.easing = {
6616 linear: function( p ) {
6617 return p;
6618 },
6619 swing: function( p ) {
6620 return 0.5 - Math.cos( p * Math.PI ) / 2;
6621 },
6622 _default: "swing"
6623 };
6624
6625 jQuery.fx = Tween.prototype.init;
6626
6627 // Back compat <1.8 extension point
6628 jQuery.fx.step = {};
6629
6630
6631
6632
6633 var
6634 fxNow, timerId,
6635 rfxtypes = /^(?:toggle|show|hide)$/,
6636 rrun = /queueHooks$/;
6637
6638 function raf() {
6639 if ( timerId ) {
6640 window.requestAnimationFrame( raf );
6641 jQuery.fx.tick();
6642 }
6643 }
6644
6645 // Animations created synchronously will run synchronously
6646 function createFxNow() {
6647 window.setTimeout( function() {
6648 fxNow = undefined;
6649 } );
6650 return ( fxNow = jQuery.now() );
6651 }
6652
6653 // Generate parameters to create a standard animation
6654 function genFx( type, includeWidth ) {
6655 var which,
6656 i = 0,
6657 attrs = { height: type };
6658
6659 // If we include width, step value is 1 to do all cssExpand values,
6660 // otherwise step value is 2 to skip over Left and Right
6661 includeWidth = includeWidth ? 1 : 0;
6662 for ( ; i < 4; i += 2 - includeWidth ) {
6663 which = cssExpand[ i ];
6664 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
6665 }
6666
6667 if ( includeWidth ) {
6668 attrs.opacity = attrs.width = type;
6669 }
6670
6671 return attrs;
6672 }
6673
6674 function createTween( value, prop, animation ) {
6675 var tween,
6676 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
6677 index = 0,
6678 length = collection.length;
6679 for ( ; index < length; index++ ) {
6680 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
6681
6682 // We're done with this property
6683 return tween;
6684 }
6685 }
6686 }
6687
6688 function defaultPrefilter( elem, props, opts ) {
6689 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
6690 isBox = "width" in props || "height" in props,
6691 anim = this,
6692 orig = {},
6693 style = elem.style,
6694 hidden = elem.nodeType && isHiddenWithinTree( elem ),
6695 dataShow = dataPriv.get( elem, "fxshow" );
6696
6697 // Queue-skipping animations hijack the fx hooks
6698 if ( !opts.queue ) {
6699 hooks = jQuery._queueHooks( elem, "fx" );
6700 if ( hooks.unqueued == null ) {
6701 hooks.unqueued = 0;
6702 oldfire = hooks.empty.fire;
6703 hooks.empty.fire = function() {
6704 if ( !hooks.unqueued ) {
6705 oldfire();
6706 }
6707 };
6708 }
6709 hooks.unqueued++;
6710
6711 anim.always( function() {
6712
6713 // Ensure the complete handler is called before this completes
6714 anim.always( function() {
6715 hooks.unqueued--;
6716 if ( !jQuery.queue( elem, "fx" ).length ) {
6717 hooks.empty.fire();
6718 }
6719 } );
6720 } );
6721 }
6722
6723 // Detect show/hide animations
6724 for ( prop in props ) {
6725 value = props[ prop ];
6726 if ( rfxtypes.test( value ) ) {
6727 delete props[ prop ];
6728 toggle = toggle || value === "toggle";
6729 if ( value === ( hidden ? "hide" : "show" ) ) {
6730
6731 // Pretend to be hidden if this is a "show" and
6732 // there is still data from a stopped show/hide
6733 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
6734 hidden = true;
6735
6736 // Ignore all other no-op show/hide data
6737 } else {
6738 continue;
6739 }
6740 }
6741 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
6742 }
6743 }
6744
6745 // Bail out if this is a no-op like .hide().hide()
6746 propTween = !jQuery.isEmptyObject( props );
6747 if ( !propTween && jQuery.isEmptyObject( orig ) ) {
6748 return;
6749 }
6750
6751 // Restrict "overflow" and "display" styles during box animations
6752 if ( isBox && elem.nodeType === 1 ) {
6753
6754 // Support: IE <=9 - 11, Edge 12 - 13
6755 // Record all 3 overflow attributes because IE does not infer the shorthand
6756 // from identically-valued overflowX and overflowY
6757 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
6758
6759 // Identify a display type, preferring old show/hide data over the CSS cascade
6760 restoreDisplay = dataShow && dataShow.display;
6761 if ( restoreDisplay == null ) {
6762 restoreDisplay = dataPriv.get( elem, "display" );
6763 }
6764 display = jQuery.css( elem, "display" );
6765 if ( display === "none" ) {
6766 if ( restoreDisplay ) {
6767 display = restoreDisplay;
6768 } else {
6769
6770 // Get nonempty value(s) by temporarily forcing visibility
6771 showHide( [ elem ], true );
6772 restoreDisplay = elem.style.display || restoreDisplay;
6773 display = jQuery.css( elem, "display" );
6774 showHide( [ elem ] );
6775 }
6776 }
6777
6778 // Animate inline elements as inline-block
6779 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
6780 if ( jQuery.css( elem, "float" ) === "none" ) {
6781
6782 // Restore the original display value at the end of pure show/hide animations
6783 if ( !propTween ) {
6784 anim.done( function() {
6785 style.display = restoreDisplay;
6786 } );
6787 if ( restoreDisplay == null ) {
6788 display = style.display;
6789 restoreDisplay = display === "none" ? "" : display;
6790 }
6791 }
6792 style.display = "inline-block";
6793 }
6794 }
6795 }
6796
6797 if ( opts.overflow ) {
6798 style.overflow = "hidden";
6799 anim.always( function() {
6800 style.overflow = opts.overflow[ 0 ];
6801 style.overflowX = opts.overflow[ 1 ];
6802 style.overflowY = opts.overflow[ 2 ];
6803 } );
6804 }
6805
6806 // Implement show/hide animations
6807 propTween = false;
6808 for ( prop in orig ) {
6809
6810 // General show/hide setup for this element animation
6811 if ( !propTween ) {
6812 if ( dataShow ) {
6813 if ( "hidden" in dataShow ) {
6814 hidden = dataShow.hidden;
6815 }
6816 } else {
6817 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
6818 }
6819
6820 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
6821 if ( toggle ) {
6822 dataShow.hidden = !hidden;
6823 }
6824
6825 // Show elements before animating them
6826 if ( hidden ) {
6827 showHide( [ elem ], true );
6828 }
6829
6830 /* eslint-disable no-loop-func */
6831
6832 anim.done( function() {
6833
6834 /* eslint-enable no-loop-func */
6835
6836 // The final step of a "hide" animation is actually hiding the element
6837 if ( !hidden ) {
6838 showHide( [ elem ] );
6839 }
6840 dataPriv.remove( elem, "fxshow" );
6841 for ( prop in orig ) {
6842 jQuery.style( elem, prop, orig[ prop ] );
6843 }
6844 } );
6845 }
6846
6847 // Per-property setup
6848 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
6849 if ( !( prop in dataShow ) ) {
6850 dataShow[ prop ] = propTween.start;
6851 if ( hidden ) {
6852 propTween.end = propTween.start;
6853 propTween.start = 0;
6854 }
6855 }
6856 }
6857 }
6858
6859 function propFilter( props, specialEasing ) {
6860 var index, name, easing, value, hooks;
6861
6862 // camelCase, specialEasing and expand cssHook pass
6863 for ( index in props ) {
6864 name = jQuery.camelCase( index );
6865 easing = specialEasing[ name ];
6866 value = props[ index ];
6867 if ( jQuery.isArray( value ) ) {
6868 easing = value[ 1 ];
6869 value = props[ index ] = value[ 0 ];
6870 }
6871
6872 if ( index !== name ) {
6873 props[ name ] = value;
6874 delete props[ index ];
6875 }
6876
6877 hooks = jQuery.cssHooks[ name ];
6878 if ( hooks && "expand" in hooks ) {
6879 value = hooks.expand( value );
6880 delete props[ name ];
6881
6882 // Not quite $.extend, this won't overwrite existing keys.
6883 // Reusing 'index' because we have the correct "name"
6884 for ( index in value ) {
6885 if ( !( index in props ) ) {
6886 props[ index ] = value[ index ];
6887 specialEasing[ index ] = easing;
6888 }
6889 }
6890 } else {
6891 specialEasing[ name ] = easing;
6892 }
6893 }
6894 }
6895
6896 function Animation( elem, properties, options ) {
6897 var result,
6898 stopped,
6899 index = 0,
6900 length = Animation.prefilters.length,
6901 deferred = jQuery.Deferred().always( function() {
6902
6903 // Don't match elem in the :animated selector
6904 delete tick.elem;
6905 } ),
6906 tick = function() {
6907 if ( stopped ) {
6908 return false;
6909 }
6910 var currentTime = fxNow || createFxNow(),
6911 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
6912
6913 // Support: Android 2.3 only
6914 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
6915 temp = remaining / animation.duration || 0,
6916 percent = 1 - temp,
6917 index = 0,
6918 length = animation.tweens.length;
6919
6920 for ( ; index < length; index++ ) {
6921 animation.tweens[ index ].run( percent );
6922 }
6923
6924 deferred.notifyWith( elem, [ animation, percent, remaining ] );
6925
6926 if ( percent < 1 && length ) {
6927 return remaining;
6928 } else {
6929 deferred.resolveWith( elem, [ animation ] );
6930 return false;
6931 }
6932 },
6933 animation = deferred.promise( {
6934 elem: elem,
6935 props: jQuery.extend( {}, properties ),
6936 opts: jQuery.extend( true, {
6937 specialEasing: {},
6938 easing: jQuery.easing._default
6939 }, options ),
6940 originalProperties: properties,
6941 originalOptions: options,
6942 startTime: fxNow || createFxNow(),
6943 duration: options.duration,
6944 tweens: [],
6945 createTween: function( prop, end ) {
6946 var tween = jQuery.Tween( elem, animation.opts, prop, end,
6947 animation.opts.specialEasing[ prop ] || animation.opts.easing );
6948 animation.tweens.push( tween );
6949 return tween;
6950 },
6951 stop: function( gotoEnd ) {
6952 var index = 0,
6953
6954 // If we are going to the end, we want to run all the tweens
6955 // otherwise we skip this part
6956 length = gotoEnd ? animation.tweens.length : 0;
6957 if ( stopped ) {
6958 return this;
6959 }
6960 stopped = true;
6961 for ( ; index < length; index++ ) {
6962 animation.tweens[ index ].run( 1 );
6963 }
6964
6965 // Resolve when we played the last frame; otherwise, reject
6966 if ( gotoEnd ) {
6967 deferred.notifyWith( elem, [ animation, 1, 0 ] );
6968 deferred.resolveWith( elem, [ animation, gotoEnd ] );
6969 } else {
6970 deferred.rejectWith( elem, [ animation, gotoEnd ] );
6971 }
6972 return this;
6973 }
6974 } ),
6975 props = animation.props;
6976
6977 propFilter( props, animation.opts.specialEasing );
6978
6979 for ( ; index < length; index++ ) {
6980 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
6981 if ( result ) {
6982 if ( jQuery.isFunction( result.stop ) ) {
6983 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
6984 jQuery.proxy( result.stop, result );
6985 }
6986 return result;
6987 }
6988 }
6989
6990 jQuery.map( props, createTween, animation );
6991
6992 if ( jQuery.isFunction( animation.opts.start ) ) {
6993 animation.opts.start.call( elem, animation );
6994 }
6995
6996 jQuery.fx.timer(
6997 jQuery.extend( tick, {
6998 elem: elem,
6999 anim: animation,
7000 queue: animation.opts.queue
7001 } )
7002 );
7003
7004 // attach callbacks from options
7005 return animation.progress( animation.opts.progress )
7006 .done( animation.opts.done, animation.opts.complete )
7007 .fail( animation.opts.fail )
7008 .always( animation.opts.always );
7009 }
7010
7011 jQuery.Animation = jQuery.extend( Animation, {
7012
7013 tweeners: {
7014 "*": [ function( prop, value ) {
7015 var tween = this.createTween( prop, value );
7016 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
7017 return tween;
7018 } ]
7019 },
7020
7021 tweener: function( props, callback ) {
7022 if ( jQuery.isFunction( props ) ) {
7023 callback = props;
7024 props = [ "*" ];
7025 } else {
7026 props = props.match( rnotwhite );
7027 }
7028
7029 var prop,
7030 index = 0,
7031 length = props.length;
7032
7033 for ( ; index < length; index++ ) {
7034 prop = props[ index ];
7035 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
7036 Animation.tweeners[ prop ].unshift( callback );
7037 }
7038 },
7039
7040 prefilters: [ defaultPrefilter ],
7041
7042 prefilter: function( callback, prepend ) {
7043 if ( prepend ) {
7044 Animation.prefilters.unshift( callback );
7045 } else {
7046 Animation.prefilters.push( callback );
7047 }
7048 }
7049 } );
7050
7051 jQuery.speed = function( speed, easing, fn ) {
7052 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7053 complete: fn || !fn && easing ||
7054 jQuery.isFunction( speed ) && speed,
7055 duration: speed,
7056 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7057 };
7058
7059 // Go to the end state if fx are off or if document is hidden
7060 if ( jQuery.fx.off || document.hidden ) {
7061 opt.duration = 0;
7062
7063 } else {
7064 opt.duration = typeof opt.duration === "number" ?
7065 opt.duration : opt.duration in jQuery.fx.speeds ?
7066 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7067 }
7068
7069 // Normalize opt.queue - true/undefined/null -> "fx"
7070 if ( opt.queue == null || opt.queue === true ) {
7071 opt.queue = "fx";
7072 }
7073
7074 // Queueing
7075 opt.old = opt.complete;
7076
7077 opt.complete = function() {
7078 if ( jQuery.isFunction( opt.old ) ) {
7079 opt.old.call( this );
7080 }
7081
7082 if ( opt.queue ) {
7083 jQuery.dequeue( this, opt.queue );
7084 }
7085 };
7086
7087 return opt;
7088 };
7089
7090 jQuery.fn.extend( {
7091 fadeTo: function( speed, to, easing, callback ) {
7092
7093 // Show any hidden elements after setting opacity to 0
7094 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
7095
7096 // Animate to the value specified
7097 .end().animate( { opacity: to }, speed, easing, callback );
7098 },
7099 animate: function( prop, speed, easing, callback ) {
7100 var empty = jQuery.isEmptyObject( prop ),
7101 optall = jQuery.speed( speed, easing, callback ),
7102 doAnimation = function() {
7103
7104 // Operate on a copy of prop so per-property easing won't be lost
7105 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7106
7107 // Empty animations, or finishing resolves immediately
7108 if ( empty || dataPriv.get( this, "finish" ) ) {
7109 anim.stop( true );
7110 }
7111 };
7112 doAnimation.finish = doAnimation;
7113
7114 return empty || optall.queue === false ?
7115 this.each( doAnimation ) :
7116 this.queue( optall.queue, doAnimation );
7117 },
7118 stop: function( type, clearQueue, gotoEnd ) {
7119 var stopQueue = function( hooks ) {
7120 var stop = hooks.stop;
7121 delete hooks.stop;
7122 stop( gotoEnd );
7123 };
7124
7125 if ( typeof type !== "string" ) {
7126 gotoEnd = clearQueue;
7127 clearQueue = type;
7128 type = undefined;
7129 }
7130 if ( clearQueue && type !== false ) {
7131 this.queue( type || "fx", [] );
7132 }
7133
7134 return this.each( function() {
7135 var dequeue = true,
7136 index = type != null && type + "queueHooks",
7137 timers = jQuery.timers,
7138 data = dataPriv.get( this );
7139
7140 if ( index ) {
7141 if ( data[ index ] && data[ index ].stop ) {
7142 stopQueue( data[ index ] );
7143 }
7144 } else {
7145 for ( index in data ) {
7146 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7147 stopQueue( data[ index ] );
7148 }
7149 }
7150 }
7151
7152 for ( index = timers.length; index--; ) {
7153 if ( timers[ index ].elem === this &&
7154 ( type == null || timers[ index ].queue === type ) ) {
7155
7156 timers[ index ].anim.stop( gotoEnd );
7157 dequeue = false;
7158 timers.splice( index, 1 );
7159 }
7160 }
7161
7162 // Start the next in the queue if the last step wasn't forced.
7163 // Timers currently will call their complete callbacks, which
7164 // will dequeue but only if they were gotoEnd.
7165 if ( dequeue || !gotoEnd ) {
7166 jQuery.dequeue( this, type );
7167 }
7168 } );
7169 },
7170 finish: function( type ) {
7171 if ( type !== false ) {
7172 type = type || "fx";
7173 }
7174 return this.each( function() {
7175 var index,
7176 data = dataPriv.get( this ),
7177 queue = data[ type + "queue" ],
7178 hooks = data[ type + "queueHooks" ],
7179 timers = jQuery.timers,
7180 length = queue ? queue.length : 0;
7181
7182 // Enable finishing flag on private data
7183 data.finish = true;
7184
7185 // Empty the queue first
7186 jQuery.queue( this, type, [] );
7187
7188 if ( hooks && hooks.stop ) {
7189 hooks.stop.call( this, true );
7190 }
7191
7192 // Look for any active animations, and finish them
7193 for ( index = timers.length; index--; ) {
7194 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7195 timers[ index ].anim.stop( true );
7196 timers.splice( index, 1 );
7197 }
7198 }
7199
7200 // Look for any animations in the old queue and finish them
7201 for ( index = 0; index < length; index++ ) {
7202 if ( queue[ index ] && queue[ index ].finish ) {
7203 queue[ index ].finish.call( this );
7204 }
7205 }
7206
7207 // Turn off finishing flag
7208 delete data.finish;
7209 } );
7210 }
7211 } );
7212
7213 jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7214 var cssFn = jQuery.fn[ name ];
7215 jQuery.fn[ name ] = function( speed, easing, callback ) {
7216 return speed == null || typeof speed === "boolean" ?
7217 cssFn.apply( this, arguments ) :
7218 this.animate( genFx( name, true ), speed, easing, callback );
7219 };
7220 } );
7221
7222 // Generate shortcuts for custom animations
7223 jQuery.each( {
7224 slideDown: genFx( "show" ),
7225 slideUp: genFx( "hide" ),
7226 slideToggle: genFx( "toggle" ),
7227 fadeIn: { opacity: "show" },
7228 fadeOut: { opacity: "hide" },
7229 fadeToggle: { opacity: "toggle" }
7230 }, function( name, props ) {
7231 jQuery.fn[ name ] = function( speed, easing, callback ) {
7232 return this.animate( props, speed, easing, callback );
7233 };
7234 } );
7235
7236 jQuery.timers = [];
7237 jQuery.fx.tick = function() {
7238 var timer,
7239 i = 0,
7240 timers = jQuery.timers;
7241
7242 fxNow = jQuery.now();
7243
7244 for ( ; i < timers.length; i++ ) {
7245 timer = timers[ i ];
7246
7247 // Checks the timer has not already been removed
7248 if ( !timer() && timers[ i ] === timer ) {
7249 timers.splice( i--, 1 );
7250 }
7251 }
7252
7253 if ( !timers.length ) {
7254 jQuery.fx.stop();
7255 }
7256 fxNow = undefined;
7257 };
7258
7259 jQuery.fx.timer = function( timer ) {
7260 jQuery.timers.push( timer );
7261 if ( timer() ) {
7262 jQuery.fx.start();
7263 } else {
7264 jQuery.timers.pop();
7265 }
7266 };
7267
7268 jQuery.fx.interval = 13;
7269 jQuery.fx.start = function() {
7270 if ( !timerId ) {
7271 timerId = window.requestAnimationFrame ?
7272 window.requestAnimationFrame( raf ) :
7273 window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
7274 }
7275 };
7276
7277 jQuery.fx.stop = function() {
7278 if ( window.cancelAnimationFrame ) {
7279 window.cancelAnimationFrame( timerId );
7280 } else {
7281 window.clearInterval( timerId );
7282 }
7283
7284 timerId = null;
7285 };
7286
7287 jQuery.fx.speeds = {
7288 slow: 600,
7289 fast: 200,
7290
7291 // Default speed
7292 _default: 400
7293 };
7294
7295
7296 // Based off of the plugin by Clint Helfers, with permission.
7297 // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7298 jQuery.fn.delay = function( time, type ) {
7299 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7300 type = type || "fx";
7301
7302 return this.queue( type, function( next, hooks ) {
7303 var timeout = window.setTimeout( next, time );
7304 hooks.stop = function() {
7305 window.clearTimeout( timeout );
7306 };
7307 } );
7308 };
7309
7310
7311 ( function() {
7312 var input = document.createElement( "input" ),
7313 select = document.createElement( "select" ),
7314 opt = select.appendChild( document.createElement( "option" ) );
7315
7316 input.type = "checkbox";
7317
7318 // Support: Android <=4.3 only
7319 // Default value for a checkbox should be "on"
7320 support.checkOn = input.value !== "";
7321
7322 // Support: IE <=11 only
7323 // Must access selectedIndex to make default options select
7324 support.optSelected = opt.selected;
7325
7326 // Support: IE <=11 only
7327 // An input loses its value after becoming a radio
7328 input = document.createElement( "input" );
7329 input.value = "t";
7330 input.type = "radio";
7331 support.radioValue = input.value === "t";
7332 } )();
7333
7334
7335 var boolHook,
7336 attrHandle = jQuery.expr.attrHandle;
7337
7338 jQuery.fn.extend( {
7339 attr: function( name, value ) {
7340 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7341 },
7342
7343 removeAttr: function( name ) {
7344 return this.each( function() {
7345 jQuery.removeAttr( this, name );
7346 } );
7347 }
7348 } );
7349
7350 jQuery.extend( {
7351 attr: function( elem, name, value ) {
7352 var ret, hooks,
7353 nType = elem.nodeType;
7354
7355 // Don't get/set attributes on text, comment and attribute nodes
7356 if ( nType === 3 || nType === 8 || nType === 2 ) {
7357 return;
7358 }
7359
7360 // Fallback to prop when attributes are not supported
7361 if ( typeof elem.getAttribute === "undefined" ) {
7362 return jQuery.prop( elem, name, value );
7363 }
7364
7365 // Attribute hooks are determined by the lowercase version
7366 // Grab necessary hook if one is defined
7367 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7368 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
7369 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7370 }
7371
7372 if ( value !== undefined ) {
7373 if ( value === null ) {
7374 jQuery.removeAttr( elem, name );
7375 return;
7376 }
7377
7378 if ( hooks && "set" in hooks &&
7379 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7380 return ret;
7381 }
7382
7383 elem.setAttribute( name, value + "" );
7384 return value;
7385 }
7386
7387 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7388 return ret;
7389 }
7390
7391 ret = jQuery.find.attr( elem, name );
7392
7393 // Non-existent attributes return null, we normalize to undefined
7394 return ret == null ? undefined : ret;
7395 },
7396
7397 attrHooks: {
7398 type: {
7399 set: function( elem, value ) {
7400 if ( !support.radioValue && value === "radio" &&
7401 jQuery.nodeName( elem, "input" ) ) {
7402 var val = elem.value;
7403 elem.setAttribute( "type", value );
7404 if ( val ) {
7405 elem.value = val;
7406 }
7407 return value;
7408 }
7409 }
7410 }
7411 },
7412
7413 removeAttr: function( elem, value ) {
7414 var name,
7415 i = 0,
7416 attrNames = value && value.match( rnotwhite );
7417
7418 if ( attrNames && elem.nodeType === 1 ) {
7419 while ( ( name = attrNames[ i++ ] ) ) {
7420 elem.removeAttribute( name );
7421 }
7422 }
7423 }
7424 } );
7425
7426 // Hooks for boolean attributes
7427 boolHook = {
7428 set: function( elem, value, name ) {
7429 if ( value === false ) {
7430
7431 // Remove boolean attributes when set to false
7432 jQuery.removeAttr( elem, name );
7433 } else {
7434 elem.setAttribute( name, name );
7435 }
7436 return name;
7437 }
7438 };
7439
7440 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7441 var getter = attrHandle[ name ] || jQuery.find.attr;
7442
7443 attrHandle[ name ] = function( elem, name, isXML ) {
7444 var ret, handle,
7445 lowercaseName = name.toLowerCase();
7446
7447 if ( !isXML ) {
7448
7449 // Avoid an infinite loop by temporarily removing this function from the getter
7450 handle = attrHandle[ lowercaseName ];
7451 attrHandle[ lowercaseName ] = ret;
7452 ret = getter( elem, name, isXML ) != null ?
7453 lowercaseName :
7454 null;
7455 attrHandle[ lowercaseName ] = handle;
7456 }
7457 return ret;
7458 };
7459 } );
7460
7461
7462
7463
7464 var rfocusable = /^(?:input|select|textarea|button)$/i,
7465 rclickable = /^(?:a|area)$/i;
7466
7467 jQuery.fn.extend( {
7468 prop: function( name, value ) {
7469 return access( this, jQuery.prop, name, value, arguments.length > 1 );
7470 },
7471
7472 removeProp: function( name ) {
7473 return this.each( function() {
7474 delete this[ jQuery.propFix[ name ] || name ];
7475 } );
7476 }
7477 } );
7478
7479 jQuery.extend( {
7480 prop: function( elem, name, value ) {
7481 var ret, hooks,
7482 nType = elem.nodeType;
7483
7484 // Don't get/set properties on text, comment and attribute nodes
7485 if ( nType === 3 || nType === 8 || nType === 2 ) {
7486 return;
7487 }
7488
7489 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7490
7491 // Fix name and attach hooks
7492 name = jQuery.propFix[ name ] || name;
7493 hooks = jQuery.propHooks[ name ];
7494 }
7495
7496 if ( value !== undefined ) {
7497 if ( hooks && "set" in hooks &&
7498 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7499 return ret;
7500 }
7501
7502 return ( elem[ name ] = value );
7503 }
7504
7505 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7506 return ret;
7507 }
7508
7509 return elem[ name ];
7510 },
7511
7512 propHooks: {
7513 tabIndex: {
7514 get: function( elem ) {
7515
7516 // Support: IE <=9 - 11 only
7517 // elem.tabIndex doesn't always return the
7518 // correct value when it hasn't been explicitly set
7519 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
7520 // Use proper attribute retrieval(#12072)
7521 var tabindex = jQuery.find.attr( elem, "tabindex" );
7522
7523 return tabindex ?
7524 parseInt( tabindex, 10 ) :
7525 rfocusable.test( elem.nodeName ) ||
7526 rclickable.test( elem.nodeName ) && elem.href ?
7527 0 :
7528 -1;
7529 }
7530 }
7531 },
7532
7533 propFix: {
7534 "for": "htmlFor",
7535 "class": "className"
7536 }
7537 } );
7538
7539 // Support: IE <=11 only
7540 // Accessing the selectedIndex property
7541 // forces the browser to respect setting selected
7542 // on the option
7543 // The getter ensures a default option is selected
7544 // when in an optgroup
7545 if ( !support.optSelected ) {
7546 jQuery.propHooks.selected = {
7547 get: function( elem ) {
7548 var parent = elem.parentNode;
7549 if ( parent && parent.parentNode ) {
7550 parent.parentNode.selectedIndex;
7551 }
7552 return null;
7553 },
7554 set: function( elem ) {
7555 var parent = elem.parentNode;
7556 if ( parent ) {
7557 parent.selectedIndex;
7558
7559 if ( parent.parentNode ) {
7560 parent.parentNode.selectedIndex;
7561 }
7562 }
7563 }
7564 };
7565 }
7566
7567 jQuery.each( [
7568 "tabIndex",
7569 "readOnly",
7570 "maxLength",
7571 "cellSpacing",
7572 "cellPadding",
7573 "rowSpan",
7574 "colSpan",
7575 "useMap",
7576 "frameBorder",
7577 "contentEditable"
7578 ], function() {
7579 jQuery.propFix[ this.toLowerCase() ] = this;
7580 } );
7581
7582
7583
7584
7585 var rclass = /[\t\r\n\f]/g;
7586
7587 function getClass( elem ) {
7588 return elem.getAttribute && elem.getAttribute( "class" ) || "";
7589 }
7590
7591 jQuery.fn.extend( {
7592 addClass: function( value ) {
7593 var classes, elem, cur, curValue, clazz, j, finalValue,
7594 i = 0;
7595
7596 if ( jQuery.isFunction( value ) ) {
7597 return this.each( function( j ) {
7598 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
7599 } );
7600 }
7601
7602 if ( typeof value === "string" && value ) {
7603 classes = value.match( rnotwhite ) || [];
7604
7605 while ( ( elem = this[ i++ ] ) ) {
7606 curValue = getClass( elem );
7607 cur = elem.nodeType === 1 &&
7608 ( " " + curValue + " " ).replace( rclass, " " );
7609
7610 if ( cur ) {
7611 j = 0;
7612 while ( ( clazz = classes[ j++ ] ) ) {
7613 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
7614 cur += clazz + " ";
7615 }
7616 }
7617
7618 // Only assign if different to avoid unneeded rendering.
7619 finalValue = jQuery.trim( cur );
7620 if ( curValue !== finalValue ) {
7621 elem.setAttribute( "class", finalValue );
7622 }
7623 }
7624 }
7625 }
7626
7627 return this;
7628 },
7629
7630 removeClass: function( value ) {
7631 var classes, elem, cur, curValue, clazz, j, finalValue,
7632 i = 0;
7633
7634 if ( jQuery.isFunction( value ) ) {
7635 return this.each( function( j ) {
7636 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
7637 } );
7638 }
7639
7640 if ( !arguments.length ) {
7641 return this.attr( "class", "" );
7642 }
7643
7644 if ( typeof value === "string" && value ) {
7645 classes = value.match( rnotwhite ) || [];
7646
7647 while ( ( elem = this[ i++ ] ) ) {
7648 curValue = getClass( elem );
7649
7650 // This expression is here for better compressibility (see addClass)
7651 cur = elem.nodeType === 1 &&
7652 ( " " + curValue + " " ).replace( rclass, " " );
7653
7654 if ( cur ) {
7655 j = 0;
7656 while ( ( clazz = classes[ j++ ] ) ) {
7657
7658 // Remove *all* instances
7659 while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
7660 cur = cur.replace( " " + clazz + " ", " " );
7661 }
7662 }
7663
7664 // Only assign if different to avoid unneeded rendering.
7665 finalValue = jQuery.trim( cur );
7666 if ( curValue !== finalValue ) {
7667 elem.setAttribute( "class", finalValue );
7668 }
7669 }
7670 }
7671 }
7672
7673 return this;
7674 },
7675
7676 toggleClass: function( value, stateVal ) {
7677 var type = typeof value;
7678
7679 if ( typeof stateVal === "boolean" && type === "string" ) {
7680 return stateVal ? this.addClass( value ) : this.removeClass( value );
7681 }
7682
7683 if ( jQuery.isFunction( value ) ) {
7684 return this.each( function( i ) {
7685 jQuery( this ).toggleClass(
7686 value.call( this, i, getClass( this ), stateVal ),
7687 stateVal
7688 );
7689 } );
7690 }
7691
7692 return this.each( function() {
7693 var className, i, self, classNames;
7694
7695 if ( type === "string" ) {
7696
7697 // Toggle individual class names
7698 i = 0;
7699 self = jQuery( this );
7700 classNames = value.match( rnotwhite ) || [];
7701
7702 while ( ( className = classNames[ i++ ] ) ) {
7703
7704 // Check each className given, space separated list
7705 if ( self.hasClass( className ) ) {
7706 self.removeClass( className );
7707 } else {
7708 self.addClass( className );
7709 }
7710 }
7711
7712 // Toggle whole class name
7713 } else if ( value === undefined || type === "boolean" ) {
7714 className = getClass( this );
7715 if ( className ) {
7716
7717 // Store className if set
7718 dataPriv.set( this, "__className__", className );
7719 }
7720
7721 // If the element has a class name or if we're passed `false`,
7722 // then remove the whole classname (if there was one, the above saved it).
7723 // Otherwise bring back whatever was previously saved (if anything),
7724 // falling back to the empty string if nothing was stored.
7725 if ( this.setAttribute ) {
7726 this.setAttribute( "class",
7727 className || value === false ?
7728 "" :
7729 dataPriv.get( this, "__className__" ) || ""
7730 );
7731 }
7732 }
7733 } );
7734 },
7735
7736 hasClass: function( selector ) {
7737 var className, elem,
7738 i = 0;
7739
7740 className = " " + selector + " ";
7741 while ( ( elem = this[ i++ ] ) ) {
7742 if ( elem.nodeType === 1 &&
7743 ( " " + getClass( elem ) + " " ).replace( rclass, " " )
7744 .indexOf( className ) > -1
7745 ) {
7746 return true;
7747 }
7748 }
7749
7750 return false;
7751 }
7752 } );
7753
7754
7755
7756
7757 var rreturn = /\r/g,
7758 rspaces = /[\x20\t\r\n\f]+/g;
7759
7760 jQuery.fn.extend( {
7761 val: function( value ) {
7762 var hooks, ret, isFunction,
7763 elem = this[ 0 ];
7764
7765 if ( !arguments.length ) {
7766 if ( elem ) {
7767 hooks = jQuery.valHooks[ elem.type ] ||
7768 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7769
7770 if ( hooks &&
7771 "get" in hooks &&
7772 ( ret = hooks.get( elem, "value" ) ) !== undefined
7773 ) {
7774 return ret;
7775 }
7776
7777 ret = elem.value;
7778
7779 return typeof ret === "string" ?
7780
7781 // Handle most common string cases
7782 ret.replace( rreturn, "" ) :
7783
7784 // Handle cases where value is null/undef or number
7785 ret == null ? "" : ret;
7786 }
7787
7788 return;
7789 }
7790
7791 isFunction = jQuery.isFunction( value );
7792
7793 return this.each( function( i ) {
7794 var val;
7795
7796 if ( this.nodeType !== 1 ) {
7797 return;
7798 }
7799
7800 if ( isFunction ) {
7801 val = value.call( this, i, jQuery( this ).val() );
7802 } else {
7803 val = value;
7804 }
7805
7806 // Treat null/undefined as ""; convert numbers to string
7807 if ( val == null ) {
7808 val = "";
7809
7810 } else if ( typeof val === "number" ) {
7811 val += "";
7812
7813 } else if ( jQuery.isArray( val ) ) {
7814 val = jQuery.map( val, function( value ) {
7815 return value == null ? "" : value + "";
7816 } );
7817 }
7818
7819 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7820
7821 // If set returns undefined, fall back to normal setting
7822 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
7823 this.value = val;
7824 }
7825 } );
7826 }
7827 } );
7828
7829 jQuery.extend( {
7830 valHooks: {
7831 option: {
7832 get: function( elem ) {
7833
7834 var val = jQuery.find.attr( elem, "value" );
7835 return val != null ?
7836 val :
7837
7838 // Support: IE <=10 - 11 only
7839 // option.text throws exceptions (#14686, #14858)
7840 // Strip and collapse whitespace
7841 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7842 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
7843 }
7844 },
7845 select: {
7846 get: function( elem ) {
7847 var value, option,
7848 options = elem.options,
7849 index = elem.selectedIndex,
7850 one = elem.type === "select-one",
7851 values = one ? null : [],
7852 max = one ? index + 1 : options.length,
7853 i = index < 0 ?
7854 max :
7855 one ? index : 0;
7856
7857 // Loop through all the selected options
7858 for ( ; i < max; i++ ) {
7859 option = options[ i ];
7860
7861 // Support: IE <=9 only
7862 // IE8-9 doesn't update selected after form reset (#2551)
7863 if ( ( option.selected || i === index ) &&
7864
7865 // Don't return options that are disabled or in a disabled optgroup
7866 !option.disabled &&
7867 ( !option.parentNode.disabled ||
7868 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7869
7870 // Get the specific value for the option
7871 value = jQuery( option ).val();
7872
7873 // We don't need an array for one selects
7874 if ( one ) {
7875 return value;
7876 }
7877
7878 // Multi-Selects return an array
7879 values.push( value );
7880 }
7881 }
7882
7883 return values;
7884 },
7885
7886 set: function( elem, value ) {
7887 var optionSet, option,
7888 options = elem.options,
7889 values = jQuery.makeArray( value ),
7890 i = options.length;
7891
7892 while ( i-- ) {
7893 option = options[ i ];
7894
7895 /* eslint-disable no-cond-assign */
7896
7897 if ( option.selected =
7898 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
7899 ) {
7900 optionSet = true;
7901 }
7902
7903 /* eslint-enable no-cond-assign */
7904 }
7905
7906 // Force browsers to behave consistently when non-matching value is set
7907 if ( !optionSet ) {
7908 elem.selectedIndex = -1;
7909 }
7910 return values;
7911 }
7912 }
7913 }
7914 } );
7915
7916 // Radios and checkboxes getter/setter
7917 jQuery.each( [ "radio", "checkbox" ], function() {
7918 jQuery.valHooks[ this ] = {
7919 set: function( elem, value ) {
7920 if ( jQuery.isArray( value ) ) {
7921 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
7922 }
7923 }
7924 };
7925 if ( !support.checkOn ) {
7926 jQuery.valHooks[ this ].get = function( elem ) {
7927 return elem.getAttribute( "value" ) === null ? "on" : elem.value;
7928 };
7929 }
7930 } );
7931
7932
7933
7934
7935 // Return jQuery for attributes-only inclusion
7936
7937
7938 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
7939
7940 jQuery.extend( jQuery.event, {
7941
7942 trigger: function( event, data, elem, onlyHandlers ) {
7943
7944 var i, cur, tmp, bubbleType, ontype, handle, special,
7945 eventPath = [ elem || document ],
7946 type = hasOwn.call( event, "type" ) ? event.type : event,
7947 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
7948
7949 cur = tmp = elem = elem || document;
7950
7951 // Don't do events on text and comment nodes
7952 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
7953 return;
7954 }
7955
7956 // focus/blur morphs to focusin/out; ensure we're not firing them right now
7957 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
7958 return;
7959 }
7960
7961 if ( type.indexOf( "." ) > -1 ) {
7962
7963 // Namespaced trigger; create a regexp to match event type in handle()
7964 namespaces = type.split( "." );
7965 type = namespaces.shift();
7966 namespaces.sort();
7967 }
7968 ontype = type.indexOf( ":" ) < 0 && "on" + type;
7969
7970 // Caller can pass in a jQuery.Event object, Object, or just an event type string
7971 event = event[ jQuery.expando ] ?
7972 event :
7973 new jQuery.Event( type, typeof event === "object" && event );
7974
7975 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
7976 event.isTrigger = onlyHandlers ? 2 : 3;
7977 event.namespace = namespaces.join( "." );
7978 event.rnamespace = event.namespace ?
7979 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
7980 null;
7981
7982 // Clean up the event in case it is being reused
7983 event.result = undefined;
7984 if ( !event.target ) {
7985 event.target = elem;
7986 }
7987
7988 // Clone any incoming data and prepend the event, creating the handler arg list
7989 data = data == null ?
7990 [ event ] :
7991 jQuery.makeArray( data, [ event ] );
7992
7993 // Allow special events to draw outside the lines
7994 special = jQuery.event.special[ type ] || {};
7995 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
7996 return;
7997 }
7998
7999 // Determine event propagation path in advance, per W3C events spec (#9951)
8000 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8001 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
8002
8003 bubbleType = special.delegateType || type;
8004 if ( !rfocusMorph.test( bubbleType + type ) ) {
8005 cur = cur.parentNode;
8006 }
8007 for ( ; cur; cur = cur.parentNode ) {
8008 eventPath.push( cur );
8009 tmp = cur;
8010 }
8011
8012 // Only add window if we got to document (e.g., not plain obj or detached DOM)
8013 if ( tmp === ( elem.ownerDocument || document ) ) {
8014 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
8015 }
8016 }
8017
8018 // Fire handlers on the event path
8019 i = 0;
8020 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
8021
8022 event.type = i > 1 ?
8023 bubbleType :
8024 special.bindType || type;
8025
8026 // jQuery handler
8027 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
8028 dataPriv.get( cur, "handle" );
8029 if ( handle ) {
8030 handle.apply( cur, data );
8031 }
8032
8033 // Native handler
8034 handle = ontype && cur[ ontype ];
8035 if ( handle && handle.apply && acceptData( cur ) ) {
8036 event.result = handle.apply( cur, data );
8037 if ( event.result === false ) {
8038 event.preventDefault();
8039 }
8040 }
8041 }
8042 event.type = type;
8043
8044 // If nobody prevented the default action, do it now
8045 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
8046
8047 if ( ( !special._default ||
8048 special._default.apply( eventPath.pop(), data ) === false ) &&
8049 acceptData( elem ) ) {
8050
8051 // Call a native DOM method on the target with the same name as the event.
8052 // Don't do default actions on window, that's where global variables be (#6170)
8053 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
8054
8055 // Don't re-trigger an onFOO event when we call its FOO() method
8056 tmp = elem[ ontype ];
8057
8058 if ( tmp ) {
8059 elem[ ontype ] = null;
8060 }
8061
8062 // Prevent re-triggering of the same event, since we already bubbled it above
8063 jQuery.event.triggered = type;
8064 elem[ type ]();
8065 jQuery.event.triggered = undefined;
8066
8067 if ( tmp ) {
8068 elem[ ontype ] = tmp;
8069 }
8070 }
8071 }
8072 }
8073
8074 return event.result;
8075 },
8076
8077 // Piggyback on a donor event to simulate a different one
8078 // Used only for `focus(in | out)` events
8079 simulate: function( type, elem, event ) {
8080 var e = jQuery.extend(
8081 new jQuery.Event(),
8082 event,
8083 {
8084 type: type,
8085 isSimulated: true
8086 }
8087 );
8088
8089 jQuery.event.trigger( e, null, elem );
8090 }
8091
8092 } );
8093
8094 jQuery.fn.extend( {
8095
8096 trigger: function( type, data ) {
8097 return this.each( function() {
8098 jQuery.event.trigger( type, data, this );
8099 } );
8100 },
8101 triggerHandler: function( type, data ) {
8102 var elem = this[ 0 ];
8103 if ( elem ) {
8104 return jQuery.event.trigger( type, data, elem, true );
8105 }
8106 }
8107 } );
8108
8109
8110 jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
8111 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8112 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
8113 function( i, name ) {
8114
8115 // Handle event binding
8116 jQuery.fn[ name ] = function( data, fn ) {
8117 return arguments.length > 0 ?
8118 this.on( name, null, data, fn ) :
8119 this.trigger( name );
8120 };
8121 } );
8122
8123 jQuery.fn.extend( {
8124 hover: function( fnOver, fnOut ) {
8125 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8126 }
8127 } );
8128
8129
8130
8131
8132 support.focusin = "onfocusin" in window;
8133
8134
8135 // Support: Firefox <=44
8136 // Firefox doesn't have focus(in | out) events
8137 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8138 //
8139 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8140 // focus(in | out) events fire after focus & blur events,
8141 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8142 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8143 if ( !support.focusin ) {
8144 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
8145
8146 // Attach a single capturing handler on the document while someone wants focusin/focusout
8147 var handler = function( event ) {
8148 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
8149 };
8150
8151 jQuery.event.special[ fix ] = {
8152 setup: function() {
8153 var doc = this.ownerDocument || this,
8154 attaches = dataPriv.access( doc, fix );
8155
8156 if ( !attaches ) {
8157 doc.addEventListener( orig, handler, true );
8158 }
8159 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8160 },
8161 teardown: function() {
8162 var doc = this.ownerDocument || this,
8163 attaches = dataPriv.access( doc, fix ) - 1;
8164
8165 if ( !attaches ) {
8166 doc.removeEventListener( orig, handler, true );
8167 dataPriv.remove( doc, fix );
8168
8169 } else {
8170 dataPriv.access( doc, fix, attaches );
8171 }
8172 }
8173 };
8174 } );
8175 }
8176 var location = window.location;
8177
8178 var nonce = jQuery.now();
8179
8180 var rquery = ( /\?/ );
8181
8182
8183
8184 // Cross-browser xml parsing
8185 jQuery.parseXML = function( data ) {
8186 var xml;
8187 if ( !data || typeof data !== "string" ) {
8188 return null;
8189 }
8190
8191 // Support: IE 9 - 11 only
8192 // IE throws on parseFromString with invalid input.
8193 try {
8194 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8195 } catch ( e ) {
8196 xml = undefined;
8197 }
8198
8199 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8200 jQuery.error( "Invalid XML: " + data );
8201 }
8202 return xml;
8203 };
8204
8205
8206 var
8207 rbracket = /\[\]$/,
8208 rCRLF = /\r?\n/g,
8209 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8210 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8211
8212 function buildParams( prefix, obj, traditional, add ) {
8213 var name;
8214
8215 if ( jQuery.isArray( obj ) ) {
8216
8217 // Serialize array item.
8218 jQuery.each( obj, function( i, v ) {
8219 if ( traditional || rbracket.test( prefix ) ) {
8220
8221 // Treat each array item as a scalar.
8222 add( prefix, v );
8223
8224 } else {
8225
8226 // Item is non-scalar (array or object), encode its numeric index.
8227 buildParams(
8228 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8229 v,
8230 traditional,
8231 add
8232 );
8233 }
8234 } );
8235
8236 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
8237
8238 // Serialize object item.
8239 for ( name in obj ) {
8240 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8241 }
8242
8243 } else {
8244
8245 // Serialize scalar item.
8246 add( prefix, obj );
8247 }
8248 }
8249
8250 // Serialize an array of form elements or a set of
8251 // key/values into a query string
8252 jQuery.param = function( a, traditional ) {
8253 var prefix,
8254 s = [],
8255 add = function( key, valueOrFunction ) {
8256
8257 // If value is a function, invoke it and use its return value
8258 var value = jQuery.isFunction( valueOrFunction ) ?
8259 valueOrFunction() :
8260 valueOrFunction;
8261
8262 s[ s.length ] = encodeURIComponent( key ) + "=" +
8263 encodeURIComponent( value == null ? "" : value );
8264 };
8265
8266 // If an array was passed in, assume that it is an array of form elements.
8267 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8268
8269 // Serialize the form elements
8270 jQuery.each( a, function() {
8271 add( this.name, this.value );
8272 } );
8273
8274 } else {
8275
8276 // If traditional, encode the "old" way (the way 1.3.2 or older
8277 // did it), otherwise encode params recursively.
8278 for ( prefix in a ) {
8279 buildParams( prefix, a[ prefix ], traditional, add );
8280 }
8281 }
8282
8283 // Return the resulting serialization
8284 return s.join( "&" );
8285 };
8286
8287 jQuery.fn.extend( {
8288 serialize: function() {
8289 return jQuery.param( this.serializeArray() );
8290 },
8291 serializeArray: function() {
8292 return this.map( function() {
8293
8294 // Can add propHook for "elements" to filter or add form elements
8295 var elements = jQuery.prop( this, "elements" );
8296 return elements ? jQuery.makeArray( elements ) : this;
8297 } )
8298 .filter( function() {
8299 var type = this.type;
8300
8301 // Use .is( ":disabled" ) so that fieldset[disabled] works
8302 return this.name && !jQuery( this ).is( ":disabled" ) &&
8303 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8304 ( this.checked || !rcheckableType.test( type ) );
8305 } )
8306 .map( function( i, elem ) {
8307 var val = jQuery( this ).val();
8308
8309 return val == null ?
8310 null :
8311 jQuery.isArray( val ) ?
8312 jQuery.map( val, function( val ) {
8313 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8314 } ) :
8315 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8316 } ).get();
8317 }
8318 } );
8319
8320
8321 var
8322 r20 = /%20/g,
8323 rhash = /#.*$/,
8324 rts = /([?&])_=[^&]*/,
8325 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8326
8327 // #7653, #8125, #8152: local protocol detection
8328 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8329 rnoContent = /^(?:GET|HEAD)$/,
8330 rprotocol = /^\/\//,
8331
8332 /* Prefilters
8333 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8334 * 2) These are called:
8335 * - BEFORE asking for a transport
8336 * - AFTER param serialization (s.data is a string if s.processData is true)
8337 * 3) key is the dataType
8338 * 4) the catchall symbol "*" can be used
8339 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8340 */
8341 prefilters = {},
8342
8343 /* Transports bindings
8344 * 1) key is the dataType
8345 * 2) the catchall symbol "*" can be used
8346 * 3) selection will start with transport dataType and THEN go to "*" if needed
8347 */
8348 transports = {},
8349
8350 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8351 allTypes = "*/".concat( "*" ),
8352
8353 // Anchor tag for parsing the document origin
8354 originAnchor = document.createElement( "a" );
8355 originAnchor.href = location.href;
8356
8357 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8358 function addToPrefiltersOrTransports( structure ) {
8359
8360 // dataTypeExpression is optional and defaults to "*"
8361 return function( dataTypeExpression, func ) {
8362
8363 if ( typeof dataTypeExpression !== "string" ) {
8364 func = dataTypeExpression;
8365 dataTypeExpression = "*";
8366 }
8367
8368 var dataType,
8369 i = 0,
8370 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8371
8372 if ( jQuery.isFunction( func ) ) {
8373
8374 // For each dataType in the dataTypeExpression
8375 while ( ( dataType = dataTypes[ i++ ] ) ) {
8376
8377 // Prepend if requested
8378 if ( dataType[ 0 ] === "+" ) {
8379 dataType = dataType.slice( 1 ) || "*";
8380 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8381
8382 // Otherwise append
8383 } else {
8384 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8385 }
8386 }
8387 }
8388 };
8389 }
8390
8391 // Base inspection function for prefilters and transports
8392 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8393
8394 var inspected = {},
8395 seekingTransport = ( structure === transports );
8396
8397 function inspect( dataType ) {
8398 var selected;
8399 inspected[ dataType ] = true;
8400 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8401 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8402 if ( typeof dataTypeOrTransport === "string" &&
8403 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8404
8405 options.dataTypes.unshift( dataTypeOrTransport );
8406 inspect( dataTypeOrTransport );
8407 return false;
8408 } else if ( seekingTransport ) {
8409 return !( selected = dataTypeOrTransport );
8410 }
8411 } );
8412 return selected;
8413 }
8414
8415 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8416 }
8417
8418 // A special extend for ajax options
8419 // that takes "flat" options (not to be deep extended)
8420 // Fixes #9887
8421 function ajaxExtend( target, src ) {
8422 var key, deep,
8423 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8424
8425 for ( key in src ) {
8426 if ( src[ key ] !== undefined ) {
8427 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8428 }
8429 }
8430 if ( deep ) {
8431 jQuery.extend( true, target, deep );
8432 }
8433
8434 return target;
8435 }
8436
8437 /* Handles responses to an ajax request:
8438 * - finds the right dataType (mediates between content-type and expected dataType)
8439 * - returns the corresponding response
8440 */
8441 function ajaxHandleResponses( s, jqXHR, responses ) {
8442
8443 var ct, type, finalDataType, firstDataType,
8444 contents = s.contents,
8445 dataTypes = s.dataTypes;
8446
8447 // Remove auto dataType and get content-type in the process
8448 while ( dataTypes[ 0 ] === "*" ) {
8449 dataTypes.shift();
8450 if ( ct === undefined ) {
8451 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
8452 }
8453 }
8454
8455 // Check if we're dealing with a known content-type
8456 if ( ct ) {
8457 for ( type in contents ) {
8458 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8459 dataTypes.unshift( type );
8460 break;
8461 }
8462 }
8463 }
8464
8465 // Check to see if we have a response for the expected dataType
8466 if ( dataTypes[ 0 ] in responses ) {
8467 finalDataType = dataTypes[ 0 ];
8468 } else {
8469
8470 // Try convertible dataTypes
8471 for ( type in responses ) {
8472 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
8473 finalDataType = type;
8474 break;
8475 }
8476 if ( !firstDataType ) {
8477 firstDataType = type;
8478 }
8479 }
8480
8481 // Or just use first one
8482 finalDataType = finalDataType || firstDataType;
8483 }
8484
8485 // If we found a dataType
8486 // We add the dataType to the list if needed
8487 // and return the corresponding response
8488 if ( finalDataType ) {
8489 if ( finalDataType !== dataTypes[ 0 ] ) {
8490 dataTypes.unshift( finalDataType );
8491 }
8492 return responses[ finalDataType ];
8493 }
8494 }
8495
8496 /* Chain conversions given the request and the original response
8497 * Also sets the responseXXX fields on the jqXHR instance
8498 */
8499 function ajaxConvert( s, response, jqXHR, isSuccess ) {
8500 var conv2, current, conv, tmp, prev,
8501 converters = {},
8502
8503 // Work with a copy of dataTypes in case we need to modify it for conversion
8504 dataTypes = s.dataTypes.slice();
8505
8506 // Create converters map with lowercased keys
8507 if ( dataTypes[ 1 ] ) {
8508 for ( conv in s.converters ) {
8509 converters[ conv.toLowerCase() ] = s.converters[ conv ];
8510 }
8511 }
8512
8513 current = dataTypes.shift();
8514
8515 // Convert to each sequential dataType
8516 while ( current ) {
8517
8518 if ( s.responseFields[ current ] ) {
8519 jqXHR[ s.responseFields[ current ] ] = response;
8520 }
8521
8522 // Apply the dataFilter if provided
8523 if ( !prev && isSuccess && s.dataFilter ) {
8524 response = s.dataFilter( response, s.dataType );
8525 }
8526
8527 prev = current;
8528 current = dataTypes.shift();
8529
8530 if ( current ) {
8531
8532 // There's only work to do if current dataType is non-auto
8533 if ( current === "*" ) {
8534
8535 current = prev;
8536
8537 // Convert response if prev dataType is non-auto and differs from current
8538 } else if ( prev !== "*" && prev !== current ) {
8539
8540 // Seek a direct converter
8541 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8542
8543 // If none found, seek a pair
8544 if ( !conv ) {
8545 for ( conv2 in converters ) {
8546
8547 // If conv2 outputs current
8548 tmp = conv2.split( " " );
8549 if ( tmp[ 1 ] === current ) {
8550
8551 // If prev can be converted to accepted input
8552 conv = converters[ prev + " " + tmp[ 0 ] ] ||
8553 converters[ "* " + tmp[ 0 ] ];
8554 if ( conv ) {
8555
8556 // Condense equivalence converters
8557 if ( conv === true ) {
8558 conv = converters[ conv2 ];
8559
8560 // Otherwise, insert the intermediate dataType
8561 } else if ( converters[ conv2 ] !== true ) {
8562 current = tmp[ 0 ];
8563 dataTypes.unshift( tmp[ 1 ] );
8564 }
8565 break;
8566 }
8567 }
8568 }
8569 }
8570
8571 // Apply converter (if not an equivalence)
8572 if ( conv !== true ) {
8573
8574 // Unless errors are allowed to bubble, catch and return them
8575 if ( conv && s.throws ) {
8576 response = conv( response );
8577 } else {
8578 try {
8579 response = conv( response );
8580 } catch ( e ) {
8581 return {
8582 state: "parsererror",
8583 error: conv ? e : "No conversion from " + prev + " to " + current
8584 };
8585 }
8586 }
8587 }
8588 }
8589 }
8590 }
8591
8592 return { state: "success", data: response };
8593 }
8594
8595 jQuery.extend( {
8596
8597 // Counter for holding the number of active queries
8598 active: 0,
8599
8600 // Last-Modified header cache for next request
8601 lastModified: {},
8602 etag: {},
8603
8604 ajaxSettings: {
8605 url: location.href,
8606 type: "GET",
8607 isLocal: rlocalProtocol.test( location.protocol ),
8608 global: true,
8609 processData: true,
8610 async: true,
8611 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8612
8613 /*
8614 timeout: 0,
8615 data: null,
8616 dataType: null,
8617 username: null,
8618 password: null,
8619 cache: null,
8620 throws: false,
8621 traditional: false,
8622 headers: {},
8623 */
8624
8625 accepts: {
8626 "*": allTypes,
8627 text: "text/plain",
8628 html: "text/html",
8629 xml: "application/xml, text/xml",
8630 json: "application/json, text/javascript"
8631 },
8632
8633 contents: {
8634 xml: /\bxml\b/,
8635 html: /\bhtml/,
8636 json: /\bjson\b/
8637 },
8638
8639 responseFields: {
8640 xml: "responseXML",
8641 text: "responseText",
8642 json: "responseJSON"
8643 },
8644
8645 // Data converters
8646 // Keys separate source (or catchall "*") and destination types with a single space
8647 converters: {
8648
8649 // Convert anything to text
8650 "* text": String,
8651
8652 // Text to html (true = no transformation)
8653 "text html": true,
8654
8655 // Evaluate text as a json expression
8656 "text json": JSON.parse,
8657
8658 // Parse text as xml
8659 "text xml": jQuery.parseXML
8660 },
8661
8662 // For options that shouldn't be deep extended:
8663 // you can add your own custom options here if
8664 // and when you create one that shouldn't be
8665 // deep extended (see ajaxExtend)
8666 flatOptions: {
8667 url: true,
8668 context: true
8669 }
8670 },
8671
8672 // Creates a full fledged settings object into target
8673 // with both ajaxSettings and settings fields.
8674 // If target is omitted, writes into ajaxSettings.
8675 ajaxSetup: function( target, settings ) {
8676 return settings ?
8677
8678 // Building a settings object
8679 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8680
8681 // Extending ajaxSettings
8682 ajaxExtend( jQuery.ajaxSettings, target );
8683 },
8684
8685 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8686 ajaxTransport: addToPrefiltersOrTransports( transports ),
8687
8688 // Main method
8689 ajax: function( url, options ) {
8690
8691 // If url is an object, simulate pre-1.5 signature
8692 if ( typeof url === "object" ) {
8693 options = url;
8694 url = undefined;
8695 }
8696
8697 // Force options to be an object
8698 options = options || {};
8699
8700 var transport,
8701
8702 // URL without anti-cache param
8703 cacheURL,
8704
8705 // Response headers
8706 responseHeadersString,
8707 responseHeaders,
8708
8709 // timeout handle
8710 timeoutTimer,
8711
8712 // Url cleanup var
8713 urlAnchor,
8714
8715 // Request state (becomes false upon send and true upon completion)
8716 completed,
8717
8718 // To know if global events are to be dispatched
8719 fireGlobals,
8720
8721 // Loop variable
8722 i,
8723
8724 // uncached part of the url
8725 uncached,
8726
8727 // Create the final options object
8728 s = jQuery.ajaxSetup( {}, options ),
8729
8730 // Callbacks context
8731 callbackContext = s.context || s,
8732
8733 // Context for global events is callbackContext if it is a DOM node or jQuery collection
8734 globalEventContext = s.context &&
8735 ( callbackContext.nodeType || callbackContext.jquery ) ?
8736 jQuery( callbackContext ) :
8737 jQuery.event,
8738
8739 // Deferreds
8740 deferred = jQuery.Deferred(),
8741 completeDeferred = jQuery.Callbacks( "once memory" ),
8742
8743 // Status-dependent callbacks
8744 statusCode = s.statusCode || {},
8745
8746 // Headers (they are sent all at once)
8747 requestHeaders = {},
8748 requestHeadersNames = {},
8749
8750 // Default abort message
8751 strAbort = "canceled",
8752
8753 // Fake xhr
8754 jqXHR = {
8755 readyState: 0,
8756
8757 // Builds headers hashtable if needed
8758 getResponseHeader: function( key ) {
8759 var match;
8760 if ( completed ) {
8761 if ( !responseHeaders ) {
8762 responseHeaders = {};
8763 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
8764 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
8765 }
8766 }
8767 match = responseHeaders[ key.toLowerCase() ];
8768 }
8769 return match == null ? null : match;
8770 },
8771
8772 // Raw string
8773 getAllResponseHeaders: function() {
8774 return completed ? responseHeadersString : null;
8775 },
8776
8777 // Caches the header
8778 setRequestHeader: function( name, value ) {
8779 if ( completed == null ) {
8780 name = requestHeadersNames[ name.toLowerCase() ] =
8781 requestHeadersNames[ name.toLowerCase() ] || name;
8782 requestHeaders[ name ] = value;
8783 }
8784 return this;
8785 },
8786
8787 // Overrides response content-type header
8788 overrideMimeType: function( type ) {
8789 if ( completed == null ) {
8790 s.mimeType = type;
8791 }
8792 return this;
8793 },
8794
8795 // Status-dependent callbacks
8796 statusCode: function( map ) {
8797 var code;
8798 if ( map ) {
8799 if ( completed ) {
8800
8801 // Execute the appropriate callbacks
8802 jqXHR.always( map[ jqXHR.status ] );
8803 } else {
8804
8805 // Lazy-add the new callbacks in a way that preserves old ones
8806 for ( code in map ) {
8807 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
8808 }
8809 }
8810 }
8811 return this;
8812 },
8813
8814 // Cancel the request
8815 abort: function( statusText ) {
8816 var finalText = statusText || strAbort;
8817 if ( transport ) {
8818 transport.abort( finalText );
8819 }
8820 done( 0, finalText );
8821 return this;
8822 }
8823 };
8824
8825 // Attach deferreds
8826 deferred.promise( jqXHR );
8827
8828 // Add protocol if not provided (prefilters might expect it)
8829 // Handle falsy url in the settings object (#10093: consistency with old signature)
8830 // We also use the url parameter if available
8831 s.url = ( ( url || s.url || location.href ) + "" )
8832 .replace( rprotocol, location.protocol + "//" );
8833
8834 // Alias method option to type as per ticket #12004
8835 s.type = options.method || options.type || s.method || s.type;
8836
8837 // Extract dataTypes list
8838 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
8839
8840 // A cross-domain request is in order when the origin doesn't match the current origin.
8841 if ( s.crossDomain == null ) {
8842 urlAnchor = document.createElement( "a" );
8843
8844 // Support: IE <=8 - 11, Edge 12 - 13
8845 // IE throws exception on accessing the href property if url is malformed,
8846 // e.g. http://example.com:80x/
8847 try {
8848 urlAnchor.href = s.url;
8849
8850 // Support: IE <=8 - 11 only
8851 // Anchor's host property isn't correctly set when s.url is relative
8852 urlAnchor.href = urlAnchor.href;
8853 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
8854 urlAnchor.protocol + "//" + urlAnchor.host;
8855 } catch ( e ) {
8856
8857 // If there is an error parsing the URL, assume it is crossDomain,
8858 // it can be rejected by the transport if it is invalid
8859 s.crossDomain = true;
8860 }
8861 }
8862
8863 // Convert data if not already a string
8864 if ( s.data && s.processData && typeof s.data !== "string" ) {
8865 s.data = jQuery.param( s.data, s.traditional );
8866 }
8867
8868 // Apply prefilters
8869 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
8870
8871 // If request was aborted inside a prefilter, stop there
8872 if ( completed ) {
8873 return jqXHR;
8874 }
8875
8876 // We can fire global events as of now if asked to
8877 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
8878 fireGlobals = jQuery.event && s.global;
8879
8880 // Watch for a new set of requests
8881 if ( fireGlobals && jQuery.active++ === 0 ) {
8882 jQuery.event.trigger( "ajaxStart" );
8883 }
8884
8885 // Uppercase the type
8886 s.type = s.type.toUpperCase();
8887
8888 // Determine if request has content
8889 s.hasContent = !rnoContent.test( s.type );
8890
8891 // Save the URL in case we're toying with the If-Modified-Since
8892 // and/or If-None-Match header later on
8893 // Remove hash to simplify url manipulation
8894 cacheURL = s.url.replace( rhash, "" );
8895
8896 // More options handling for requests with no content
8897 if ( !s.hasContent ) {
8898
8899 // Remember the hash so we can put it back
8900 uncached = s.url.slice( cacheURL.length );
8901
8902 // If data is available, append data to url
8903 if ( s.data ) {
8904 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
8905
8906 // #9682: remove data so that it's not used in an eventual retry
8907 delete s.data;
8908 }
8909
8910 // Add anti-cache in uncached url if needed
8911 if ( s.cache === false ) {
8912 cacheURL = cacheURL.replace( rts, "" );
8913 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
8914 }
8915
8916 // Put hash and anti-cache on the URL that will be requested (gh-1732)
8917 s.url = cacheURL + uncached;
8918
8919 // Change '%20' to '+' if this is encoded form body content (gh-2658)
8920 } else if ( s.data && s.processData &&
8921 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
8922 s.data = s.data.replace( r20, "+" );
8923 }
8924
8925 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
8926 if ( s.ifModified ) {
8927 if ( jQuery.lastModified[ cacheURL ] ) {
8928 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
8929 }
8930 if ( jQuery.etag[ cacheURL ] ) {
8931 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
8932 }
8933 }
8934
8935 // Set the correct header, if data is being sent
8936 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
8937 jqXHR.setRequestHeader( "Content-Type", s.contentType );
8938 }
8939
8940 // Set the Accepts header for the server, depending on the dataType
8941 jqXHR.setRequestHeader(
8942 "Accept",
8943 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
8944 s.accepts[ s.dataTypes[ 0 ] ] +
8945 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
8946 s.accepts[ "*" ]
8947 );
8948
8949 // Check for headers option
8950 for ( i in s.headers ) {
8951 jqXHR.setRequestHeader( i, s.headers[ i ] );
8952 }
8953
8954 // Allow custom headers/mimetypes and early abort
8955 if ( s.beforeSend &&
8956 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
8957
8958 // Abort if not done already and return
8959 return jqXHR.abort();
8960 }
8961
8962 // Aborting is no longer a cancellation
8963 strAbort = "abort";
8964
8965 // Install callbacks on deferreds
8966 completeDeferred.add( s.complete );
8967 jqXHR.done( s.success );
8968 jqXHR.fail( s.error );
8969
8970 // Get transport
8971 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
8972
8973 // If no transport, we auto-abort
8974 if ( !transport ) {
8975 done( -1, "No Transport" );
8976 } else {
8977 jqXHR.readyState = 1;
8978
8979 // Send global event
8980 if ( fireGlobals ) {
8981 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
8982 }
8983
8984 // If request was aborted inside ajaxSend, stop there
8985 if ( completed ) {
8986 return jqXHR;
8987 }
8988
8989 // Timeout
8990 if ( s.async && s.timeout > 0 ) {
8991 timeoutTimer = window.setTimeout( function() {
8992 jqXHR.abort( "timeout" );
8993 }, s.timeout );
8994 }
8995
8996 try {
8997 completed = false;
8998 transport.send( requestHeaders, done );
8999 } catch ( e ) {
9000
9001 // Rethrow post-completion exceptions
9002 if ( completed ) {
9003 throw e;
9004 }
9005
9006 // Propagate others as results
9007 done( -1, e );
9008 }
9009 }
9010
9011 // Callback for when everything is done
9012 function done( status, nativeStatusText, responses, headers ) {
9013 var isSuccess, success, error, response, modified,
9014 statusText = nativeStatusText;
9015
9016 // Ignore repeat invocations
9017 if ( completed ) {
9018 return;
9019 }
9020
9021 completed = true;
9022
9023 // Clear timeout if it exists
9024 if ( timeoutTimer ) {
9025 window.clearTimeout( timeoutTimer );
9026 }
9027
9028 // Dereference transport for early garbage collection
9029 // (no matter how long the jqXHR object will be used)
9030 transport = undefined;
9031
9032 // Cache response headers
9033 responseHeadersString = headers || "";
9034
9035 // Set readyState
9036 jqXHR.readyState = status > 0 ? 4 : 0;
9037
9038 // Determine if successful
9039 isSuccess = status >= 200 && status < 300 || status === 304;
9040
9041 // Get response data
9042 if ( responses ) {
9043 response = ajaxHandleResponses( s, jqXHR, responses );
9044 }
9045
9046 // Convert no matter what (that way responseXXX fields are always set)
9047 response = ajaxConvert( s, response, jqXHR, isSuccess );
9048
9049 // If successful, handle type chaining
9050 if ( isSuccess ) {
9051
9052 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9053 if ( s.ifModified ) {
9054 modified = jqXHR.getResponseHeader( "Last-Modified" );
9055 if ( modified ) {
9056 jQuery.lastModified[ cacheURL ] = modified;
9057 }
9058 modified = jqXHR.getResponseHeader( "etag" );
9059 if ( modified ) {
9060 jQuery.etag[ cacheURL ] = modified;
9061 }
9062 }
9063
9064 // if no content
9065 if ( status === 204 || s.type === "HEAD" ) {
9066 statusText = "nocontent";
9067
9068 // if not modified
9069 } else if ( status === 304 ) {
9070 statusText = "notmodified";
9071
9072 // If we have data, let's convert it
9073 } else {
9074 statusText = response.state;
9075 success = response.data;
9076 error = response.error;
9077 isSuccess = !error;
9078 }
9079 } else {
9080
9081 // Extract error from statusText and normalize for non-aborts
9082 error = statusText;
9083 if ( status || !statusText ) {
9084 statusText = "error";
9085 if ( status < 0 ) {
9086 status = 0;
9087 }
9088 }
9089 }
9090
9091 // Set data for the fake xhr object
9092 jqXHR.status = status;
9093 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9094
9095 // Success/Error
9096 if ( isSuccess ) {
9097 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9098 } else {
9099 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9100 }
9101
9102 // Status-dependent callbacks
9103 jqXHR.statusCode( statusCode );
9104 statusCode = undefined;
9105
9106 if ( fireGlobals ) {
9107 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9108 [ jqXHR, s, isSuccess ? success : error ] );
9109 }
9110
9111 // Complete
9112 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9113
9114 if ( fireGlobals ) {
9115 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9116
9117 // Handle the global AJAX counter
9118 if ( !( --jQuery.active ) ) {
9119 jQuery.event.trigger( "ajaxStop" );
9120 }
9121 }
9122 }
9123
9124 return jqXHR;
9125 },
9126
9127 getJSON: function( url, data, callback ) {
9128 return jQuery.get( url, data, callback, "json" );
9129 },
9130
9131 getScript: function( url, callback ) {
9132 return jQuery.get( url, undefined, callback, "script" );
9133 }
9134 } );
9135
9136 jQuery.each( [ "get", "post" ], function( i, method ) {
9137 jQuery[ method ] = function( url, data, callback, type ) {
9138
9139 // Shift arguments if data argument was omitted
9140 if ( jQuery.isFunction( data ) ) {
9141 type = type || callback;
9142 callback = data;
9143 data = undefined;
9144 }
9145
9146 // The url can be an options object (which then must have .url)
9147 return jQuery.ajax( jQuery.extend( {
9148 url: url,
9149 type: method,
9150 dataType: type,
9151 data: data,
9152 success: callback
9153 }, jQuery.isPlainObject( url ) && url ) );
9154 };
9155 } );
9156
9157
9158 jQuery._evalUrl = function( url ) {
9159 return jQuery.ajax( {
9160 url: url,
9161
9162 // Make this explicit, since user can override this through ajaxSetup (#11264)
9163 type: "GET",
9164 dataType: "script",
9165 cache: true,
9166 async: false,
9167 global: false,
9168 "throws": true
9169 } );
9170 };
9171
9172
9173 jQuery.fn.extend( {
9174 wrapAll: function( html ) {
9175 var wrap;
9176
9177 if ( this[ 0 ] ) {
9178 if ( jQuery.isFunction( html ) ) {
9179 html = html.call( this[ 0 ] );
9180 }
9181
9182 // The elements to wrap the target around
9183 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
9184
9185 if ( this[ 0 ].parentNode ) {
9186 wrap.insertBefore( this[ 0 ] );
9187 }
9188
9189 wrap.map( function() {
9190 var elem = this;
9191
9192 while ( elem.firstElementChild ) {
9193 elem = elem.firstElementChild;
9194 }
9195
9196 return elem;
9197 } ).append( this );
9198 }
9199
9200 return this;
9201 },
9202
9203 wrapInner: function( html ) {
9204 if ( jQuery.isFunction( html ) ) {
9205 return this.each( function( i ) {
9206 jQuery( this ).wrapInner( html.call( this, i ) );
9207 } );
9208 }
9209
9210 return this.each( function() {
9211 var self = jQuery( this ),
9212 contents = self.contents();
9213
9214 if ( contents.length ) {
9215 contents.wrapAll( html );
9216
9217 } else {
9218 self.append( html );
9219 }
9220 } );
9221 },
9222
9223 wrap: function( html ) {
9224 var isFunction = jQuery.isFunction( html );
9225
9226 return this.each( function( i ) {
9227 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
9228 } );
9229 },
9230
9231 unwrap: function( selector ) {
9232 this.parent( selector ).not( "body" ).each( function() {
9233 jQuery( this ).replaceWith( this.childNodes );
9234 } );
9235 return this;
9236 }
9237 } );
9238
9239
9240 jQuery.expr.pseudos.hidden = function( elem ) {
9241 return !jQuery.expr.pseudos.visible( elem );
9242 };
9243 jQuery.expr.pseudos.visible = function( elem ) {
9244 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
9245 };
9246
9247
9248
9249
9250 jQuery.ajaxSettings.xhr = function() {
9251 try {
9252 return new window.XMLHttpRequest();
9253 } catch ( e ) {}
9254 };
9255
9256 var xhrSuccessStatus = {
9257
9258 // File protocol always yields status code 0, assume 200
9259 0: 200,
9260
9261 // Support: IE <=9 only
9262 // #1450: sometimes IE returns 1223 when it should be 204
9263 1223: 204
9264 },
9265 xhrSupported = jQuery.ajaxSettings.xhr();
9266
9267 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9268 support.ajax = xhrSupported = !!xhrSupported;
9269
9270 jQuery.ajaxTransport( function( options ) {
9271 var callback, errorCallback;
9272
9273 // Cross domain only allowed if supported through XMLHttpRequest
9274 if ( support.cors || xhrSupported && !options.crossDomain ) {
9275 return {
9276 send: function( headers, complete ) {
9277 var i,
9278 xhr = options.xhr();
9279
9280 xhr.open(
9281 options.type,
9282 options.url,
9283 options.async,
9284 options.username,
9285 options.password
9286 );
9287
9288 // Apply custom fields if provided
9289 if ( options.xhrFields ) {
9290 for ( i in options.xhrFields ) {
9291 xhr[ i ] = options.xhrFields[ i ];
9292 }
9293 }
9294
9295 // Override mime type if needed
9296 if ( options.mimeType && xhr.overrideMimeType ) {
9297 xhr.overrideMimeType( options.mimeType );
9298 }
9299
9300 // X-Requested-With header
9301 // For cross-domain requests, seeing as conditions for a preflight are
9302 // akin to a jigsaw puzzle, we simply never set it to be sure.
9303 // (it can always be set on a per-request basis or even using ajaxSetup)
9304 // For same-domain requests, won't change header if already provided.
9305 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
9306 headers[ "X-Requested-With" ] = "XMLHttpRequest";
9307 }
9308
9309 // Set headers
9310 for ( i in headers ) {
9311 xhr.setRequestHeader( i, headers[ i ] );
9312 }
9313
9314 // Callback
9315 callback = function( type ) {
9316 return function() {
9317 if ( callback ) {
9318 callback = errorCallback = xhr.onload =
9319 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
9320
9321 if ( type === "abort" ) {
9322 xhr.abort();
9323 } else if ( type === "error" ) {
9324
9325 // Support: IE <=9 only
9326 // On a manual native abort, IE9 throws
9327 // errors on any property access that is not readyState
9328 if ( typeof xhr.status !== "number" ) {
9329 complete( 0, "error" );
9330 } else {
9331 complete(
9332
9333 // File: protocol always yields status 0; see #8605, #14207
9334 xhr.status,
9335 xhr.statusText
9336 );
9337 }
9338 } else {
9339 complete(
9340 xhrSuccessStatus[ xhr.status ] || xhr.status,
9341 xhr.statusText,
9342
9343 // Support: IE <=9 only
9344 // IE9 has no XHR2 but throws on binary (trac-11426)
9345 // For XHR2 non-text, let the caller handle it (gh-2498)
9346 ( xhr.responseType || "text" ) !== "text" ||
9347 typeof xhr.responseText !== "string" ?
9348 { binary: xhr.response } :
9349 { text: xhr.responseText },
9350 xhr.getAllResponseHeaders()
9351 );
9352 }
9353 }
9354 };
9355 };
9356
9357 // Listen to events
9358 xhr.onload = callback();
9359 errorCallback = xhr.onerror = callback( "error" );
9360
9361 // Support: IE 9 only
9362 // Use onreadystatechange to replace onabort
9363 // to handle uncaught aborts
9364 if ( xhr.onabort !== undefined ) {
9365 xhr.onabort = errorCallback;
9366 } else {
9367 xhr.onreadystatechange = function() {
9368
9369 // Check readyState before timeout as it changes
9370 if ( xhr.readyState === 4 ) {
9371
9372 // Allow onerror to be called first,
9373 // but that will not handle a native abort
9374 // Also, save errorCallback to a variable
9375 // as xhr.onerror cannot be accessed
9376 window.setTimeout( function() {
9377 if ( callback ) {
9378 errorCallback();
9379 }
9380 } );
9381 }
9382 };
9383 }
9384
9385 // Create the abort callback
9386 callback = callback( "abort" );
9387
9388 try {
9389
9390 // Do send the request (this may raise an exception)
9391 xhr.send( options.hasContent && options.data || null );
9392 } catch ( e ) {
9393
9394 // #14683: Only rethrow if this hasn't been notified as an error yet
9395 if ( callback ) {
9396 throw e;
9397 }
9398 }
9399 },
9400
9401 abort: function() {
9402 if ( callback ) {
9403 callback();
9404 }
9405 }
9406 };
9407 }
9408 } );
9409
9410
9411
9412
9413 // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
9414 jQuery.ajaxPrefilter( function( s ) {
9415 if ( s.crossDomain ) {
9416 s.contents.script = false;
9417 }
9418 } );
9419
9420 // Install script dataType
9421 jQuery.ajaxSetup( {
9422 accepts: {
9423 script: "text/javascript, application/javascript, " +
9424 "application/ecmascript, application/x-ecmascript"
9425 },
9426 contents: {
9427 script: /\b(?:java|ecma)script\b/
9428 },
9429 converters: {
9430 "text script": function( text ) {
9431 jQuery.globalEval( text );
9432 return text;
9433 }
9434 }
9435 } );
9436
9437 // Handle cache's special case and crossDomain
9438 jQuery.ajaxPrefilter( "script", function( s ) {
9439 if ( s.cache === undefined ) {
9440 s.cache = false;
9441 }
9442 if ( s.crossDomain ) {
9443 s.type = "GET";
9444 }
9445 } );
9446
9447 // Bind script tag hack transport
9448 jQuery.ajaxTransport( "script", function( s ) {
9449
9450 // This transport only deals with cross domain requests
9451 if ( s.crossDomain ) {
9452 var script, callback;
9453 return {
9454 send: function( _, complete ) {
9455 script = jQuery( "<script>" ).prop( {
9456 charset: s.scriptCharset,
9457 src: s.url
9458 } ).on(
9459 "load error",
9460 callback = function( evt ) {
9461 script.remove();
9462 callback = null;
9463 if ( evt ) {
9464 complete( evt.type === "error" ? 404 : 200, evt.type );
9465 }
9466 }
9467 );
9468
9469 // Use native DOM manipulation to avoid our domManip AJAX trickery
9470 document.head.appendChild( script[ 0 ] );
9471 },
9472 abort: function() {
9473 if ( callback ) {
9474 callback();
9475 }
9476 }
9477 };
9478 }
9479 } );
9480
9481
9482
9483
9484 var oldCallbacks = [],
9485 rjsonp = /(=)\?(?=&|$)|\?\?/;
9486
9487 // Default jsonp settings
9488 jQuery.ajaxSetup( {
9489 jsonp: "callback",
9490 jsonpCallback: function() {
9491 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9492 this[ callback ] = true;
9493 return callback;
9494 }
9495 } );
9496
9497 // Detect, normalize options and install callbacks for jsonp requests
9498 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9499
9500 var callbackName, overwritten, responseContainer,
9501 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9502 "url" :
9503 typeof s.data === "string" &&
9504 ( s.contentType || "" )
9505 .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
9506 rjsonp.test( s.data ) && "data"
9507 );
9508
9509 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9510 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9511
9512 // Get callback name, remembering preexisting value associated with it
9513 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9514 s.jsonpCallback() :
9515 s.jsonpCallback;
9516
9517 // Insert callback into url or form data
9518 if ( jsonProp ) {
9519 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9520 } else if ( s.jsonp !== false ) {
9521 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9522 }
9523
9524 // Use data converter to retrieve json after script execution
9525 s.converters[ "script json" ] = function() {
9526 if ( !responseContainer ) {
9527 jQuery.error( callbackName + " was not called" );
9528 }
9529 return responseContainer[ 0 ];
9530 };
9531
9532 // Force json dataType
9533 s.dataTypes[ 0 ] = "json";
9534
9535 // Install callback
9536 overwritten = window[ callbackName ];
9537 window[ callbackName ] = function() {
9538 responseContainer = arguments;
9539 };
9540
9541 // Clean-up function (fires after converters)
9542 jqXHR.always( function() {
9543
9544 // If previous value didn't exist - remove it
9545 if ( overwritten === undefined ) {
9546 jQuery( window ).removeProp( callbackName );
9547
9548 // Otherwise restore preexisting value
9549 } else {
9550 window[ callbackName ] = overwritten;
9551 }
9552
9553 // Save back as free
9554 if ( s[ callbackName ] ) {
9555
9556 // Make sure that re-using the options doesn't screw things around
9557 s.jsonpCallback = originalSettings.jsonpCallback;
9558
9559 // Save the callback name for future use
9560 oldCallbacks.push( callbackName );
9561 }
9562
9563 // Call if it was a function and we have a response
9564 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9565 overwritten( responseContainer[ 0 ] );
9566 }
9567
9568 responseContainer = overwritten = undefined;
9569 } );
9570
9571 // Delegate to script
9572 return "script";
9573 }
9574 } );
9575
9576
9577
9578
9579 // Support: Safari 8 only
9580 // In Safari 8 documents created via document.implementation.createHTMLDocument
9581 // collapse sibling forms: the second one becomes a child of the first one.
9582 // Because of that, this security measure has to be disabled in Safari 8.
9583 // https://bugs.webkit.org/show_bug.cgi?id=137337
9584 support.createHTMLDocument = ( function() {
9585 var body = document.implementation.createHTMLDocument( "" ).body;
9586 body.innerHTML = "<form></form><form></form>";
9587 return body.childNodes.length === 2;
9588 } )();
9589
9590
9591 // Argument "data" should be string of html
9592 // context (optional): If specified, the fragment will be created in this context,
9593 // defaults to document
9594 // keepScripts (optional): If true, will include scripts passed in the html string
9595 jQuery.parseHTML = function( data, context, keepScripts ) {
9596 if ( typeof data !== "string" ) {
9597 return [];
9598 }
9599 if ( typeof context === "boolean" ) {
9600 keepScripts = context;
9601 context = false;
9602 }
9603
9604 var base, parsed, scripts;
9605
9606 if ( !context ) {
9607
9608 // Stop scripts or inline event handlers from being executed immediately
9609 // by using document.implementation
9610 if ( support.createHTMLDocument ) {
9611 context = document.implementation.createHTMLDocument( "" );
9612
9613 // Set the base href for the created document
9614 // so any parsed elements with URLs
9615 // are based on the document's URL (gh-2965)
9616 base = context.createElement( "base" );
9617 base.href = document.location.href;
9618 context.head.appendChild( base );
9619 } else {
9620 context = document;
9621 }
9622 }
9623
9624 parsed = rsingleTag.exec( data );
9625 scripts = !keepScripts && [];
9626
9627 // Single tag
9628 if ( parsed ) {
9629 return [ context.createElement( parsed[ 1 ] ) ];
9630 }
9631
9632 parsed = buildFragment( [ data ], context, scripts );
9633
9634 if ( scripts && scripts.length ) {
9635 jQuery( scripts ).remove();
9636 }
9637
9638 return jQuery.merge( [], parsed.childNodes );
9639 };
9640
9641
9642 /**
9643 * Load a url into a page
9644 */
9645 jQuery.fn.load = function( url, params, callback ) {
9646 var selector, type, response,
9647 self = this,
9648 off = url.indexOf( " " );
9649
9650 if ( off > -1 ) {
9651 selector = jQuery.trim( url.slice( off ) );
9652 url = url.slice( 0, off );
9653 }
9654
9655 // If it's a function
9656 if ( jQuery.isFunction( params ) ) {
9657
9658 // We assume that it's the callback
9659 callback = params;
9660 params = undefined;
9661
9662 // Otherwise, build a param string
9663 } else if ( params && typeof params === "object" ) {
9664 type = "POST";
9665 }
9666
9667 // If we have elements to modify, make the request
9668 if ( self.length > 0 ) {
9669 jQuery.ajax( {
9670 url: url,
9671
9672 // If "type" variable is undefined, then "GET" method will be used.
9673 // Make value of this field explicit since
9674 // user can override it through ajaxSetup method
9675 type: type || "GET",
9676 dataType: "html",
9677 data: params
9678 } ).done( function( responseText ) {
9679
9680 // Save response for use in complete callback
9681 response = arguments;
9682
9683 self.html( selector ?
9684
9685 // If a selector was specified, locate the right elements in a dummy div
9686 // Exclude scripts to avoid IE 'Permission Denied' errors
9687 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
9688
9689 // Otherwise use the full result
9690 responseText );
9691
9692 // If the request succeeds, this function gets "data", "status", "jqXHR"
9693 // but they are ignored because response was set above.
9694 // If it fails, this function gets "jqXHR", "status", "error"
9695 } ).always( callback && function( jqXHR, status ) {
9696 self.each( function() {
9697 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
9698 } );
9699 } );
9700 }
9701
9702 return this;
9703 };
9704
9705
9706
9707
9708 // Attach a bunch of functions for handling common AJAX events
9709 jQuery.each( [
9710 "ajaxStart",
9711 "ajaxStop",
9712 "ajaxComplete",
9713 "ajaxError",
9714 "ajaxSuccess",
9715 "ajaxSend"
9716 ], function( i, type ) {
9717 jQuery.fn[ type ] = function( fn ) {
9718 return this.on( type, fn );
9719 };
9720 } );
9721
9722
9723
9724
9725 jQuery.expr.pseudos.animated = function( elem ) {
9726 return jQuery.grep( jQuery.timers, function( fn ) {
9727 return elem === fn.elem;
9728 } ).length;
9729 };
9730
9731
9732
9733
9734 /**
9735 * Gets a window from an element
9736 */
9737 function getWindow( elem ) {
9738 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
9739 }
9740
9741 jQuery.offset = {
9742 setOffset: function( elem, options, i ) {
9743 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
9744 position = jQuery.css( elem, "position" ),
9745 curElem = jQuery( elem ),
9746 props = {};
9747
9748 // Set position first, in-case top/left are set even on static elem
9749 if ( position === "static" ) {
9750 elem.style.position = "relative";
9751 }
9752
9753 curOffset = curElem.offset();
9754 curCSSTop = jQuery.css( elem, "top" );
9755 curCSSLeft = jQuery.css( elem, "left" );
9756 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
9757 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
9758
9759 // Need to be able to calculate position if either
9760 // top or left is auto and position is either absolute or fixed
9761 if ( calculatePosition ) {
9762 curPosition = curElem.position();
9763 curTop = curPosition.top;
9764 curLeft = curPosition.left;
9765
9766 } else {
9767 curTop = parseFloat( curCSSTop ) || 0;
9768 curLeft = parseFloat( curCSSLeft ) || 0;
9769 }
9770
9771 if ( jQuery.isFunction( options ) ) {
9772
9773 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
9774 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
9775 }
9776
9777 if ( options.top != null ) {
9778 props.top = ( options.top - curOffset.top ) + curTop;
9779 }
9780 if ( options.left != null ) {
9781 props.left = ( options.left - curOffset.left ) + curLeft;
9782 }
9783
9784 if ( "using" in options ) {
9785 options.using.call( elem, props );
9786
9787 } else {
9788 curElem.css( props );
9789 }
9790 }
9791 };
9792
9793 jQuery.fn.extend( {
9794 offset: function( options ) {
9795
9796 // Preserve chaining for setter
9797 if ( arguments.length ) {
9798 return options === undefined ?
9799 this :
9800 this.each( function( i ) {
9801 jQuery.offset.setOffset( this, options, i );
9802 } );
9803 }
9804
9805 var docElem, win, rect, doc,
9806 elem = this[ 0 ];
9807
9808 if ( !elem ) {
9809 return;
9810 }
9811
9812 // Support: IE <=11 only
9813 // Running getBoundingClientRect on a
9814 // disconnected node in IE throws an error
9815 if ( !elem.getClientRects().length ) {
9816 return { top: 0, left: 0 };
9817 }
9818
9819 rect = elem.getBoundingClientRect();
9820
9821 // Make sure element is not hidden (display: none)
9822 if ( rect.width || rect.height ) {
9823 doc = elem.ownerDocument;
9824 win = getWindow( doc );
9825 docElem = doc.documentElement;
9826
9827 return {
9828 top: rect.top + win.pageYOffset - docElem.clientTop,
9829 left: rect.left + win.pageXOffset - docElem.clientLeft
9830 };
9831 }
9832
9833 // Return zeros for disconnected and hidden elements (gh-2310)
9834 return rect;
9835 },
9836
9837 position: function() {
9838 if ( !this[ 0 ] ) {
9839 return;
9840 }
9841
9842 var offsetParent, offset,
9843 elem = this[ 0 ],
9844 parentOffset = { top: 0, left: 0 };
9845
9846 // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
9847 // because it is its only offset parent
9848 if ( jQuery.css( elem, "position" ) === "fixed" ) {
9849
9850 // Assume getBoundingClientRect is there when computed position is fixed
9851 offset = elem.getBoundingClientRect();
9852
9853 } else {
9854
9855 // Get *real* offsetParent
9856 offsetParent = this.offsetParent();
9857
9858 // Get correct offsets
9859 offset = this.offset();
9860 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
9861 parentOffset = offsetParent.offset();
9862 }
9863
9864 // Add offsetParent borders
9865 parentOffset = {
9866 top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
9867 left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
9868 };
9869 }
9870
9871 // Subtract parent offsets and element margins
9872 return {
9873 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
9874 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
9875 };
9876 },
9877
9878 // This method will return documentElement in the following cases:
9879 // 1) For the element inside the iframe without offsetParent, this method will return
9880 // documentElement of the parent window
9881 // 2) For the hidden or detached element
9882 // 3) For body or html element, i.e. in case of the html node - it will return itself
9883 //
9884 // but those exceptions were never presented as a real life use-cases
9885 // and might be considered as more preferable results.
9886 //
9887 // This logic, however, is not guaranteed and can change at any point in the future
9888 offsetParent: function() {
9889 return this.map( function() {
9890 var offsetParent = this.offsetParent;
9891
9892 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
9893 offsetParent = offsetParent.offsetParent;
9894 }
9895
9896 return offsetParent || documentElement;
9897 } );
9898 }
9899 } );
9900
9901 // Create scrollLeft and scrollTop methods
9902 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
9903 var top = "pageYOffset" === prop;
9904
9905 jQuery.fn[ method ] = function( val ) {
9906 return access( this, function( elem, method, val ) {
9907 var win = getWindow( elem );
9908
9909 if ( val === undefined ) {
9910 return win ? win[ prop ] : elem[ method ];
9911 }
9912
9913 if ( win ) {
9914 win.scrollTo(
9915 !top ? val : win.pageXOffset,
9916 top ? val : win.pageYOffset
9917 );
9918
9919 } else {
9920 elem[ method ] = val;
9921 }
9922 }, method, val, arguments.length );
9923 };
9924 } );
9925
9926 // Support: Safari <=7 - 9.1, Chrome <=37 - 49
9927 // Add the top/left cssHooks using jQuery.fn.position
9928 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
9929 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
9930 // getComputedStyle returns percent when specified for top/left/bottom/right;
9931 // rather than make the css module depend on the offset module, just check for it here
9932 jQuery.each( [ "top", "left" ], function( i, prop ) {
9933 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
9934 function( elem, computed ) {
9935 if ( computed ) {
9936 computed = curCSS( elem, prop );
9937
9938 // If curCSS returns percentage, fallback to offset
9939 return rnumnonpx.test( computed ) ?
9940 jQuery( elem ).position()[ prop ] + "px" :
9941 computed;
9942 }
9943 }
9944 );
9945 } );
9946
9947
9948 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
9949 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
9950 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
9951 function( defaultExtra, funcName ) {
9952
9953 // Margin is only for outerHeight, outerWidth
9954 jQuery.fn[ funcName ] = function( margin, value ) {
9955 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
9956 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
9957
9958 return access( this, function( elem, type, value ) {
9959 var doc;
9960
9961 if ( jQuery.isWindow( elem ) ) {
9962
9963 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
9964 return funcName.indexOf( "outer" ) === 0 ?
9965 elem[ "inner" + name ] :
9966 elem.document.documentElement[ "client" + name ];
9967 }
9968
9969 // Get document width or height
9970 if ( elem.nodeType === 9 ) {
9971 doc = elem.documentElement;
9972
9973 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
9974 // whichever is greatest
9975 return Math.max(
9976 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
9977 elem.body[ "offset" + name ], doc[ "offset" + name ],
9978 doc[ "client" + name ]
9979 );
9980 }
9981
9982 return value === undefined ?
9983
9984 // Get width or height on the element, requesting but not forcing parseFloat
9985 jQuery.css( elem, type, extra ) :
9986
9987 // Set width or height on the element
9988 jQuery.style( elem, type, value, extra );
9989 }, type, chainable ? margin : undefined, chainable );
9990 };
9991 } );
9992 } );
9993
9994
9995 jQuery.fn.extend( {
9996
9997 bind: function( types, data, fn ) {
9998 return this.on( types, null, data, fn );
9999 },
10000 unbind: function( types, fn ) {
10001 return this.off( types, null, fn );
10002 },
10003
10004 delegate: function( selector, types, data, fn ) {
10005 return this.on( types, selector, data, fn );
10006 },
10007 undelegate: function( selector, types, fn ) {
10008
10009 // ( namespace ) or ( selector, types [, fn] )
10010 return arguments.length === 1 ?
10011 this.off( selector, "**" ) :
10012 this.off( types, selector || "**", fn );
10013 }
10014 } );
10015
10016 jQuery.parseJSON = JSON.parse;
10017
10018
10019
10020
10021 // Register as a named AMD module, since jQuery can be concatenated with other
10022 // files that may use define, but not via a proper concatenation script that
10023 // understands anonymous AMD modules. A named AMD is safest and most robust
10024 // way to register. Lowercase jquery is used because AMD module names are
10025 // derived from file names, and jQuery is normally delivered in a lowercase
10026 // file name. Do this after creating the global so that if an AMD module wants
10027 // to call noConflict to hide this version of jQuery, it will work.
10028
10029 // Note that for maximum portability, libraries that are not jQuery should
10030 // declare themselves as anonymous modules, and avoid setting a global if an
10031 // AMD loader is present. jQuery is a special case. For more information, see
10032 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10033
10034 if ( typeof define === "function" && define.amd ) {
10035 define( "jquery", [], function() {
10036 return jQuery;
10037 } );
10038 }
10039
10040
10041
10042
10043
10044 var
10045
10046 // Map over jQuery in case of overwrite
10047 _jQuery = window.jQuery,
10048
10049 // Map over the $ in case of overwrite
10050 _$ = window.$;
10051
10052 jQuery.noConflict = function( deep ) {
10053 if ( window.$ === jQuery ) {
10054 window.$ = _$;
10055 }
10056
10057 if ( deep && window.jQuery === jQuery ) {
10058 window.jQuery = _jQuery;
10059 }
10060
10061 return jQuery;
10062 };
10063
10064 // Expose jQuery and $ identifiers, even in AMD
10065 // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10066 // and CommonJS for browser emulators (#13566)
10067 if ( !noGlobal ) {
10068 window.jQuery = window.$ = jQuery;
10069 }
10070
10071
10072 return jQuery;
10073 } );
0 /*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */
1 !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.0",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null!=a?a<0?this[a+this.length]:this[a]:f.call(this)},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=r.isArray(d)))?(e?(e=!1,f=c&&r.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e)}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,M,e),g(f,c,N,e)):(f++,j.call(a,g(f,c,M,e),g(f,c,N,e),g(f,c,M,c.notifyWith))):(d!==M&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,
2 r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},T=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function U(){this.expando=r.expando+U.uid++}U.uid=1,U.prototype={cache:function(a){var b=a[this.expando];return b||(b={},T(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){r.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(K)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var V=new U,W=new U,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function Z(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Y,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c||"false"!==c&&("null"===c?null:+c+""===c?+c:X.test(c)?JSON.parse(c):c)}catch(e){}W.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return W.hasData(a)||V.hasData(a)},data:function(a,b,c){return W.access(a,b,c)},removeData:function(a,b){W.remove(a,b)},_data:function(a,b,c){return V.access(a,b,c)},_removeData:function(a,b){V.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=W.get(f),1===f.nodeType&&!V.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),Z(f,d,e[d])));V.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){W.set(this,a)}):S(this,function(b){var c;if(f&&void 0===b){if(c=W.get(f,a),void 0!==c)return c;if(c=Z(f,a),void 0!==c)return c}else this.each(function(){W.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=V.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var $=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_=new RegExp("^(?:([+-])=|)("+$+")([a-z%]*)$","i"),aa=["Top","Right","Bottom","Left"],ba=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ca=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function da(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&_.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ea={};function fa(a){var b,c=a.ownerDocument,d=a.nodeName,e=ea[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ea[d]=e,e)}function ga(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=V.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&ba(d)&&(e[f]=fa(d))):"none"!==c&&(e[f]="none",V.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ga(this,!0)},hide:function(){return ga(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){ba(this)?r(this).show():r(this).hide()})}});var ha=/^(?:checkbox|radio)$/i,ia=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ja=/^$|\/(?:java|ecma)script/i,ka={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ka.optgroup=ka.option,ka.tbody=ka.tfoot=ka.colgroup=ka.caption=ka.thead,ka.th=ka.td;function la(a,b){var c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function ma(a,b){for(var c=0,d=a.length;c<d;c++)V.set(a[c],"globalEval",!b||V.get(b[c],"globalEval"))}var na=/<|&#?\w+;/;function oa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(na.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ia.exec(f)||["",""])[1].toLowerCase(),i=ka[h]||ka._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=la(l.appendChild(f),"script"),j&&ma(g),c){k=0;while(f=g[k++])ja.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var pa=d.documentElement,qa=/^key/,ra=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,sa=/^([^.]*)(?:\.(.+)|)/;function ta(){return!0}function ua(){return!1}function va(){try{return d.activeElement}catch(a){}}function wa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)wa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=ua;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(pa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=sa.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!==this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;c<h;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?r(e,this).index(i)>-1:r.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==va()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===va()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&r.nodeName(this,"input"))return this.click(),!1},_default:function(a){return r.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ta:ua,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:ua,isPropagationStopped:ua,isImmediatePropagationStopped:ua,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ta,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ta,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ta,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&qa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ra.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return wa(this,a,b,c,d)},one:function(a,b,c,d){return wa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=ua),this.each(function(){r.event.remove(this,a,c,b)})}});var xa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ya=/<script|<style|<link/i,za=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/^true\/(.*)/,Ba=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ca(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Da(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ea(a){var b=Aa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}W.hasData(a)&&(h=W.access(a),i=r.extend({},h),W.set(b,i))}}function Ga(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ha.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ha(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&za.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(m&&(e=oa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(la(e,"script"),Da),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,la(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ea),l=0;l<i;l++)j=h[l],ja.test(j.type||"")&&!V.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Ba,""),k))}return a}function Ia(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(la(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&ma(la(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(xa,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=la(h),f=la(a),d=0,e=f.length;d<e;d++)Ga(f[d],g[d]);if(b)if(c)for(f=f||la(a),g=g||la(h),d=0,e=f.length;d<e;d++)Fa(f[d],g[d]);else Fa(a,h);return g=la(h,"script"),g.length>0&&ma(g,!i&&la(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(la(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!ya.test(a)&&!ka[(ia.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(la(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(la(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var Ja=/^margin/,Ka=new RegExp("^("+$+")(?!px)[a-z%]+$","i"),La=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",pa.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,pa.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Ma(a,b,c){var d,e,f,g,h=a.style;return c=c||La(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ka.test(g)&&Ja.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Na(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Oa=/^(none|table(?!-c[ea]).+)/,Pa={position:"absolute",visibility:"hidden",display:"block"},Qa={letterSpacing:"0",fontWeight:"400"},Ra=["Webkit","Moz","ms"],Sa=d.createElement("div").style;function Ta(a){if(a in Sa)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ra.length;while(c--)if(a=Ra[c]+b,a in Sa)return a}function Ua(a,b,c){var d=_.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Va(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+aa[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+aa[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+aa[f]+"Width",!0,e))):(g+=r.css(a,"padding"+aa[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+aa[f]+"Width",!0,e)));return g}function Wa(a,b,c){var d,e=!0,f=La(a),g="border-box"===r.css(a,"boxSizing",!1,f);if(a.getClientRects().length&&(d=a.getBoundingClientRect()[b]),d<=0||null==d){if(d=Ma(a,b,f),(d<0||null==d)&&(d=a.style[b]),Ka.test(d))return d;e=g&&(o.boxSizingReliable()||d===a.style[b]),d=parseFloat(d)||0}return d+Va(a,b,c||(g?"border":"content"),e,f)+"px"}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ma(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=a.style;return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=_.exec(c))&&e[1]&&(c=da(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b);return b=r.cssProps[h]||(r.cssProps[h]=Ta(h)||h),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Ma(a,b,d)),"normal"===e&&b in Qa&&(e=Qa[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Oa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?Wa(a,b,d):ca(a,Pa,function(){return Wa(a,b,d)})},set:function(a,c,d){var e,f=d&&La(a),g=d&&Va(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=_.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ua(a,c,g)}}}),r.cssHooks.marginLeft=Na(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Ma(a,"marginLeft"))||a.getBoundingClientRect().left-ca(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+aa[d]+b]=f[d]||f[d-2]||f[0];return e}},Ja.test(a)||(r.cssHooks[a+b].set=Ua)}),r.fn.extend({css:function(a,b){return S(this,function(a,b,c){var d,e,f={},g=0;if(r.isArray(b)){for(d=La(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function Xa(a,b,c,d,e){return new Xa.prototype.init(a,b,c,d,e)}r.Tween=Xa,Xa.prototype={constructor:Xa,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Xa.propHooks[this.prop];return a&&a.get?a.get(this):Xa.propHooks._default.get(this)},run:function(a){var b,c=Xa.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Xa.propHooks._default.set(this),this}},Xa.prototype.init.prototype=Xa.prototype,Xa.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Xa.propHooks.scrollTop=Xa.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Xa.prototype.init,r.fx.step={};var Ya,Za,$a=/^(?:toggle|show|hide)$/,_a=/queueHooks$/;function ab(){Za&&(a.requestAnimationFrame(ab),r.fx.tick())}function bb(){return a.setTimeout(function(){Ya=void 0}),Ya=r.now()}function cb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=aa[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function db(a,b,c){for(var d,e=(gb.tweeners[b]||[]).concat(gb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function eb(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&ba(a),q=V.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],$a.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=V.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ga([a],!0),j=a.style.display||j,k=r.css(a,"display"),ga([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=V.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ga([a],!0),m.done(function(){p||ga([a]),V.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=db(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function fb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],r.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function gb(a,b,c){var d,e,f=0,g=gb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Ya||bb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:Ya||bb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(fb(k,j.opts.specialEasing);f<g;f++)if(d=gb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,db,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}r.Animation=r.extend(gb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return da(c.elem,a,_.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(K);for(var c,d=0,e=a.length;d<e;d++)c=a[d],gb.tweeners[c]=gb.tweeners[c]||[],gb.tweeners[c].unshift(b)},prefilters:[eb],prefilter:function(a,b){b?gb.prefilters.unshift(a):gb.prefilters.push(a)}}),r.speed=function(a,b,c){var e=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off||d.hidden?e.duration=0:e.duration="number"==typeof e.duration?e.duration:e.duration in r.fx.speeds?r.fx.speeds[e.duration]:r.fx.speeds._default,null!=e.queue&&e.queue!==!0||(e.queue="fx"),e.old=e.complete,e.complete=function(){r.isFunction(e.old)&&e.old.call(this),e.queue&&r.dequeue(this,e.queue)},e},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(ba).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=gb(this,r.extend({},a),f);(e||V.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=V.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&_a.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=V.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(cb(b,!0),a,d,e)}}),r.each({slideDown:cb("show"),slideUp:cb("hide"),slideToggle:cb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(Ya=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),Ya=void 0},r.fx.timer=function(a){r.timers.push(a),a()?r.fx.start():r.timers.pop()},r.fx.interval=13,r.fx.start=function(){Za||(Za=a.requestAnimationFrame?a.requestAnimationFrame(ab):a.setInterval(r.fx.tick,r.fx.interval))},r.fx.stop=function(){a.cancelAnimationFrame?a.cancelAnimationFrame(Za):a.clearInterval(Za),Za=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var hb,ib=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return S(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?hb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);
3 if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),hb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ib[b]||r.find.attr;ib[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=ib[g],ib[g]=e,e=null!=c(a,b,d)?g:null,ib[g]=f),e}});var jb=/^(?:input|select|textarea|button)$/i,kb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):jb.test(a.nodeName)||kb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});var lb=/[\t\r\n\f]/g;function mb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,mb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,mb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=mb(c),d=1===c.nodeType&&(" "+e+" ").replace(lb," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=r.trim(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,mb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=mb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(c)+" ").replace(lb," ").indexOf(b)>-1)return!0;return!1}});var nb=/\r/g,ob=/[\x20\t\r\n\f]+/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(nb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:r.trim(r.text(a)).replace(ob," ")}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type,g=f?null:[],h=f?e+1:d.length,i=e<0?h:f?e:0;i<h;i++)if(c=d[i],(c.selected||i===e)&&!c.disabled&&(!c.parentNode.disabled||!r.nodeName(c.parentNode,"optgroup"))){if(b=r(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ha.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,""),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Qb=[],Rb=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Qb.pop()||r.expando+"_"+rb++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Rb.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Rb.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Rb,"$1"+e):b.jsonp!==!1&&(b.url+=(sb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Qb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=B.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=oa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=r.trim(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length};function Sb(a){return r.isWindow(a)?a:9===a.nodeType&&a.defaultView}r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),d.width||d.height?(e=f.ownerDocument,c=Sb(e),b=e.documentElement,{top:d.top+c.pageYOffset-b.clientTop,left:d.left+c.pageXOffset-b.clientLeft}):d):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),r.nodeName(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||pa})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return S(this,function(a,d,e){var f=Sb(a);return void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Na(o.pixelPosition,function(a,c){if(c)return c=Ma(a,b),Ka.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return S(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Tb=a.jQuery,Ub=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Ub),b&&a.jQuery===r&&(a.jQuery=Tb),r},b||(a.jQuery=a.$=r),r});
0 /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
1 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
2 */
3 ;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
0 require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){
1 var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');
2
3 // Sphinx theme nav state
4 function ThemeNav () {
5
6 var nav = {
7 navBar: null,
8 win: null,
9 winScroll: false,
10 winResize: false,
11 linkScroll: false,
12 winPosition: 0,
13 winHeight: null,
14 docHeight: null,
15 isRunning: null
16 };
17
18 nav.enable = function () {
19 var self = this;
20
21 jQuery(function ($) {
22 self.init($);
23
24 self.reset();
25 self.win.on('hashchange', self.reset);
26
27 // Set scroll monitor
28 self.win.on('scroll', function () {
29 if (!self.linkScroll) {
30 self.winScroll = true;
31 }
32 });
33 setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
34
35 // Set resize monitor
36 self.win.on('resize', function () {
37 self.winResize = true;
38 });
39 setInterval(function () { if (self.winResize) self.onResize(); }, 25);
40 self.onResize();
41 });
42 };
43
44 nav.init = function ($) {
45 var doc = $(document),
46 self = this;
47
48 this.navBar = $('div.wy-side-scroll:first');
49 this.win = $(window);
50
51 // Set up javascript UX bits
52 $(document)
53 // Shift nav in mobile when clicking the menu.
54 .on('click', "[data-toggle='wy-nav-top']", function() {
55 $("[data-toggle='wy-nav-shift']").toggleClass("shift");
56 $("[data-toggle='rst-versions']").toggleClass("shift");
57 })
58
59 // Nav menu link click operations
60 .on('click', ".wy-menu-vertical .current ul li a", function() {
61 var target = $(this);
62 // Close menu when you click a link.
63 $("[data-toggle='wy-nav-shift']").removeClass("shift");
64 $("[data-toggle='rst-versions']").toggleClass("shift");
65 // Handle dynamic display of l3 and l4 nav lists
66 self.toggleCurrent(target);
67 self.hashChange();
68 })
69 .on('click', "[data-toggle='rst-current-version']", function() {
70 $("[data-toggle='rst-versions']").toggleClass("shift-up");
71 })
72
73 // Make tables responsive
74 $("table.docutils:not(.field-list)")
75 .wrap("<div class='wy-table-responsive'></div>");
76
77 // Add expand links to all parents of nested ul
78 $('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
79 var link = $(this);
80 expand = $('<span class="toctree-expand"></span>');
81 expand.on('click', function (ev) {
82 self.toggleCurrent(link);
83 ev.stopPropagation();
84 return false;
85 });
86 link.prepend(expand);
87 });
88 };
89
90 nav.reset = function () {
91 // Get anchor from URL and open up nested nav
92 var anchor = encodeURI(window.location.hash);
93 if (anchor) {
94 try {
95 var link = $('.wy-menu-vertical')
96 .find('[href="' + anchor + '"]');
97 $('.wy-menu-vertical li.toctree-l1 li.current')
98 .removeClass('current');
99 link.closest('li.toctree-l2').addClass('current');
100 link.closest('li.toctree-l3').addClass('current');
101 link.closest('li.toctree-l4').addClass('current');
102 }
103 catch (err) {
104 console.log("Error expanding nav for anchor", err);
105 }
106 }
107 };
108
109 nav.onScroll = function () {
110 this.winScroll = false;
111 var newWinPosition = this.win.scrollTop(),
112 winBottom = newWinPosition + this.winHeight,
113 navPosition = this.navBar.scrollTop(),
114 newNavPosition = navPosition + (newWinPosition - this.winPosition);
115 if (newWinPosition < 0 || winBottom > this.docHeight) {
116 return;
117 }
118 this.navBar.scrollTop(newNavPosition);
119 this.winPosition = newWinPosition;
120 };
121
122 nav.onResize = function () {
123 this.winResize = false;
124 this.winHeight = this.win.height();
125 this.docHeight = $(document).height();
126 };
127
128 nav.hashChange = function () {
129 this.linkScroll = true;
130 this.win.one('hashchange', function () {
131 this.linkScroll = false;
132 });
133 };
134
135 nav.toggleCurrent = function (elem) {
136 var parent_li = elem.closest('li');
137 parent_li.siblings('li.current').removeClass('current');
138 parent_li.siblings().find('li.current').removeClass('current');
139 parent_li.find('> ul li.current').removeClass('current');
140 parent_li.toggleClass('current');
141 }
142
143 return nav;
144 };
145
146 module.exports.ThemeNav = ThemeNav();
147
148 if (typeof(window) != 'undefined') {
149 window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
150 }
151
152 },{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);
0 .highlight .hll { background-color: #ffffcc }
1 .highlight { background: #eeffcc; }
2 .highlight .c { color: #408090; font-style: italic } /* Comment */
3 .highlight .err { border: 1px solid #FF0000 } /* Error */
4 .highlight .k { color: #007020; font-weight: bold } /* Keyword */
5 .highlight .o { color: #666666 } /* Operator */
6 .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
7 .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
8 .highlight .cp { color: #007020 } /* Comment.Preproc */
9 .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
10 .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
11 .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
12 .highlight .gd { color: #A00000 } /* Generic.Deleted */
13 .highlight .ge { font-style: italic } /* Generic.Emph */
14 .highlight .gr { color: #FF0000 } /* Generic.Error */
15 .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
16 .highlight .gi { color: #00A000 } /* Generic.Inserted */
17 .highlight .go { color: #333333 } /* Generic.Output */
18 .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
19 .highlight .gs { font-weight: bold } /* Generic.Strong */
20 .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
21 .highlight .gt { color: #0044DD } /* Generic.Traceback */
22 .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
23 .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
24 .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
25 .highlight .kp { color: #007020 } /* Keyword.Pseudo */
26 .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
27 .highlight .kt { color: #902000 } /* Keyword.Type */
28 .highlight .m { color: #208050 } /* Literal.Number */
29 .highlight .s { color: #4070a0 } /* Literal.String */
30 .highlight .na { color: #4070a0 } /* Name.Attribute */
31 .highlight .nb { color: #007020 } /* Name.Builtin */
32 .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
33 .highlight .no { color: #60add5 } /* Name.Constant */
34 .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
35 .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
36 .highlight .ne { color: #007020 } /* Name.Exception */
37 .highlight .nf { color: #06287e } /* Name.Function */
38 .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
39 .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
40 .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
41 .highlight .nv { color: #bb60d5 } /* Name.Variable */
42 .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
43 .highlight .w { color: #bbbbbb } /* Text.Whitespace */
44 .highlight .mb { color: #208050 } /* Literal.Number.Bin */
45 .highlight .mf { color: #208050 } /* Literal.Number.Float */
46 .highlight .mh { color: #208050 } /* Literal.Number.Hex */
47 .highlight .mi { color: #208050 } /* Literal.Number.Integer */
48 .highlight .mo { color: #208050 } /* Literal.Number.Oct */
49 .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
50 .highlight .sc { color: #4070a0 } /* Literal.String.Char */
51 .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
52 .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
53 .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
54 .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
55 .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
56 .highlight .sx { color: #c65d09 } /* Literal.String.Other */
57 .highlight .sr { color: #235388 } /* Literal.String.Regex */
58 .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
59 .highlight .ss { color: #517918 } /* Literal.String.Symbol */
60 .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
61 .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
62 .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
63 .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
64 .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
0 /*
1 * searchtools.js_t
2 * ~~~~~~~~~~~~~~~~
3 *
4 * Sphinx JavaScript utilities for the full-text search.
5 *
6 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11
12 /* Non-minified version JS is _stemmer.js if file is provided */
13 /**
14 * Porter Stemmer
15 */
16 var Stemmer = function() {
17
18 var step2list = {
19 ational: 'ate',
20 tional: 'tion',
21 enci: 'ence',
22 anci: 'ance',
23 izer: 'ize',
24 bli: 'ble',
25 alli: 'al',
26 entli: 'ent',
27 eli: 'e',
28 ousli: 'ous',
29 ization: 'ize',
30 ation: 'ate',
31 ator: 'ate',
32 alism: 'al',
33 iveness: 'ive',
34 fulness: 'ful',
35 ousness: 'ous',
36 aliti: 'al',
37 iviti: 'ive',
38 biliti: 'ble',
39 logi: 'log'
40 };
41
42 var step3list = {
43 icate: 'ic',
44 ative: '',
45 alize: 'al',
46 iciti: 'ic',
47 ical: 'ic',
48 ful: '',
49 ness: ''
50 };
51
52 var c = "[^aeiou]"; // consonant
53 var v = "[aeiouy]"; // vowel
54 var C = c + "[^aeiouy]*"; // consonant sequence
55 var V = v + "[aeiou]*"; // vowel sequence
56
57 var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
58 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
59 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
60 var s_v = "^(" + C + ")?" + v; // vowel in stem
61
62 this.stemWord = function (w) {
63 var stem;
64 var suffix;
65 var firstch;
66 var origword = w;
67
68 if (w.length < 3)
69 return w;
70
71 var re;
72 var re2;
73 var re3;
74 var re4;
75
76 firstch = w.substr(0,1);
77 if (firstch == "y")
78 w = firstch.toUpperCase() + w.substr(1);
79
80 // Step 1a
81 re = /^(.+?)(ss|i)es$/;
82 re2 = /^(.+?)([^s])s$/;
83
84 if (re.test(w))
85 w = w.replace(re,"$1$2");
86 else if (re2.test(w))
87 w = w.replace(re2,"$1$2");
88
89 // Step 1b
90 re = /^(.+?)eed$/;
91 re2 = /^(.+?)(ed|ing)$/;
92 if (re.test(w)) {
93 var fp = re.exec(w);
94 re = new RegExp(mgr0);
95 if (re.test(fp[1])) {
96 re = /.$/;
97 w = w.replace(re,"");
98 }
99 }
100 else if (re2.test(w)) {
101 var fp = re2.exec(w);
102 stem = fp[1];
103 re2 = new RegExp(s_v);
104 if (re2.test(stem)) {
105 w = stem;
106 re2 = /(at|bl|iz)$/;
107 re3 = new RegExp("([^aeiouylsz])\\1$");
108 re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
109 if (re2.test(w))
110 w = w + "e";
111 else if (re3.test(w)) {
112 re = /.$/;
113 w = w.replace(re,"");
114 }
115 else if (re4.test(w))
116 w = w + "e";
117 }
118 }
119
120 // Step 1c
121 re = /^(.+?)y$/;
122 if (re.test(w)) {
123 var fp = re.exec(w);
124 stem = fp[1];
125 re = new RegExp(s_v);
126 if (re.test(stem))
127 w = stem + "i";
128 }
129
130 // Step 2
131 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
132 if (re.test(w)) {
133 var fp = re.exec(w);
134 stem = fp[1];
135 suffix = fp[2];
136 re = new RegExp(mgr0);
137 if (re.test(stem))
138 w = stem + step2list[suffix];
139 }
140
141 // Step 3
142 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
143 if (re.test(w)) {
144 var fp = re.exec(w);
145 stem = fp[1];
146 suffix = fp[2];
147 re = new RegExp(mgr0);
148 if (re.test(stem))
149 w = stem + step3list[suffix];
150 }
151
152 // Step 4
153 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
154 re2 = /^(.+?)(s|t)(ion)$/;
155 if (re.test(w)) {
156 var fp = re.exec(w);
157 stem = fp[1];
158 re = new RegExp(mgr1);
159 if (re.test(stem))
160 w = stem;
161 }
162 else if (re2.test(w)) {
163 var fp = re2.exec(w);
164 stem = fp[1] + fp[2];
165 re2 = new RegExp(mgr1);
166 if (re2.test(stem))
167 w = stem;
168 }
169
170 // Step 5
171 re = /^(.+?)e$/;
172 if (re.test(w)) {
173 var fp = re.exec(w);
174 stem = fp[1];
175 re = new RegExp(mgr1);
176 re2 = new RegExp(meq1);
177 re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
178 if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
179 w = stem;
180 }
181 re = /ll$/;
182 re2 = new RegExp(mgr1);
183 if (re.test(w) && re2.test(w)) {
184 re = /.$/;
185 w = w.replace(re,"");
186 }
187
188 // and turn initial Y back to y
189 if (firstch == "y")
190 w = firstch.toLowerCase() + w.substr(1);
191 return w;
192 }
193 }
194
195
196
197 /**
198 * Simple result scoring code.
199 */
200 var Scorer = {
201 // Implement the following function to further tweak the score for each result
202 // The function takes a result array [filename, title, anchor, descr, score]
203 // and returns the new score.
204 /*
205 score: function(result) {
206 return result[4];
207 },
208 */
209
210 // query matches the full name of an object
211 objNameMatch: 11,
212 // or matches in the last dotted part of the object name
213 objPartialMatch: 6,
214 // Additive scores depending on the priority of the object
215 objPrio: {0: 15, // used to be importantResults
216 1: 5, // used to be objectResults
217 2: -5}, // used to be unimportantResults
218 // Used when the priority is not in the mapping.
219 objPrioDefault: 0,
220
221 // query found in title
222 title: 15,
223 // query found in terms
224 term: 5
225 };
226
227
228
229
230
231 var splitChars = (function() {
232 var result = {};
233 var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
234 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
235 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
236 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
237 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
238 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
239 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
240 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
241 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
242 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
243 var i, j, start, end;
244 for (i = 0; i < singles.length; i++) {
245 result[singles[i]] = true;
246 }
247 var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
248 [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
249 [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
250 [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
251 [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
252 [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
253 [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
254 [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
255 [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
256 [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
257 [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
258 [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
259 [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
260 [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
261 [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
262 [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
263 [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
264 [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
265 [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
266 [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
267 [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
268 [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
269 [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
270 [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
271 [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
272 [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
273 [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
274 [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
275 [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
276 [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
277 [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
278 [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
279 [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
280 [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
281 [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
282 [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
283 [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
284 [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
285 [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
286 [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
287 [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
288 [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
289 [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
290 [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
291 [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
292 [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
293 [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
294 [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
295 [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
296 for (i = 0; i < ranges.length; i++) {
297 start = ranges[i][0];
298 end = ranges[i][1];
299 for (j = start; j <= end; j++) {
300 result[j] = true;
301 }
302 }
303 return result;
304 })();
305
306 function splitQuery(query) {
307 var result = [];
308 var start = -1;
309 for (var i = 0; i < query.length; i++) {
310 if (splitChars[query.charCodeAt(i)]) {
311 if (start !== -1) {
312 result.push(query.slice(start, i));
313 start = -1;
314 }
315 } else if (start === -1) {
316 start = i;
317 }
318 }
319 if (start !== -1) {
320 result.push(query.slice(start));
321 }
322 return result;
323 }
324
325
326
327
328 /**
329 * Search Module
330 */
331 var Search = {
332
333 _index : null,
334 _queued_query : null,
335 _pulse_status : -1,
336
337 init : function() {
338 var params = $.getQueryParameters();
339 if (params.q) {
340 var query = params.q[0];
341 $('input[name="q"]')[0].value = query;
342 this.performSearch(query);
343 }
344 },
345
346 loadIndex : function(url) {
347 $.ajax({type: "GET", url: url, data: null,
348 dataType: "script", cache: true,
349 complete: function(jqxhr, textstatus) {
350 if (textstatus != "success") {
351 document.getElementById("searchindexloader").src = url;
352 }
353 }});
354 },
355
356 setIndex : function(index) {
357 var q;
358 this._index = index;
359 if ((q = this._queued_query) !== null) {
360 this._queued_query = null;
361 Search.query(q);
362 }
363 },
364
365 hasIndex : function() {
366 return this._index !== null;
367 },
368
369 deferQuery : function(query) {
370 this._queued_query = query;
371 },
372
373 stopPulse : function() {
374 this._pulse_status = 0;
375 },
376
377 startPulse : function() {
378 if (this._pulse_status >= 0)
379 return;
380 function pulse() {
381 var i;
382 Search._pulse_status = (Search._pulse_status + 1) % 4;
383 var dotString = '';
384 for (i = 0; i < Search._pulse_status; i++)
385 dotString += '.';
386 Search.dots.text(dotString);
387 if (Search._pulse_status > -1)
388 window.setTimeout(pulse, 500);
389 }
390 pulse();
391 },
392
393 /**
394 * perform a search for something (or wait until index is loaded)
395 */
396 performSearch : function(query) {
397 // create the required interface elements
398 this.out = $('#search-results');
399 this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
400 this.dots = $('<span></span>').appendTo(this.title);
401 this.status = $('<p style="display: none"></p>').appendTo(this.out);
402 this.output = $('<ul class="search"/>').appendTo(this.out);
403
404 $('#search-progress').text(_('Preparing search...'));
405 this.startPulse();
406
407 // index already loaded, the browser was quick!
408 if (this.hasIndex())
409 this.query(query);
410 else
411 this.deferQuery(query);
412 },
413
414 /**
415 * execute search (requires search index to be loaded)
416 */
417 query : function(query) {
418 var i;
419 var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
420
421 // stem the searchterms and add them to the correct list
422 var stemmer = new Stemmer();
423 var searchterms = [];
424 var excluded = [];
425 var hlterms = [];
426 var tmp = splitQuery(query);
427 var objectterms = [];
428 for (i = 0; i < tmp.length; i++) {
429 if (tmp[i] !== "") {
430 objectterms.push(tmp[i].toLowerCase());
431 }
432
433 if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
434 tmp[i] === "") {
435 // skip this "word"
436 continue;
437 }
438 // stem the word
439 var word = stemmer.stemWord(tmp[i].toLowerCase());
440 // prevent stemmer from cutting word smaller than two chars
441 if(word.length < 3 && tmp[i].length >= 3) {
442 word = tmp[i];
443 }
444 var toAppend;
445 // select the correct list
446 if (word[0] == '-') {
447 toAppend = excluded;
448 word = word.substr(1);
449 }
450 else {
451 toAppend = searchterms;
452 hlterms.push(tmp[i].toLowerCase());
453 }
454 // only add if not already in the list
455 if (!$u.contains(toAppend, word))
456 toAppend.push(word);
457 }
458 var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
459
460 // console.debug('SEARCH: searching for:');
461 // console.info('required: ', searchterms);
462 // console.info('excluded: ', excluded);
463
464 // prepare search
465 var terms = this._index.terms;
466 var titleterms = this._index.titleterms;
467
468 // array of [filename, title, anchor, descr, score]
469 var results = [];
470 $('#search-progress').empty();
471
472 // lookup as object
473 for (i = 0; i < objectterms.length; i++) {
474 var others = [].concat(objectterms.slice(0, i),
475 objectterms.slice(i+1, objectterms.length));
476 results = results.concat(this.performObjectSearch(objectterms[i], others));
477 }
478
479 // lookup as search terms in fulltext
480 results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
481
482 // let the scorer override scores with a custom scoring function
483 if (Scorer.score) {
484 for (i = 0; i < results.length; i++)
485 results[i][4] = Scorer.score(results[i]);
486 }
487
488 // now sort the results by score (in opposite order of appearance, since the
489 // display function below uses pop() to retrieve items) and then
490 // alphabetically
491 results.sort(function(a, b) {
492 var left = a[4];
493 var right = b[4];
494 if (left > right) {
495 return 1;
496 } else if (left < right) {
497 return -1;
498 } else {
499 // same score: sort alphabetically
500 left = a[1].toLowerCase();
501 right = b[1].toLowerCase();
502 return (left > right) ? -1 : ((left < right) ? 1 : 0);
503 }
504 });
505
506 // for debugging
507 //Search.lastresults = results.slice(); // a copy
508 //console.info('search results:', Search.lastresults);
509
510 // print the results
511 var resultCount = results.length;
512 function displayNextItem() {
513 // results left, load the summary and display it
514 if (results.length) {
515 var item = results.pop();
516 var listItem = $('<li style="display:none"></li>');
517 if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
518 // dirhtml builder
519 var dirname = item[0] + '/';
520 if (dirname.match(/\/index\/$/)) {
521 dirname = dirname.substring(0, dirname.length-6);
522 } else if (dirname == 'index/') {
523 dirname = '';
524 }
525 listItem.append($('<a/>').attr('href',
526 DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
527 highlightstring + item[2]).html(item[1]));
528 } else {
529 // normal html builders
530 listItem.append($('<a/>').attr('href',
531 item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
532 highlightstring + item[2]).html(item[1]));
533 }
534 if (item[3]) {
535 listItem.append($('<span> (' + item[3] + ')</span>'));
536 Search.output.append(listItem);
537 listItem.slideDown(5, function() {
538 displayNextItem();
539 });
540 } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
541 var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
542 $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
543 dataType: "text",
544 complete: function(jqxhr, textstatus) {
545 var data = jqxhr.responseText;
546 if (data !== '' && data !== undefined) {
547 listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
548 }
549 Search.output.append(listItem);
550 listItem.slideDown(5, function() {
551 displayNextItem();
552 });
553 }});
554 } else {
555 // no source available, just display title
556 Search.output.append(listItem);
557 listItem.slideDown(5, function() {
558 displayNextItem();
559 });
560 }
561 }
562 // search finished, update title and status message
563 else {
564 Search.stopPulse();
565 Search.title.text(_('Search Results'));
566 if (!resultCount)
567 Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
568 else
569 Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
570 Search.status.fadeIn(500);
571 }
572 }
573 displayNextItem();
574 },
575
576 /**
577 * search for object names
578 */
579 performObjectSearch : function(object, otherterms) {
580 var filenames = this._index.filenames;
581 var docnames = this._index.docnames;
582 var objects = this._index.objects;
583 var objnames = this._index.objnames;
584 var titles = this._index.titles;
585
586 var i;
587 var results = [];
588
589 for (var prefix in objects) {
590 for (var name in objects[prefix]) {
591 var fullname = (prefix ? prefix + '.' : '') + name;
592 if (fullname.toLowerCase().indexOf(object) > -1) {
593 var score = 0;
594 var parts = fullname.split('.');
595 // check for different match types: exact matches of full name or
596 // "last name" (i.e. last dotted part)
597 if (fullname == object || parts[parts.length - 1] == object) {
598 score += Scorer.objNameMatch;
599 // matches in last name
600 } else if (parts[parts.length - 1].indexOf(object) > -1) {
601 score += Scorer.objPartialMatch;
602 }
603 var match = objects[prefix][name];
604 var objname = objnames[match[1]][2];
605 var title = titles[match[0]];
606 // If more than one term searched for, we require other words to be
607 // found in the name/title/description
608 if (otherterms.length > 0) {
609 var haystack = (prefix + ' ' + name + ' ' +
610 objname + ' ' + title).toLowerCase();
611 var allfound = true;
612 for (i = 0; i < otherterms.length; i++) {
613 if (haystack.indexOf(otherterms[i]) == -1) {
614 allfound = false;
615 break;
616 }
617 }
618 if (!allfound) {
619 continue;
620 }
621 }
622 var descr = objname + _(', in ') + title;
623
624 var anchor = match[3];
625 if (anchor === '')
626 anchor = fullname;
627 else if (anchor == '-')
628 anchor = objnames[match[1]][1] + '-' + fullname;
629 // add custom score for some objects according to scorer
630 if (Scorer.objPrio.hasOwnProperty(match[2])) {
631 score += Scorer.objPrio[match[2]];
632 } else {
633 score += Scorer.objPrioDefault;
634 }
635 results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
636 }
637 }
638 }
639
640 return results;
641 },
642
643 /**
644 * search for full-text terms in the index
645 */
646 performTermsSearch : function(searchterms, excluded, terms, titleterms) {
647 var docnames = this._index.docnames;
648 var filenames = this._index.filenames;
649 var titles = this._index.titles;
650
651 var i, j, file;
652 var fileMap = {};
653 var scoreMap = {};
654 var results = [];
655
656 // perform the search on the required terms
657 for (i = 0; i < searchterms.length; i++) {
658 var word = searchterms[i];
659 var files = [];
660 var _o = [
661 {files: terms[word], score: Scorer.term},
662 {files: titleterms[word], score: Scorer.title}
663 ];
664
665 // no match but word was a required one
666 if ($u.every(_o, function(o){return o.files === undefined;})) {
667 break;
668 }
669 // found search word in contents
670 $u.each(_o, function(o) {
671 var _files = o.files;
672 if (_files === undefined)
673 return
674
675 if (_files.length === undefined)
676 _files = [_files];
677 files = files.concat(_files);
678
679 // set score for the word in each file to Scorer.term
680 for (j = 0; j < _files.length; j++) {
681 file = _files[j];
682 if (!(file in scoreMap))
683 scoreMap[file] = {}
684 scoreMap[file][word] = o.score;
685 }
686 });
687
688 // create the mapping
689 for (j = 0; j < files.length; j++) {
690 file = files[j];
691 if (file in fileMap)
692 fileMap[file].push(word);
693 else
694 fileMap[file] = [word];
695 }
696 }
697
698 // now check if the files don't contain excluded terms
699 for (file in fileMap) {
700 var valid = true;
701
702 // check if all requirements are matched
703 if (fileMap[file].length != searchterms.length)
704 continue;
705
706 // ensure that none of the excluded terms is in the search result
707 for (i = 0; i < excluded.length; i++) {
708 if (terms[excluded[i]] == file ||
709 titleterms[excluded[i]] == file ||
710 $u.contains(terms[excluded[i]] || [], file) ||
711 $u.contains(titleterms[excluded[i]] || [], file)) {
712 valid = false;
713 break;
714 }
715 }
716
717 // if we have still a valid result we can add it to the result list
718 if (valid) {
719 // select one (max) score for the file.
720 // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
721 var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
722 results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
723 }
724 }
725 return results;
726 },
727
728 /**
729 * helper function to return a node containing the
730 * search summary for a given text. keywords is a list
731 * of stemmed words, hlwords is the list of normal, unstemmed
732 * words. the first one is used to find the occurrence, the
733 * latter for highlighting it.
734 */
735 makeSearchSummary : function(text, keywords, hlwords) {
736 var textLower = text.toLowerCase();
737 var start = 0;
738 $.each(keywords, function() {
739 var i = textLower.indexOf(this.toLowerCase());
740 if (i > -1)
741 start = i;
742 });
743 start = Math.max(start - 120, 0);
744 var excerpt = ((start > 0) ? '...' : '') +
745 $.trim(text.substr(start, 240)) +
746 ((start + 240 - text.length) ? '...' : '');
747 var rv = $('<div class="context"></div>').text(excerpt);
748 $.each(hlwords, function() {
749 rv = rv.highlightText(this, 'highlighted');
750 });
751 return rv;
752 }
753 };
754
755 $(document).ready(function() {
756 Search.init();
757 });
0 // Underscore.js 1.3.1
1 // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
2 // Underscore is freely distributable under the MIT license.
3 // Portions of Underscore are inspired or borrowed from Prototype,
4 // Oliver Steele's Functional, and John Resig's Micro-Templating.
5 // For all details and documentation:
6 // http://documentcloud.github.com/underscore
7
8 (function() {
9
10 // Baseline setup
11 // --------------
12
13 // Establish the root object, `window` in the browser, or `global` on the server.
14 var root = this;
15
16 // Save the previous value of the `_` variable.
17 var previousUnderscore = root._;
18
19 // Establish the object that gets returned to break out of a loop iteration.
20 var breaker = {};
21
22 // Save bytes in the minified (but not gzipped) version:
23 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
24
25 // Create quick reference variables for speed access to core prototypes.
26 var slice = ArrayProto.slice,
27 unshift = ArrayProto.unshift,
28 toString = ObjProto.toString,
29 hasOwnProperty = ObjProto.hasOwnProperty;
30
31 // All **ECMAScript 5** native function implementations that we hope to use
32 // are declared here.
33 var
34 nativeForEach = ArrayProto.forEach,
35 nativeMap = ArrayProto.map,
36 nativeReduce = ArrayProto.reduce,
37 nativeReduceRight = ArrayProto.reduceRight,
38 nativeFilter = ArrayProto.filter,
39 nativeEvery = ArrayProto.every,
40 nativeSome = ArrayProto.some,
41 nativeIndexOf = ArrayProto.indexOf,
42 nativeLastIndexOf = ArrayProto.lastIndexOf,
43 nativeIsArray = Array.isArray,
44 nativeKeys = Object.keys,
45 nativeBind = FuncProto.bind;
46
47 // Create a safe reference to the Underscore object for use below.
48 var _ = function(obj) { return new wrapper(obj); };
49
50 // Export the Underscore object for **Node.js**, with
51 // backwards-compatibility for the old `require()` API. If we're in
52 // the browser, add `_` as a global object via a string identifier,
53 // for Closure Compiler "advanced" mode.
54 if (typeof exports !== 'undefined') {
55 if (typeof module !== 'undefined' && module.exports) {
56 exports = module.exports = _;
57 }
58 exports._ = _;
59 } else {
60 root['_'] = _;
61 }
62
63 // Current version.
64 _.VERSION = '1.3.1';
65
66 // Collection Functions
67 // --------------------
68
69 // The cornerstone, an `each` implementation, aka `forEach`.
70 // Handles objects with the built-in `forEach`, arrays, and raw objects.
71 // Delegates to **ECMAScript 5**'s native `forEach` if available.
72 var each = _.each = _.forEach = function(obj, iterator, context) {
73 if (obj == null) return;
74 if (nativeForEach && obj.forEach === nativeForEach) {
75 obj.forEach(iterator, context);
76 } else if (obj.length === +obj.length) {
77 for (var i = 0, l = obj.length; i < l; i++) {
78 if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
79 }
80 } else {
81 for (var key in obj) {
82 if (_.has(obj, key)) {
83 if (iterator.call(context, obj[key], key, obj) === breaker) return;
84 }
85 }
86 }
87 };
88
89 // Return the results of applying the iterator to each element.
90 // Delegates to **ECMAScript 5**'s native `map` if available.
91 _.map = _.collect = function(obj, iterator, context) {
92 var results = [];
93 if (obj == null) return results;
94 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
95 each(obj, function(value, index, list) {
96 results[results.length] = iterator.call(context, value, index, list);
97 });
98 if (obj.length === +obj.length) results.length = obj.length;
99 return results;
100 };
101
102 // **Reduce** builds up a single result from a list of values, aka `inject`,
103 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
104 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
105 var initial = arguments.length > 2;
106 if (obj == null) obj = [];
107 if (nativeReduce && obj.reduce === nativeReduce) {
108 if (context) iterator = _.bind(iterator, context);
109 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
110 }
111 each(obj, function(value, index, list) {
112 if (!initial) {
113 memo = value;
114 initial = true;
115 } else {
116 memo = iterator.call(context, memo, value, index, list);
117 }
118 });
119 if (!initial) throw new TypeError('Reduce of empty array with no initial value');
120 return memo;
121 };
122
123 // The right-associative version of reduce, also known as `foldr`.
124 // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
125 _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
126 var initial = arguments.length > 2;
127 if (obj == null) obj = [];
128 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
129 if (context) iterator = _.bind(iterator, context);
130 return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
131 }
132 var reversed = _.toArray(obj).reverse();
133 if (context && !initial) iterator = _.bind(iterator, context);
134 return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
135 };
136
137 // Return the first value which passes a truth test. Aliased as `detect`.
138 _.find = _.detect = function(obj, iterator, context) {
139 var result;
140 any(obj, function(value, index, list) {
141 if (iterator.call(context, value, index, list)) {
142 result = value;
143 return true;
144 }
145 });
146 return result;
147 };
148
149 // Return all the elements that pass a truth test.
150 // Delegates to **ECMAScript 5**'s native `filter` if available.
151 // Aliased as `select`.
152 _.filter = _.select = function(obj, iterator, context) {
153 var results = [];
154 if (obj == null) return results;
155 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
156 each(obj, function(value, index, list) {
157 if (iterator.call(context, value, index, list)) results[results.length] = value;
158 });
159 return results;
160 };
161
162 // Return all the elements for which a truth test fails.
163 _.reject = function(obj, iterator, context) {
164 var results = [];
165 if (obj == null) return results;
166 each(obj, function(value, index, list) {
167 if (!iterator.call(context, value, index, list)) results[results.length] = value;
168 });
169 return results;
170 };
171
172 // Determine whether all of the elements match a truth test.
173 // Delegates to **ECMAScript 5**'s native `every` if available.
174 // Aliased as `all`.
175 _.every = _.all = function(obj, iterator, context) {
176 var result = true;
177 if (obj == null) return result;
178 if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
179 each(obj, function(value, index, list) {
180 if (!(result = result && iterator.call(context, value, index, list))) return breaker;
181 });
182 return result;
183 };
184
185 // Determine if at least one element in the object matches a truth test.
186 // Delegates to **ECMAScript 5**'s native `some` if available.
187 // Aliased as `any`.
188 var any = _.some = _.any = function(obj, iterator, context) {
189 iterator || (iterator = _.identity);
190 var result = false;
191 if (obj == null) return result;
192 if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
193 each(obj, function(value, index, list) {
194 if (result || (result = iterator.call(context, value, index, list))) return breaker;
195 });
196 return !!result;
197 };
198
199 // Determine if a given value is included in the array or object using `===`.
200 // Aliased as `contains`.
201 _.include = _.contains = function(obj, target) {
202 var found = false;
203 if (obj == null) return found;
204 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
205 found = any(obj, function(value) {
206 return value === target;
207 });
208 return found;
209 };
210
211 // Invoke a method (with arguments) on every item in a collection.
212 _.invoke = function(obj, method) {
213 var args = slice.call(arguments, 2);
214 return _.map(obj, function(value) {
215 return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
216 });
217 };
218
219 // Convenience version of a common use case of `map`: fetching a property.
220 _.pluck = function(obj, key) {
221 return _.map(obj, function(value){ return value[key]; });
222 };
223
224 // Return the maximum element or (element-based computation).
225 _.max = function(obj, iterator, context) {
226 if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
227 if (!iterator && _.isEmpty(obj)) return -Infinity;
228 var result = {computed : -Infinity};
229 each(obj, function(value, index, list) {
230 var computed = iterator ? iterator.call(context, value, index, list) : value;
231 computed >= result.computed && (result = {value : value, computed : computed});
232 });
233 return result.value;
234 };
235
236 // Return the minimum element (or element-based computation).
237 _.min = function(obj, iterator, context) {
238 if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
239 if (!iterator && _.isEmpty(obj)) return Infinity;
240 var result = {computed : Infinity};
241 each(obj, function(value, index, list) {
242 var computed = iterator ? iterator.call(context, value, index, list) : value;
243 computed < result.computed && (result = {value : value, computed : computed});
244 });
245 return result.value;
246 };
247
248 // Shuffle an array.
249 _.shuffle = function(obj) {
250 var shuffled = [], rand;
251 each(obj, function(value, index, list) {
252 if (index == 0) {
253 shuffled[0] = value;
254 } else {
255 rand = Math.floor(Math.random() * (index + 1));
256 shuffled[index] = shuffled[rand];
257 shuffled[rand] = value;
258 }
259 });
260 return shuffled;
261 };
262
263 // Sort the object's values by a criterion produced by an iterator.
264 _.sortBy = function(obj, iterator, context) {
265 return _.pluck(_.map(obj, function(value, index, list) {
266 return {
267 value : value,
268 criteria : iterator.call(context, value, index, list)
269 };
270 }).sort(function(left, right) {
271 var a = left.criteria, b = right.criteria;
272 return a < b ? -1 : a > b ? 1 : 0;
273 }), 'value');
274 };
275
276 // Groups the object's values by a criterion. Pass either a string attribute
277 // to group by, or a function that returns the criterion.
278 _.groupBy = function(obj, val) {
279 var result = {};
280 var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
281 each(obj, function(value, index) {
282 var key = iterator(value, index);
283 (result[key] || (result[key] = [])).push(value);
284 });
285 return result;
286 };
287
288 // Use a comparator function to figure out at what index an object should
289 // be inserted so as to maintain order. Uses binary search.
290 _.sortedIndex = function(array, obj, iterator) {
291 iterator || (iterator = _.identity);
292 var low = 0, high = array.length;
293 while (low < high) {
294 var mid = (low + high) >> 1;
295 iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
296 }
297 return low;
298 };
299
300 // Safely convert anything iterable into a real, live array.
301 _.toArray = function(iterable) {
302 if (!iterable) return [];
303 if (iterable.toArray) return iterable.toArray();
304 if (_.isArray(iterable)) return slice.call(iterable);
305 if (_.isArguments(iterable)) return slice.call(iterable);
306 return _.values(iterable);
307 };
308
309 // Return the number of elements in an object.
310 _.size = function(obj) {
311 return _.toArray(obj).length;
312 };
313
314 // Array Functions
315 // ---------------
316
317 // Get the first element of an array. Passing **n** will return the first N
318 // values in the array. Aliased as `head`. The **guard** check allows it to work
319 // with `_.map`.
320 _.first = _.head = function(array, n, guard) {
321 return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
322 };
323
324 // Returns everything but the last entry of the array. Especcialy useful on
325 // the arguments object. Passing **n** will return all the values in
326 // the array, excluding the last N. The **guard** check allows it to work with
327 // `_.map`.
328 _.initial = function(array, n, guard) {
329 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
330 };
331
332 // Get the last element of an array. Passing **n** will return the last N
333 // values in the array. The **guard** check allows it to work with `_.map`.
334 _.last = function(array, n, guard) {
335 if ((n != null) && !guard) {
336 return slice.call(array, Math.max(array.length - n, 0));
337 } else {
338 return array[array.length - 1];
339 }
340 };
341
342 // Returns everything but the first entry of the array. Aliased as `tail`.
343 // Especially useful on the arguments object. Passing an **index** will return
344 // the rest of the values in the array from that index onward. The **guard**
345 // check allows it to work with `_.map`.
346 _.rest = _.tail = function(array, index, guard) {
347 return slice.call(array, (index == null) || guard ? 1 : index);
348 };
349
350 // Trim out all falsy values from an array.
351 _.compact = function(array) {
352 return _.filter(array, function(value){ return !!value; });
353 };
354
355 // Return a completely flattened version of an array.
356 _.flatten = function(array, shallow) {
357 return _.reduce(array, function(memo, value) {
358 if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
359 memo[memo.length] = value;
360 return memo;
361 }, []);
362 };
363
364 // Return a version of the array that does not contain the specified value(s).
365 _.without = function(array) {
366 return _.difference(array, slice.call(arguments, 1));
367 };
368
369 // Produce a duplicate-free version of the array. If the array has already
370 // been sorted, you have the option of using a faster algorithm.
371 // Aliased as `unique`.
372 _.uniq = _.unique = function(array, isSorted, iterator) {
373 var initial = iterator ? _.map(array, iterator) : array;
374 var result = [];
375 _.reduce(initial, function(memo, el, i) {
376 if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
377 memo[memo.length] = el;
378 result[result.length] = array[i];
379 }
380 return memo;
381 }, []);
382 return result;
383 };
384
385 // Produce an array that contains the union: each distinct element from all of
386 // the passed-in arrays.
387 _.union = function() {
388 return _.uniq(_.flatten(arguments, true));
389 };
390
391 // Produce an array that contains every item shared between all the
392 // passed-in arrays. (Aliased as "intersect" for back-compat.)
393 _.intersection = _.intersect = function(array) {
394 var rest = slice.call(arguments, 1);
395 return _.filter(_.uniq(array), function(item) {
396 return _.every(rest, function(other) {
397 return _.indexOf(other, item) >= 0;
398 });
399 });
400 };
401
402 // Take the difference between one array and a number of other arrays.
403 // Only the elements present in just the first array will remain.
404 _.difference = function(array) {
405 var rest = _.flatten(slice.call(arguments, 1));
406 return _.filter(array, function(value){ return !_.include(rest, value); });
407 };
408
409 // Zip together multiple lists into a single array -- elements that share
410 // an index go together.
411 _.zip = function() {
412 var args = slice.call(arguments);
413 var length = _.max(_.pluck(args, 'length'));
414 var results = new Array(length);
415 for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
416 return results;
417 };
418
419 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
420 // we need this function. Return the position of the first occurrence of an
421 // item in an array, or -1 if the item is not included in the array.
422 // Delegates to **ECMAScript 5**'s native `indexOf` if available.
423 // If the array is large and already in sort order, pass `true`
424 // for **isSorted** to use binary search.
425 _.indexOf = function(array, item, isSorted) {
426 if (array == null) return -1;
427 var i, l;
428 if (isSorted) {
429 i = _.sortedIndex(array, item);
430 return array[i] === item ? i : -1;
431 }
432 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
433 for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
434 return -1;
435 };
436
437 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
438 _.lastIndexOf = function(array, item) {
439 if (array == null) return -1;
440 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
441 var i = array.length;
442 while (i--) if (i in array && array[i] === item) return i;
443 return -1;
444 };
445
446 // Generate an integer Array containing an arithmetic progression. A port of
447 // the native Python `range()` function. See
448 // [the Python documentation](http://docs.python.org/library/functions.html#range).
449 _.range = function(start, stop, step) {
450 if (arguments.length <= 1) {
451 stop = start || 0;
452 start = 0;
453 }
454 step = arguments[2] || 1;
455
456 var len = Math.max(Math.ceil((stop - start) / step), 0);
457 var idx = 0;
458 var range = new Array(len);
459
460 while(idx < len) {
461 range[idx++] = start;
462 start += step;
463 }
464
465 return range;
466 };
467
468 // Function (ahem) Functions
469 // ------------------
470
471 // Reusable constructor function for prototype setting.
472 var ctor = function(){};
473
474 // Create a function bound to a given object (assigning `this`, and arguments,
475 // optionally). Binding with arguments is also known as `curry`.
476 // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
477 // We check for `func.bind` first, to fail fast when `func` is undefined.
478 _.bind = function bind(func, context) {
479 var bound, args;
480 if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
481 if (!_.isFunction(func)) throw new TypeError;
482 args = slice.call(arguments, 2);
483 return bound = function() {
484 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
485 ctor.prototype = func.prototype;
486 var self = new ctor;
487 var result = func.apply(self, args.concat(slice.call(arguments)));
488 if (Object(result) === result) return result;
489 return self;
490 };
491 };
492
493 // Bind all of an object's methods to that object. Useful for ensuring that
494 // all callbacks defined on an object belong to it.
495 _.bindAll = function(obj) {
496 var funcs = slice.call(arguments, 1);
497 if (funcs.length == 0) funcs = _.functions(obj);
498 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
499 return obj;
500 };
501
502 // Memoize an expensive function by storing its results.
503 _.memoize = function(func, hasher) {
504 var memo = {};
505 hasher || (hasher = _.identity);
506 return function() {
507 var key = hasher.apply(this, arguments);
508 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
509 };
510 };
511
512 // Delays a function for the given number of milliseconds, and then calls
513 // it with the arguments supplied.
514 _.delay = function(func, wait) {
515 var args = slice.call(arguments, 2);
516 return setTimeout(function(){ return func.apply(func, args); }, wait);
517 };
518
519 // Defers a function, scheduling it to run after the current call stack has
520 // cleared.
521 _.defer = function(func) {
522 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
523 };
524
525 // Returns a function, that, when invoked, will only be triggered at most once
526 // during a given window of time.
527 _.throttle = function(func, wait) {
528 var context, args, timeout, throttling, more;
529 var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
530 return function() {
531 context = this; args = arguments;
532 var later = function() {
533 timeout = null;
534 if (more) func.apply(context, args);
535 whenDone();
536 };
537 if (!timeout) timeout = setTimeout(later, wait);
538 if (throttling) {
539 more = true;
540 } else {
541 func.apply(context, args);
542 }
543 whenDone();
544 throttling = true;
545 };
546 };
547
548 // Returns a function, that, as long as it continues to be invoked, will not
549 // be triggered. The function will be called after it stops being called for
550 // N milliseconds.
551 _.debounce = function(func, wait) {
552 var timeout;
553 return function() {
554 var context = this, args = arguments;
555 var later = function() {
556 timeout = null;
557 func.apply(context, args);
558 };
559 clearTimeout(timeout);
560 timeout = setTimeout(later, wait);
561 };
562 };
563
564 // Returns a function that will be executed at most one time, no matter how
565 // often you call it. Useful for lazy initialization.
566 _.once = function(func) {
567 var ran = false, memo;
568 return function() {
569 if (ran) return memo;
570 ran = true;
571 return memo = func.apply(this, arguments);
572 };
573 };
574
575 // Returns the first function passed as an argument to the second,
576 // allowing you to adjust arguments, run code before and after, and
577 // conditionally execute the original function.
578 _.wrap = function(func, wrapper) {
579 return function() {
580 var args = [func].concat(slice.call(arguments, 0));
581 return wrapper.apply(this, args);
582 };
583 };
584
585 // Returns a function that is the composition of a list of functions, each
586 // consuming the return value of the function that follows.
587 _.compose = function() {
588 var funcs = arguments;
589 return function() {
590 var args = arguments;
591 for (var i = funcs.length - 1; i >= 0; i--) {
592 args = [funcs[i].apply(this, args)];
593 }
594 return args[0];
595 };
596 };
597
598 // Returns a function that will only be executed after being called N times.
599 _.after = function(times, func) {
600 if (times <= 0) return func();
601 return function() {
602 if (--times < 1) { return func.apply(this, arguments); }
603 };
604 };
605
606 // Object Functions
607 // ----------------
608
609 // Retrieve the names of an object's properties.
610 // Delegates to **ECMAScript 5**'s native `Object.keys`
611 _.keys = nativeKeys || function(obj) {
612 if (obj !== Object(obj)) throw new TypeError('Invalid object');
613 var keys = [];
614 for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
615 return keys;
616 };
617
618 // Retrieve the values of an object's properties.
619 _.values = function(obj) {
620 return _.map(obj, _.identity);
621 };
622
623 // Return a sorted list of the function names available on the object.
624 // Aliased as `methods`
625 _.functions = _.methods = function(obj) {
626 var names = [];
627 for (var key in obj) {
628 if (_.isFunction(obj[key])) names.push(key);
629 }
630 return names.sort();
631 };
632
633 // Extend a given object with all the properties in passed-in object(s).
634 _.extend = function(obj) {
635 each(slice.call(arguments, 1), function(source) {
636 for (var prop in source) {
637 obj[prop] = source[prop];
638 }
639 });
640 return obj;
641 };
642
643 // Fill in a given object with default properties.
644 _.defaults = function(obj) {
645 each(slice.call(arguments, 1), function(source) {
646 for (var prop in source) {
647 if (obj[prop] == null) obj[prop] = source[prop];
648 }
649 });
650 return obj;
651 };
652
653 // Create a (shallow-cloned) duplicate of an object.
654 _.clone = function(obj) {
655 if (!_.isObject(obj)) return obj;
656 return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
657 };
658
659 // Invokes interceptor with the obj, and then returns obj.
660 // The primary purpose of this method is to "tap into" a method chain, in
661 // order to perform operations on intermediate results within the chain.
662 _.tap = function(obj, interceptor) {
663 interceptor(obj);
664 return obj;
665 };
666
667 // Internal recursive comparison function.
668 function eq(a, b, stack) {
669 // Identical objects are equal. `0 === -0`, but they aren't identical.
670 // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
671 if (a === b) return a !== 0 || 1 / a == 1 / b;
672 // A strict comparison is necessary because `null == undefined`.
673 if (a == null || b == null) return a === b;
674 // Unwrap any wrapped objects.
675 if (a._chain) a = a._wrapped;
676 if (b._chain) b = b._wrapped;
677 // Invoke a custom `isEqual` method if one is provided.
678 if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
679 if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
680 // Compare `[[Class]]` names.
681 var className = toString.call(a);
682 if (className != toString.call(b)) return false;
683 switch (className) {
684 // Strings, numbers, dates, and booleans are compared by value.
685 case '[object String]':
686 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
687 // equivalent to `new String("5")`.
688 return a == String(b);
689 case '[object Number]':
690 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
691 // other numeric values.
692 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
693 case '[object Date]':
694 case '[object Boolean]':
695 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
696 // millisecond representations. Note that invalid dates with millisecond representations
697 // of `NaN` are not equivalent.
698 return +a == +b;
699 // RegExps are compared by their source patterns and flags.
700 case '[object RegExp]':
701 return a.source == b.source &&
702 a.global == b.global &&
703 a.multiline == b.multiline &&
704 a.ignoreCase == b.ignoreCase;
705 }
706 if (typeof a != 'object' || typeof b != 'object') return false;
707 // Assume equality for cyclic structures. The algorithm for detecting cyclic
708 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
709 var length = stack.length;
710 while (length--) {
711 // Linear search. Performance is inversely proportional to the number of
712 // unique nested structures.
713 if (stack[length] == a) return true;
714 }
715 // Add the first object to the stack of traversed objects.
716 stack.push(a);
717 var size = 0, result = true;
718 // Recursively compare objects and arrays.
719 if (className == '[object Array]') {
720 // Compare array lengths to determine if a deep comparison is necessary.
721 size = a.length;
722 result = size == b.length;
723 if (result) {
724 // Deep compare the contents, ignoring non-numeric properties.
725 while (size--) {
726 // Ensure commutative equality for sparse arrays.
727 if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
728 }
729 }
730 } else {
731 // Objects with different constructors are not equivalent.
732 if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
733 // Deep compare objects.
734 for (var key in a) {
735 if (_.has(a, key)) {
736 // Count the expected number of properties.
737 size++;
738 // Deep compare each member.
739 if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
740 }
741 }
742 // Ensure that both objects contain the same number of properties.
743 if (result) {
744 for (key in b) {
745 if (_.has(b, key) && !(size--)) break;
746 }
747 result = !size;
748 }
749 }
750 // Remove the first object from the stack of traversed objects.
751 stack.pop();
752 return result;
753 }
754
755 // Perform a deep comparison to check if two objects are equal.
756 _.isEqual = function(a, b) {
757 return eq(a, b, []);
758 };
759
760 // Is a given array, string, or object empty?
761 // An "empty" object has no enumerable own-properties.
762 _.isEmpty = function(obj) {
763 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
764 for (var key in obj) if (_.has(obj, key)) return false;
765 return true;
766 };
767
768 // Is a given value a DOM element?
769 _.isElement = function(obj) {
770 return !!(obj && obj.nodeType == 1);
771 };
772
773 // Is a given value an array?
774 // Delegates to ECMA5's native Array.isArray
775 _.isArray = nativeIsArray || function(obj) {
776 return toString.call(obj) == '[object Array]';
777 };
778
779 // Is a given variable an object?
780 _.isObject = function(obj) {
781 return obj === Object(obj);
782 };
783
784 // Is a given variable an arguments object?
785 _.isArguments = function(obj) {
786 return toString.call(obj) == '[object Arguments]';
787 };
788 if (!_.isArguments(arguments)) {
789 _.isArguments = function(obj) {
790 return !!(obj && _.has(obj, 'callee'));
791 };
792 }
793
794 // Is a given value a function?
795 _.isFunction = function(obj) {
796 return toString.call(obj) == '[object Function]';
797 };
798
799 // Is a given value a string?
800 _.isString = function(obj) {
801 return toString.call(obj) == '[object String]';
802 };
803
804 // Is a given value a number?
805 _.isNumber = function(obj) {
806 return toString.call(obj) == '[object Number]';
807 };
808
809 // Is the given value `NaN`?
810 _.isNaN = function(obj) {
811 // `NaN` is the only value for which `===` is not reflexive.
812 return obj !== obj;
813 };
814
815 // Is a given value a boolean?
816 _.isBoolean = function(obj) {
817 return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
818 };
819
820 // Is a given value a date?
821 _.isDate = function(obj) {
822 return toString.call(obj) == '[object Date]';
823 };
824
825 // Is the given value a regular expression?
826 _.isRegExp = function(obj) {
827 return toString.call(obj) == '[object RegExp]';
828 };
829
830 // Is a given value equal to null?
831 _.isNull = function(obj) {
832 return obj === null;
833 };
834
835 // Is a given variable undefined?
836 _.isUndefined = function(obj) {
837 return obj === void 0;
838 };
839
840 // Has own property?
841 _.has = function(obj, key) {
842 return hasOwnProperty.call(obj, key);
843 };
844
845 // Utility Functions
846 // -----------------
847
848 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
849 // previous owner. Returns a reference to the Underscore object.
850 _.noConflict = function() {
851 root._ = previousUnderscore;
852 return this;
853 };
854
855 // Keep the identity function around for default iterators.
856 _.identity = function(value) {
857 return value;
858 };
859
860 // Run a function **n** times.
861 _.times = function (n, iterator, context) {
862 for (var i = 0; i < n; i++) iterator.call(context, i);
863 };
864
865 // Escape a string for HTML interpolation.
866 _.escape = function(string) {
867 return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
868 };
869
870 // Add your own custom functions to the Underscore object, ensuring that
871 // they're correctly added to the OOP wrapper as well.
872 _.mixin = function(obj) {
873 each(_.functions(obj), function(name){
874 addToWrapper(name, _[name] = obj[name]);
875 });
876 };
877
878 // Generate a unique integer id (unique within the entire client session).
879 // Useful for temporary DOM ids.
880 var idCounter = 0;
881 _.uniqueId = function(prefix) {
882 var id = idCounter++;
883 return prefix ? prefix + id : id;
884 };
885
886 // By default, Underscore uses ERB-style template delimiters, change the
887 // following template settings to use alternative delimiters.
888 _.templateSettings = {
889 evaluate : /<%([\s\S]+?)%>/g,
890 interpolate : /<%=([\s\S]+?)%>/g,
891 escape : /<%-([\s\S]+?)%>/g
892 };
893
894 // When customizing `templateSettings`, if you don't want to define an
895 // interpolation, evaluation or escaping regex, we need one that is
896 // guaranteed not to match.
897 var noMatch = /.^/;
898
899 // Within an interpolation, evaluation, or escaping, remove HTML escaping
900 // that had been previously added.
901 var unescape = function(code) {
902 return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
903 };
904
905 // JavaScript micro-templating, similar to John Resig's implementation.
906 // Underscore templating handles arbitrary delimiters, preserves whitespace,
907 // and correctly escapes quotes within interpolated code.
908 _.template = function(str, data) {
909 var c = _.templateSettings;
910 var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
911 'with(obj||{}){__p.push(\'' +
912 str.replace(/\\/g, '\\\\')
913 .replace(/'/g, "\\'")
914 .replace(c.escape || noMatch, function(match, code) {
915 return "',_.escape(" + unescape(code) + "),'";
916 })
917 .replace(c.interpolate || noMatch, function(match, code) {
918 return "'," + unescape(code) + ",'";
919 })
920 .replace(c.evaluate || noMatch, function(match, code) {
921 return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
922 })
923 .replace(/\r/g, '\\r')
924 .replace(/\n/g, '\\n')
925 .replace(/\t/g, '\\t')
926 + "');}return __p.join('');";
927 var func = new Function('obj', '_', tmpl);
928 if (data) return func(data, _);
929 return function(data) {
930 return func.call(this, data, _);
931 };
932 };
933
934 // Add a "chain" function, which will delegate to the wrapper.
935 _.chain = function(obj) {
936 return _(obj).chain();
937 };
938
939 // The OOP Wrapper
940 // ---------------
941
942 // If Underscore is called as a function, it returns a wrapped object that
943 // can be used OO-style. This wrapper holds altered versions of all the
944 // underscore functions. Wrapped objects may be chained.
945 var wrapper = function(obj) { this._wrapped = obj; };
946
947 // Expose `wrapper.prototype` as `_.prototype`
948 _.prototype = wrapper.prototype;
949
950 // Helper function to continue chaining intermediate results.
951 var result = function(obj, chain) {
952 return chain ? _(obj).chain() : obj;
953 };
954
955 // A method to easily add functions to the OOP wrapper.
956 var addToWrapper = function(name, func) {
957 wrapper.prototype[name] = function() {
958 var args = slice.call(arguments);
959 unshift.call(args, this._wrapped);
960 return result(func.apply(_, args), this._chain);
961 };
962 };
963
964 // Add all of the Underscore functions to the wrapper object.
965 _.mixin(_);
966
967 // Add all mutator Array functions to the wrapper.
968 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
969 var method = ArrayProto[name];
970 wrapper.prototype[name] = function() {
971 var wrapped = this._wrapped;
972 method.apply(wrapped, arguments);
973 var length = wrapped.length;
974 if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
975 return result(wrapped, this._chain);
976 };
977 });
978
979 // Add all accessor Array functions to the wrapper.
980 each(['concat', 'join', 'slice'], function(name) {
981 var method = ArrayProto[name];
982 wrapper.prototype[name] = function() {
983 return result(method.apply(this._wrapped, arguments), this._chain);
984 };
985 });
986
987 // Start chaining a wrapped Underscore object.
988 wrapper.prototype.chain = function() {
989 this._chain = true;
990 return this;
991 };
992
993 // Extracts the result from a wrapped and chained object.
994 wrapper.prototype.value = function() {
995 return this._wrapped;
996 };
997
998 }).call(this);
0 // Underscore.js 1.3.1
1 // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
2 // Underscore is freely distributable under the MIT license.
3 // Portions of Underscore are inspired or borrowed from Prototype,
4 // Oliver Steele's Functional, and John Resig's Micro-Templating.
5 // For all details and documentation:
6 // http://documentcloud.github.com/underscore
7 (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
8 c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,
9 h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each=
10 b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==
11 null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
12 function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
13 e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
14 function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});
15 return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
16 c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=
17 b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]);
18 return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,
19 d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};
20 var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,
21 c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true:
22 a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};
23 b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
24 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
25 b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
26 b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};b.mixin=function(a){j(b.functions(a),
27 function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
28 u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
29 function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
30 true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
0 /*
1 * websupport.js
2 * ~~~~~~~~~~~~~
3 *
4 * sphinx.websupport utilities for all documentation.
5 *
6 * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 (function($) {
12 $.fn.autogrow = function() {
13 return this.each(function() {
14 var textarea = this;
15
16 $.fn.autogrow.resize(textarea);
17
18 $(textarea)
19 .focus(function() {
20 textarea.interval = setInterval(function() {
21 $.fn.autogrow.resize(textarea);
22 }, 500);
23 })
24 .blur(function() {
25 clearInterval(textarea.interval);
26 });
27 });
28 };
29
30 $.fn.autogrow.resize = function(textarea) {
31 var lineHeight = parseInt($(textarea).css('line-height'), 10);
32 var lines = textarea.value.split('\n');
33 var columns = textarea.cols;
34 var lineCount = 0;
35 $.each(lines, function() {
36 lineCount += Math.ceil(this.length / columns) || 1;
37 });
38 var height = lineHeight * (lineCount + 1);
39 $(textarea).css('height', height);
40 };
41 })(jQuery);
42
43 (function($) {
44 var comp, by;
45
46 function init() {
47 initEvents();
48 initComparator();
49 }
50
51 function initEvents() {
52 $(document).on("click", 'a.comment-close', function(event) {
53 event.preventDefault();
54 hide($(this).attr('id').substring(2));
55 });
56 $(document).on("click", 'a.vote', function(event) {
57 event.preventDefault();
58 handleVote($(this));
59 });
60 $(document).on("click", 'a.reply', function(event) {
61 event.preventDefault();
62 openReply($(this).attr('id').substring(2));
63 });
64 $(document).on("click", 'a.close-reply', function(event) {
65 event.preventDefault();
66 closeReply($(this).attr('id').substring(2));
67 });
68 $(document).on("click", 'a.sort-option', function(event) {
69 event.preventDefault();
70 handleReSort($(this));
71 });
72 $(document).on("click", 'a.show-proposal', function(event) {
73 event.preventDefault();
74 showProposal($(this).attr('id').substring(2));
75 });
76 $(document).on("click", 'a.hide-proposal', function(event) {
77 event.preventDefault();
78 hideProposal($(this).attr('id').substring(2));
79 });
80 $(document).on("click", 'a.show-propose-change', function(event) {
81 event.preventDefault();
82 showProposeChange($(this).attr('id').substring(2));
83 });
84 $(document).on("click", 'a.hide-propose-change', function(event) {
85 event.preventDefault();
86 hideProposeChange($(this).attr('id').substring(2));
87 });
88 $(document).on("click", 'a.accept-comment', function(event) {
89 event.preventDefault();
90 acceptComment($(this).attr('id').substring(2));
91 });
92 $(document).on("click", 'a.delete-comment', function(event) {
93 event.preventDefault();
94 deleteComment($(this).attr('id').substring(2));
95 });
96 $(document).on("click", 'a.comment-markup', function(event) {
97 event.preventDefault();
98 toggleCommentMarkupBox($(this).attr('id').substring(2));
99 });
100 }
101
102 /**
103 * Set comp, which is a comparator function used for sorting and
104 * inserting comments into the list.
105 */
106 function setComparator() {
107 // If the first three letters are "asc", sort in ascending order
108 // and remove the prefix.
109 if (by.substring(0,3) == 'asc') {
110 var i = by.substring(3);
111 comp = function(a, b) { return a[i] - b[i]; };
112 } else {
113 // Otherwise sort in descending order.
114 comp = function(a, b) { return b[by] - a[by]; };
115 }
116
117 // Reset link styles and format the selected sort option.
118 $('a.sel').attr('href', '#').removeClass('sel');
119 $('a.by' + by).removeAttr('href').addClass('sel');
120 }
121
122 /**
123 * Create a comp function. If the user has preferences stored in
124 * the sortBy cookie, use those, otherwise use the default.
125 */
126 function initComparator() {
127 by = 'rating'; // Default to sort by rating.
128 // If the sortBy cookie is set, use that instead.
129 if (document.cookie.length > 0) {
130 var start = document.cookie.indexOf('sortBy=');
131 if (start != -1) {
132 start = start + 7;
133 var end = document.cookie.indexOf(";", start);
134 if (end == -1) {
135 end = document.cookie.length;
136 by = unescape(document.cookie.substring(start, end));
137 }
138 }
139 }
140 setComparator();
141 }
142
143 /**
144 * Show a comment div.
145 */
146 function show(id) {
147 $('#ao' + id).hide();
148 $('#ah' + id).show();
149 var context = $.extend({id: id}, opts);
150 var popup = $(renderTemplate(popupTemplate, context)).hide();
151 popup.find('textarea[name="proposal"]').hide();
152 popup.find('a.by' + by).addClass('sel');
153 var form = popup.find('#cf' + id);
154 form.submit(function(event) {
155 event.preventDefault();
156 addComment(form);
157 });
158 $('#s' + id).after(popup);
159 popup.slideDown('fast', function() {
160 getComments(id);
161 });
162 }
163
164 /**
165 * Hide a comment div.
166 */
167 function hide(id) {
168 $('#ah' + id).hide();
169 $('#ao' + id).show();
170 var div = $('#sc' + id);
171 div.slideUp('fast', function() {
172 div.remove();
173 });
174 }
175
176 /**
177 * Perform an ajax request to get comments for a node
178 * and insert the comments into the comments tree.
179 */
180 function getComments(id) {
181 $.ajax({
182 type: 'GET',
183 url: opts.getCommentsURL,
184 data: {node: id},
185 success: function(data, textStatus, request) {
186 var ul = $('#cl' + id);
187 var speed = 100;
188 $('#cf' + id)
189 .find('textarea[name="proposal"]')
190 .data('source', data.source);
191
192 if (data.comments.length === 0) {
193 ul.html('<li>No comments yet.</li>');
194 ul.data('empty', true);
195 } else {
196 // If there are comments, sort them and put them in the list.
197 var comments = sortComments(data.comments);
198 speed = data.comments.length * 100;
199 appendComments(comments, ul);
200 ul.data('empty', false);
201 }
202 $('#cn' + id).slideUp(speed + 200);
203 ul.slideDown(speed);
204 },
205 error: function(request, textStatus, error) {
206 showError('Oops, there was a problem retrieving the comments.');
207 },
208 dataType: 'json'
209 });
210 }
211
212 /**
213 * Add a comment via ajax and insert the comment into the comment tree.
214 */
215 function addComment(form) {
216 var node_id = form.find('input[name="node"]').val();
217 var parent_id = form.find('input[name="parent"]').val();
218 var text = form.find('textarea[name="comment"]').val();
219 var proposal = form.find('textarea[name="proposal"]').val();
220
221 if (text == '') {
222 showError('Please enter a comment.');
223 return;
224 }
225
226 // Disable the form that is being submitted.
227 form.find('textarea,input').attr('disabled', 'disabled');
228
229 // Send the comment to the server.
230 $.ajax({
231 type: "POST",
232 url: opts.addCommentURL,
233 dataType: 'json',
234 data: {
235 node: node_id,
236 parent: parent_id,
237 text: text,
238 proposal: proposal
239 },
240 success: function(data, textStatus, error) {
241 // Reset the form.
242 if (node_id) {
243 hideProposeChange(node_id);
244 }
245 form.find('textarea')
246 .val('')
247 .add(form.find('input'))
248 .removeAttr('disabled');
249 var ul = $('#cl' + (node_id || parent_id));
250 if (ul.data('empty')) {
251 $(ul).empty();
252 ul.data('empty', false);
253 }
254 insertComment(data.comment);
255 var ao = $('#ao' + node_id);
256 ao.find('img').attr({'src': opts.commentBrightImage});
257 if (node_id) {
258 // if this was a "root" comment, remove the commenting box
259 // (the user can get it back by reopening the comment popup)
260 $('#ca' + node_id).slideUp();
261 }
262 },
263 error: function(request, textStatus, error) {
264 form.find('textarea,input').removeAttr('disabled');
265 showError('Oops, there was a problem adding the comment.');
266 }
267 });
268 }
269
270 /**
271 * Recursively append comments to the main comment list and children
272 * lists, creating the comment tree.
273 */
274 function appendComments(comments, ul) {
275 $.each(comments, function() {
276 var div = createCommentDiv(this);
277 ul.append($(document.createElement('li')).html(div));
278 appendComments(this.children, div.find('ul.comment-children'));
279 // To avoid stagnating data, don't store the comments children in data.
280 this.children = null;
281 div.data('comment', this);
282 });
283 }
284
285 /**
286 * After adding a new comment, it must be inserted in the correct
287 * location in the comment tree.
288 */
289 function insertComment(comment) {
290 var div = createCommentDiv(comment);
291
292 // To avoid stagnating data, don't store the comments children in data.
293 comment.children = null;
294 div.data('comment', comment);
295
296 var ul = $('#cl' + (comment.node || comment.parent));
297 var siblings = getChildren(ul);
298
299 var li = $(document.createElement('li'));
300 li.hide();
301
302 // Determine where in the parents children list to insert this comment.
303 for(i=0; i < siblings.length; i++) {
304 if (comp(comment, siblings[i]) <= 0) {
305 $('#cd' + siblings[i].id)
306 .parent()
307 .before(li.html(div));
308 li.slideDown('fast');
309 return;
310 }
311 }
312
313 // If we get here, this comment rates lower than all the others,
314 // or it is the only comment in the list.
315 ul.append(li.html(div));
316 li.slideDown('fast');
317 }
318
319 function acceptComment(id) {
320 $.ajax({
321 type: 'POST',
322 url: opts.acceptCommentURL,
323 data: {id: id},
324 success: function(data, textStatus, request) {
325 $('#cm' + id).fadeOut('fast');
326 $('#cd' + id).removeClass('moderate');
327 },
328 error: function(request, textStatus, error) {
329 showError('Oops, there was a problem accepting the comment.');
330 }
331 });
332 }
333
334 function deleteComment(id) {
335 $.ajax({
336 type: 'POST',
337 url: opts.deleteCommentURL,
338 data: {id: id},
339 success: function(data, textStatus, request) {
340 var div = $('#cd' + id);
341 if (data == 'delete') {
342 // Moderator mode: remove the comment and all children immediately
343 div.slideUp('fast', function() {
344 div.remove();
345 });
346 return;
347 }
348 // User mode: only mark the comment as deleted
349 div
350 .find('span.user-id:first')
351 .text('[deleted]').end()
352 .find('div.comment-text:first')
353 .text('[deleted]').end()
354 .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
355 ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
356 .remove();
357 var comment = div.data('comment');
358 comment.username = '[deleted]';
359 comment.text = '[deleted]';
360 div.data('comment', comment);
361 },
362 error: function(request, textStatus, error) {
363 showError('Oops, there was a problem deleting the comment.');
364 }
365 });
366 }
367
368 function showProposal(id) {
369 $('#sp' + id).hide();
370 $('#hp' + id).show();
371 $('#pr' + id).slideDown('fast');
372 }
373
374 function hideProposal(id) {
375 $('#hp' + id).hide();
376 $('#sp' + id).show();
377 $('#pr' + id).slideUp('fast');
378 }
379
380 function showProposeChange(id) {
381 $('#pc' + id).hide();
382 $('#hc' + id).show();
383 var textarea = $('#pt' + id);
384 textarea.val(textarea.data('source'));
385 $.fn.autogrow.resize(textarea[0]);
386 textarea.slideDown('fast');
387 }
388
389 function hideProposeChange(id) {
390 $('#hc' + id).hide();
391 $('#pc' + id).show();
392 var textarea = $('#pt' + id);
393 textarea.val('').removeAttr('disabled');
394 textarea.slideUp('fast');
395 }
396
397 function toggleCommentMarkupBox(id) {
398 $('#mb' + id).toggle();
399 }
400
401 /** Handle when the user clicks on a sort by link. */
402 function handleReSort(link) {
403 var classes = link.attr('class').split(/\s+/);
404 for (var i=0; i<classes.length; i++) {
405 if (classes[i] != 'sort-option') {
406 by = classes[i].substring(2);
407 }
408 }
409 setComparator();
410 // Save/update the sortBy cookie.
411 var expiration = new Date();
412 expiration.setDate(expiration.getDate() + 365);
413 document.cookie= 'sortBy=' + escape(by) +
414 ';expires=' + expiration.toUTCString();
415 $('ul.comment-ul').each(function(index, ul) {
416 var comments = getChildren($(ul), true);
417 comments = sortComments(comments);
418 appendComments(comments, $(ul).empty());
419 });
420 }
421
422 /**
423 * Function to process a vote when a user clicks an arrow.
424 */
425 function handleVote(link) {
426 if (!opts.voting) {
427 showError("You'll need to login to vote.");
428 return;
429 }
430
431 var id = link.attr('id');
432 if (!id) {
433 // Didn't click on one of the voting arrows.
434 return;
435 }
436 // If it is an unvote, the new vote value is 0,
437 // Otherwise it's 1 for an upvote, or -1 for a downvote.
438 var value = 0;
439 if (id.charAt(1) != 'u') {
440 value = id.charAt(0) == 'u' ? 1 : -1;
441 }
442 // The data to be sent to the server.
443 var d = {
444 comment_id: id.substring(2),
445 value: value
446 };
447
448 // Swap the vote and unvote links.
449 link.hide();
450 $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
451 .show();
452
453 // The div the comment is displayed in.
454 var div = $('div#cd' + d.comment_id);
455 var data = div.data('comment');
456
457 // If this is not an unvote, and the other vote arrow has
458 // already been pressed, unpress it.
459 if ((d.value !== 0) && (data.vote === d.value * -1)) {
460 $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
461 $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
462 }
463
464 // Update the comments rating in the local data.
465 data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
466 data.vote = d.value;
467 div.data('comment', data);
468
469 // Change the rating text.
470 div.find('.rating:first')
471 .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
472
473 // Send the vote information to the server.
474 $.ajax({
475 type: "POST",
476 url: opts.processVoteURL,
477 data: d,
478 error: function(request, textStatus, error) {
479 showError('Oops, there was a problem casting that vote.');
480 }
481 });
482 }
483
484 /**
485 * Open a reply form used to reply to an existing comment.
486 */
487 function openReply(id) {
488 // Swap out the reply link for the hide link
489 $('#rl' + id).hide();
490 $('#cr' + id).show();
491
492 // Add the reply li to the children ul.
493 var div = $(renderTemplate(replyTemplate, {id: id})).hide();
494 $('#cl' + id)
495 .prepend(div)
496 // Setup the submit handler for the reply form.
497 .find('#rf' + id)
498 .submit(function(event) {
499 event.preventDefault();
500 addComment($('#rf' + id));
501 closeReply(id);
502 })
503 .find('input[type=button]')
504 .click(function() {
505 closeReply(id);
506 });
507 div.slideDown('fast', function() {
508 $('#rf' + id).find('textarea').focus();
509 });
510 }
511
512 /**
513 * Close the reply form opened with openReply.
514 */
515 function closeReply(id) {
516 // Remove the reply div from the DOM.
517 $('#rd' + id).slideUp('fast', function() {
518 $(this).remove();
519 });
520
521 // Swap out the hide link for the reply link
522 $('#cr' + id).hide();
523 $('#rl' + id).show();
524 }
525
526 /**
527 * Recursively sort a tree of comments using the comp comparator.
528 */
529 function sortComments(comments) {
530 comments.sort(comp);
531 $.each(comments, function() {
532 this.children = sortComments(this.children);
533 });
534 return comments;
535 }
536
537 /**
538 * Get the children comments from a ul. If recursive is true,
539 * recursively include childrens' children.
540 */
541 function getChildren(ul, recursive) {
542 var children = [];
543 ul.children().children("[id^='cd']")
544 .each(function() {
545 var comment = $(this).data('comment');
546 if (recursive)
547 comment.children = getChildren($(this).find('#cl' + comment.id), true);
548 children.push(comment);
549 });
550 return children;
551 }
552
553 /** Create a div to display a comment in. */
554 function createCommentDiv(comment) {
555 if (!comment.displayed && !opts.moderator) {
556 return $('<div class="moderate">Thank you! Your comment will show up '
557 + 'once it is has been approved by a moderator.</div>');
558 }
559 // Prettify the comment rating.
560 comment.pretty_rating = comment.rating + ' point' +
561 (comment.rating == 1 ? '' : 's');
562 // Make a class (for displaying not yet moderated comments differently)
563 comment.css_class = comment.displayed ? '' : ' moderate';
564 // Create a div for this comment.
565 var context = $.extend({}, opts, comment);
566 var div = $(renderTemplate(commentTemplate, context));
567
568 // If the user has voted on this comment, highlight the correct arrow.
569 if (comment.vote) {
570 var direction = (comment.vote == 1) ? 'u' : 'd';
571 div.find('#' + direction + 'v' + comment.id).hide();
572 div.find('#' + direction + 'u' + comment.id).show();
573 }
574
575 if (opts.moderator || comment.text != '[deleted]') {
576 div.find('a.reply').show();
577 if (comment.proposal_diff)
578 div.find('#sp' + comment.id).show();
579 if (opts.moderator && !comment.displayed)
580 div.find('#cm' + comment.id).show();
581 if (opts.moderator || (opts.username == comment.username))
582 div.find('#dc' + comment.id).show();
583 }
584 return div;
585 }
586
587 /**
588 * A simple template renderer. Placeholders such as <%id%> are replaced
589 * by context['id'] with items being escaped. Placeholders such as <#id#>
590 * are not escaped.
591 */
592 function renderTemplate(template, context) {
593 var esc = $(document.createElement('div'));
594
595 function handle(ph, escape) {
596 var cur = context;
597 $.each(ph.split('.'), function() {
598 cur = cur[this];
599 });
600 return escape ? esc.text(cur || "").html() : cur;
601 }
602
603 return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
604 return handle(arguments[2], arguments[1] == '%' ? true : false);
605 });
606 }
607
608 /** Flash an error message briefly. */
609 function showError(message) {
610 $(document.createElement('div')).attr({'class': 'popup-error'})
611 .append($(document.createElement('div'))
612 .attr({'class': 'error-message'}).text(message))
613 .appendTo('body')
614 .fadeIn("slow")
615 .delay(2000)
616 .fadeOut("slow");
617 }
618
619 /** Add a link the user uses to open the comments popup. */
620 $.fn.comment = function() {
621 return this.each(function() {
622 var id = $(this).attr('id').substring(1);
623 var count = COMMENT_METADATA[id];
624 var title = count + ' comment' + (count == 1 ? '' : 's');
625 var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
626 var addcls = count == 0 ? ' nocomment' : '';
627 $(this)
628 .append(
629 $(document.createElement('a')).attr({
630 href: '#',
631 'class': 'sphinx-comment-open' + addcls,
632 id: 'ao' + id
633 })
634 .append($(document.createElement('img')).attr({
635 src: image,
636 alt: 'comment',
637 title: title
638 }))
639 .click(function(event) {
640 event.preventDefault();
641 show($(this).attr('id').substring(2));
642 })
643 )
644 .append(
645 $(document.createElement('a')).attr({
646 href: '#',
647 'class': 'sphinx-comment-close hidden',
648 id: 'ah' + id
649 })
650 .append($(document.createElement('img')).attr({
651 src: opts.closeCommentImage,
652 alt: 'close',
653 title: 'close'
654 }))
655 .click(function(event) {
656 event.preventDefault();
657 hide($(this).attr('id').substring(2));
658 })
659 );
660 });
661 };
662
663 var opts = {
664 processVoteURL: '/_process_vote',
665 addCommentURL: '/_add_comment',
666 getCommentsURL: '/_get_comments',
667 acceptCommentURL: '/_accept_comment',
668 deleteCommentURL: '/_delete_comment',
669 commentImage: '/static/_static/comment.png',
670 closeCommentImage: '/static/_static/comment-close.png',
671 loadingImage: '/static/_static/ajax-loader.gif',
672 commentBrightImage: '/static/_static/comment-bright.png',
673 upArrow: '/static/_static/up.png',
674 downArrow: '/static/_static/down.png',
675 upArrowPressed: '/static/_static/up-pressed.png',
676 downArrowPressed: '/static/_static/down-pressed.png',
677 voting: false,
678 moderator: false
679 };
680
681 if (typeof COMMENT_OPTIONS != "undefined") {
682 opts = jQuery.extend(opts, COMMENT_OPTIONS);
683 }
684
685 var popupTemplate = '\
686 <div class="sphinx-comments" id="sc<%id%>">\
687 <p class="sort-options">\
688 Sort by:\
689 <a href="#" class="sort-option byrating">best rated</a>\
690 <a href="#" class="sort-option byascage">newest</a>\
691 <a href="#" class="sort-option byage">oldest</a>\
692 </p>\
693 <div class="comment-header">Comments</div>\
694 <div class="comment-loading" id="cn<%id%>">\
695 loading comments... <img src="<%loadingImage%>" alt="" /></div>\
696 <ul id="cl<%id%>" class="comment-ul"></ul>\
697 <div id="ca<%id%>">\
698 <p class="add-a-comment">Add a comment\
699 (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
700 <div class="comment-markup-box" id="mb<%id%>">\
701 reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
702 <code>``code``</code>, \
703 code blocks: <code>::</code> and an indented block after blank line</div>\
704 <form method="post" id="cf<%id%>" class="comment-form" action="">\
705 <textarea name="comment" cols="80"></textarea>\
706 <p class="propose-button">\
707 <a href="#" id="pc<%id%>" class="show-propose-change">\
708 Propose a change &#9657;\
709 </a>\
710 <a href="#" id="hc<%id%>" class="hide-propose-change">\
711 Propose a change &#9663;\
712 </a>\
713 </p>\
714 <textarea name="proposal" id="pt<%id%>" cols="80"\
715 spellcheck="false"></textarea>\
716 <input type="submit" value="Add comment" />\
717 <input type="hidden" name="node" value="<%id%>" />\
718 <input type="hidden" name="parent" value="" />\
719 </form>\
720 </div>\
721 </div>';
722
723 var commentTemplate = '\
724 <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
725 <div class="vote">\
726 <div class="arrow">\
727 <a href="#" id="uv<%id%>" class="vote" title="vote up">\
728 <img src="<%upArrow%>" />\
729 </a>\
730 <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
731 <img src="<%upArrowPressed%>" />\
732 </a>\
733 </div>\
734 <div class="arrow">\
735 <a href="#" id="dv<%id%>" class="vote" title="vote down">\
736 <img src="<%downArrow%>" id="da<%id%>" />\
737 </a>\
738 <a href="#" id="du<%id%>" class="un vote" title="vote down">\
739 <img src="<%downArrowPressed%>" />\
740 </a>\
741 </div>\
742 </div>\
743 <div class="comment-content">\
744 <p class="tagline comment">\
745 <span class="user-id"><%username%></span>\
746 <span class="rating"><%pretty_rating%></span>\
747 <span class="delta"><%time.delta%></span>\
748 </p>\
749 <div class="comment-text comment"><#text#></div>\
750 <p class="comment-opts comment">\
751 <a href="#" class="reply hidden" id="rl<%id%>">reply &#9657;</a>\
752 <a href="#" class="close-reply" id="cr<%id%>">reply &#9663;</a>\
753 <a href="#" id="sp<%id%>" class="show-proposal">proposal &#9657;</a>\
754 <a href="#" id="hp<%id%>" class="hide-proposal">proposal &#9663;</a>\
755 <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
756 <span id="cm<%id%>" class="moderation hidden">\
757 <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
758 </span>\
759 </p>\
760 <pre class="proposal" id="pr<%id%>">\
761 <#proposal_diff#>\
762 </pre>\
763 <ul class="comment-children" id="cl<%id%>"></ul>\
764 </div>\
765 <div class="clearleft"></div>\
766 </div>\
767 </div>';
768
769 var replyTemplate = '\
770 <li>\
771 <div class="reply-div" id="rd<%id%>">\
772 <form id="rf<%id%>">\
773 <textarea name="comment" cols="80"></textarea>\
774 <input type="submit" value="Add reply" />\
775 <input type="button" value="Cancel" />\
776 <input type="hidden" name="parent" value="<%id%>" />\
777 <input type="hidden" name="node" value="" />\
778 </form>\
779 </div>\
780 </li>';
781
782 $(document).ready(function() {
783 init();
784 });
785 })(jQuery);
786
787 $(document).ready(function() {
788 // add comment anchors for all paragraphs that are commentable
789 $('.sphinx-has-comment').comment();
790
791 // highlight search words in search results
792 $("div.context").each(function() {
793 var params = $.getQueryParameters();
794 var terms = (params.q) ? params.q[0].split(/\s+/) : [];
795 var result = $(this);
796 $.each(terms, function() {
797 result.highlightText(this.toLowerCase(), 'highlighted');
798 });
799 });
800
801 // directly open comment window if requested
802 var anchor = document.location.hash;
803 if (anchor.substring(0, 9) == '#comment-') {
804 $('#ao' + anchor.substring(9)).click();
805 document.location.hash = '#s' + anchor.substring(9);
806 }
807 });
0
1
2
3 <!DOCTYPE html>
4 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
5 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
6 <head>
7 <meta charset="utf-8">
8
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
11 <title>Index &mdash; Faraday 0.1 documentation</title>
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
28
29
30
31
32
33 <link rel="index" title="Index"
34 href="#"/>
35 <link rel="search" title="Search" href="search.html"/>
36 <link rel="top" title="Faraday 0.1 documentation" href="index.html"/>
37
38
39 <script src="_static/js/modernizr.min.js"></script>
40
41 </head>
42
43 <body class="wy-body-for-nav" role="document">
44
45 <div class="wy-grid-for-nav">
46
47
48 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
49 <div class="wy-side-scroll">
50 <div class="wy-side-nav-search">
51
52
53
54 <a href="index.html" class="icon icon-home"> Faraday
55
56
57
58 </a>
59
60
61
62
63 <div class="version">
64 0.1
65 </div>
66
67
68
69
70 <div role="search">
71 <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
72 <input type="text" name="q" placeholder="Search docs" />
73 <input type="hidden" name="check_keywords" value="yes" />
74 <input type="hidden" name="area" value="default" />
75 </form>
76 </div>
77
78
79 </div>
80
81 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
82
83
84
85 <!-- Local TOC -->
86 <div class="local-toc"></div>
87
88
89 </div>
90 </div>
91 </nav>
92
93 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
94
95
96 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
97 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
98 <a href="index.html">Faraday</a>
99 </nav>
100
101
102
103 <div class="wy-nav-content">
104 <div class="rst-content">
105
106
107
108
109
110
111 <div role="navigation" aria-label="breadcrumbs navigation">
112 <ul class="wy-breadcrumbs">
113 <li><a href="index.html">Docs</a> &raquo;</li>
114
115 <li></li>
116 <li class="wy-breadcrumbs-aside">
117
118
119
120 </li>
121 </ul>
122 <hr/>
123 </div>
124 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
125 <div itemprop="articleBody">
126
127
128 <h1 id="index">Index</h1>
129
130 <div class="genindex-jumpbox">
131 <a href="#C"><strong>C</strong></a>
132 | <a href="#D"><strong>D</strong></a>
133 | <a href="#G"><strong>G</strong></a>
134 | <a href="#I"><strong>I</strong></a>
135 | <a href="#P"><strong>P</strong></a>
136 | <a href="#T"><strong>T</strong></a>
137 | <a href="#U"><strong>U</strong></a>
138
139 </div>
140 <h2 id="C">C</h2>
141 <table style="width: 100%" class="indextable genindextable"><tr>
142 <td style="width: 33%; vertical-align: top;"><ul>
143 <li><a href="server.html#persistence.server.server.create_command">create_command() (in module persistence.server.server)</a>
144 </li>
145 <li><a href="server.html#persistence.server.server.create_credential">create_credential() (in module persistence.server.server)</a>
146 </li>
147 <li><a href="server.html#persistence.server.server.create_host">create_host() (in module persistence.server.server)</a>
148 </li>
149 <li><a href="server.html#persistence.server.server.create_interface">create_interface() (in module persistence.server.server)</a>
150 </li>
151 </ul></td>
152 <td style="width: 33%; vertical-align: top;"><ul>
153 <li><a href="server.html#persistence.server.server.create_note">create_note() (in module persistence.server.server)</a>
154 </li>
155 <li><a href="server.html#persistence.server.server.create_service">create_service() (in module persistence.server.server)</a>
156 </li>
157 <li><a href="server.html#persistence.server.server.create_vuln">create_vuln() (in module persistence.server.server)</a>
158 </li>
159 <li><a href="server.html#persistence.server.server.create_vuln_web">create_vuln_web() (in module persistence.server.server)</a>
160 </li>
161 <li><a href="server.html#persistence.server.server.create_workspace">create_workspace() (in module persistence.server.server)</a>
162 </li>
163 </ul></td>
164 </tr></table>
165
166 <h2 id="D">D</h2>
167 <table style="width: 100%" class="indextable genindextable"><tr>
168 <td style="width: 33%; vertical-align: top;"><ul>
169 <li><a href="server.html#persistence.server.server.delete_command">delete_command() (in module persistence.server.server)</a>
170 </li>
171 <li><a href="server.html#persistence.server.server.delete_credential">delete_credential() (in module persistence.server.server)</a>
172 </li>
173 <li><a href="server.html#persistence.server.server.delete_host">delete_host() (in module persistence.server.server)</a>
174 </li>
175 <li><a href="server.html#persistence.server.server.delete_interface">delete_interface() (in module persistence.server.server)</a>
176 </li>
177 </ul></td>
178 <td style="width: 33%; vertical-align: top;"><ul>
179 <li><a href="server.html#persistence.server.server.delete_note">delete_note() (in module persistence.server.server)</a>
180 </li>
181 <li><a href="server.html#persistence.server.server.delete_service">delete_service() (in module persistence.server.server)</a>
182 </li>
183 <li><a href="server.html#persistence.server.server.delete_vuln">delete_vuln() (in module persistence.server.server)</a>
184 </li>
185 <li><a href="server.html#persistence.server.server.delete_workspace">delete_workspace() (in module persistence.server.server)</a>
186 </li>
187 </ul></td>
188 </tr></table>
189
190 <h2 id="G">G</h2>
191 <table style="width: 100%" class="indextable genindextable"><tr>
192 <td style="width: 33%; vertical-align: top;"><ul>
193 <li><a href="server.html#persistence.server.server.get_all_vulns">get_all_vulns() (in module persistence.server.server)</a>
194 </li>
195 <li><a href="server.html#persistence.server.server.get_changes_stream">get_changes_stream() (in module persistence.server.server)</a>
196 </li>
197 <li><a href="server.html#persistence.server.server.get_command">get_command() (in module persistence.server.server)</a>
198 </li>
199 <li><a href="server.html#persistence.server.server.get_commands">get_commands() (in module persistence.server.server)</a>
200 </li>
201 <li><a href="server.html#persistence.server.server.get_commands_number">get_commands_number() (in module persistence.server.server)</a>
202 </li>
203 <li><a href="server.html#persistence.server.server.get_credential">get_credential() (in module persistence.server.server)</a>
204 </li>
205 <li><a href="server.html#persistence.server.server.get_credentials">get_credentials() (in module persistence.server.server)</a>
206 </li>
207 <li><a href="server.html#persistence.server.server.get_credentials_number">get_credentials_number() (in module persistence.server.server)</a>
208 </li>
209 <li><a href="server.html#persistence.server.server.get_host">get_host() (in module persistence.server.server)</a>
210 </li>
211 <li><a href="server.html#persistence.server.server.get_hosts">get_hosts() (in module persistence.server.server)</a>
212 </li>
213 <li><a href="server.html#persistence.server.server.get_hosts_number">get_hosts_number() (in module persistence.server.server)</a>
214 </li>
215 <li><a href="server.html#persistence.server.server.get_interface">get_interface() (in module persistence.server.server)</a>
216 </li>
217 <li><a href="server.html#persistence.server.server.get_interfaces">get_interfaces() (in module persistence.server.server)</a>
218 </li>
219 <li><a href="server.html#persistence.server.server.get_interfaces_number">get_interfaces_number() (in module persistence.server.server)</a>
220 </li>
221 <li><a href="server.html#persistence.server.server.get_note">get_note() (in module persistence.server.server)</a>
222 </li>
223 <li><a href="server.html#persistence.server.server.get_notes">get_notes() (in module persistence.server.server)</a>
224 </li>
225 </ul></td>
226 <td style="width: 33%; vertical-align: top;"><ul>
227 <li><a href="server.html#persistence.server.server.get_notes_number">get_notes_number() (in module persistence.server.server)</a>
228 </li>
229 <li><a href="server.html#persistence.server.server.get_object">get_object() (in module persistence.server.server)</a>
230 </li>
231 <li><a href="server.html#persistence.server.server.get_object_before_last_revision">get_object_before_last_revision() (in module persistence.server.server)</a>
232 </li>
233 <li><a href="server.html#persistence.server.server.get_objects">get_objects() (in module persistence.server.server)</a>
234 </li>
235 <li><a href="server.html#persistence.server.server.get_service">get_service() (in module persistence.server.server)</a>
236 </li>
237 <li><a href="server.html#persistence.server.server.get_services">get_services() (in module persistence.server.server)</a>
238 </li>
239 <li><a href="server.html#persistence.server.server.get_services_number">get_services_number() (in module persistence.server.server)</a>
240 </li>
241 <li><a href="server.html#persistence.server.server.get_vuln">get_vuln() (in module persistence.server.server)</a>
242 </li>
243 <li><a href="server.html#persistence.server.server.get_vulns">get_vulns() (in module persistence.server.server)</a>
244 </li>
245 <li><a href="server.html#persistence.server.server.get_vulns_number">get_vulns_number() (in module persistence.server.server)</a>
246 </li>
247 <li><a href="server.html#persistence.server.server.get_web_vuln">get_web_vuln() (in module persistence.server.server)</a>
248 </li>
249 <li><a href="server.html#persistence.server.server.get_web_vulns">get_web_vulns() (in module persistence.server.server)</a>
250 </li>
251 <li><a href="server.html#persistence.server.server.get_workspace">get_workspace() (in module persistence.server.server)</a>
252 </li>
253 <li><a href="server.html#persistence.server.server.get_workspace_numbers">get_workspace_numbers() (in module persistence.server.server)</a>
254 </li>
255 <li><a href="server.html#persistence.server.server.get_workspace_summary">get_workspace_summary() (in module persistence.server.server)</a>
256 </li>
257 <li><a href="server.html#persistence.server.server.get_workspaces_names">get_workspaces_names() (in module persistence.server.server)</a>
258 </li>
259 </ul></td>
260 </tr></table>
261
262 <h2 id="I">I</h2>
263 <table style="width: 100%" class="indextable genindextable"><tr>
264 <td style="width: 33%; vertical-align: top;"><ul>
265 <li><a href="server.html#persistence.server.server.is_server_up">is_server_up() (in module persistence.server.server)</a>
266 </li>
267 </ul></td>
268 </tr></table>
269
270 <h2 id="P">P</h2>
271 <table style="width: 100%" class="indextable genindextable"><tr>
272 <td style="width: 33%; vertical-align: top;"><ul>
273 <li><a href="server.html#module-persistence.server.server">persistence.server.server (module)</a>
274 </li>
275 </ul></td>
276 </tr></table>
277
278 <h2 id="T">T</h2>
279 <table style="width: 100%" class="indextable genindextable"><tr>
280 <td style="width: 33%; vertical-align: top;"><ul>
281 <li><a href="server.html#persistence.server.server.test_server_url">test_server_url() (in module persistence.server.server)</a>
282 </li>
283 </ul></td>
284 </tr></table>
285
286 <h2 id="U">U</h2>
287 <table style="width: 100%" class="indextable genindextable"><tr>
288 <td style="width: 33%; vertical-align: top;"><ul>
289 <li><a href="server.html#persistence.server.server.update_command">update_command() (in module persistence.server.server)</a>
290 </li>
291 <li><a href="server.html#persistence.server.server.update_credential">update_credential() (in module persistence.server.server)</a>
292 </li>
293 <li><a href="server.html#persistence.server.server.update_host">update_host() (in module persistence.server.server)</a>
294 </li>
295 <li><a href="server.html#persistence.server.server.update_interface">update_interface() (in module persistence.server.server)</a>
296 </li>
297 </ul></td>
298 <td style="width: 33%; vertical-align: top;"><ul>
299 <li><a href="server.html#persistence.server.server.update_note">update_note() (in module persistence.server.server)</a>
300 </li>
301 <li><a href="server.html#persistence.server.server.update_service">update_service() (in module persistence.server.server)</a>
302 </li>
303 <li><a href="server.html#persistence.server.server.update_vuln">update_vuln() (in module persistence.server.server)</a>
304 </li>
305 <li><a href="server.html#persistence.server.server.update_vuln_web">update_vuln_web() (in module persistence.server.server)</a>
306 </li>
307 </ul></td>
308 </tr></table>
309
310
311
312 </div>
313 </div>
314 <footer>
315
316
317 <hr/>
318
319 <div role="contentinfo">
320 <p>
321 &copy; Copyright 2016, Infobyte.
322
323 </p>
324 </div>
325 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
326
327 </footer>
328
329 </div>
330 </div>
331
332 </section>
333
334 </div>
335
336
337
338
339
340 <script type="text/javascript">
341 var DOCUMENTATION_OPTIONS = {
342 URL_ROOT:'./',
343 VERSION:'0.1',
344 COLLAPSE_INDEX:false,
345 FILE_SUFFIX:'.html',
346 HAS_SOURCE: true
347 };
348 </script>
349 <script type="text/javascript" src="_static/jquery.js"></script>
350 <script type="text/javascript" src="_static/underscore.js"></script>
351 <script type="text/javascript" src="_static/doctools.js"></script>
352
353
354
355
356
357 <script type="text/javascript" src="_static/js/theme.js"></script>
358
359
360
361
362 <script type="text/javascript">
363 jQuery(function () {
364 SphinxRtdTheme.StickyNav.enable();
365 });
366 </script>
367
368
369 </body>
370 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>Welcome to Faraday’s documentation! &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="genindex.html"/>
34 <link rel="search" title="Search" href="search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="#"/>
36
37
38 <script src="_static/js/modernizr.min.js"></script>
39
40 </head>
41
42 <body class="wy-body-for-nav" role="document">
43
44 <div class="wy-grid-for-nav">
45
46
47 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48 <div class="wy-side-scroll">
49 <div class="wy-side-nav-search">
50
51
52
53 <a href="#" class="icon icon-home"> Faraday
54
55
56
57 </a>
58
59
60
61
62 <div class="version">
63 0.1
64 </div>
65
66
67
68
69 <div role="search">
70 <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
71 <input type="text" name="q" placeholder="Search docs" />
72 <input type="hidden" name="check_keywords" value="yes" />
73 <input type="hidden" name="area" value="default" />
74 </form>
75 </div>
76
77
78 </div>
79
80 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
81
82
83
84 <!-- Local TOC -->
85 <div class="local-toc"><ul>
86 <li><a class="reference internal" href="#">Welcome to Faraday&#8217;s documentation!</a></li>
87 <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
88 </ul>
89 </div>
90
91
92 </div>
93 </div>
94 </nav>
95
96 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
97
98
99 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
100 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
101 <a href="#">Faraday</a>
102 </nav>
103
104
105
106 <div class="wy-nav-content">
107 <div class="rst-content">
108
109
110
111
112
113
114 <div role="navigation" aria-label="breadcrumbs navigation">
115 <ul class="wy-breadcrumbs">
116 <li><a href="#">Docs</a> &raquo;</li>
117
118 <li>Welcome to Faraday&#8217;s documentation!</li>
119 <li class="wy-breadcrumbs-aside">
120
121
122 <a href="_sources/index.rst.txt" rel="nofollow"> View page source</a>
123
124
125 </li>
126 </ul>
127 <hr/>
128 </div>
129 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
130 <div itemprop="articleBody">
131
132 <div class="section" id="welcome-to-faraday-s-documentation">
133 <h1>Welcome to Faraday&#8217;s documentation!<a class="headerlink" href="#welcome-to-faraday-s-documentation" title="Permalink to this headline">¶</a></h1>
134 <p>Contents:</p>
135 <div class="toctree-wrapper compound">
136 </div>
137 </div>
138 <div class="section" id="indices-and-tables">
139 <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
140 <ul class="simple">
141 <li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
142 <li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
143 <li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
144 </ul>
145 </div>
146
147
148 </div>
149 </div>
150 <footer>
151
152
153 <hr/>
154
155 <div role="contentinfo">
156 <p>
157 &copy; Copyright 2016, Infobyte.
158
159 </p>
160 </div>
161 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
162
163 </footer>
164
165 </div>
166 </div>
167
168 </section>
169
170 </div>
171
172
173
174
175
176 <script type="text/javascript">
177 var DOCUMENTATION_OPTIONS = {
178 URL_ROOT:'./',
179 VERSION:'0.1',
180 COLLAPSE_INDEX:false,
181 FILE_SUFFIX:'.html',
182 HAS_SOURCE: true
183 };
184 </script>
185 <script type="text/javascript" src="_static/jquery.js"></script>
186 <script type="text/javascript" src="_static/underscore.js"></script>
187 <script type="text/javascript" src="_static/doctools.js"></script>
188
189
190
191
192
193 <script type="text/javascript" src="_static/js/theme.js"></script>
194
195
196
197
198 <script type="text/javascript">
199 jQuery(function () {
200 SphinxRtdTheme.StickyNav.enable();
201 });
202 </script>
203
204
205 </body>
206 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>server &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="genindex.html"/>
34 <link rel="search" title="Search" href="search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="index.html"/>
36
37
38 <script src="_static/js/modernizr.min.js"></script>
39
40 </head>
41
42 <body class="wy-body-for-nav" role="document">
43
44 <div class="wy-grid-for-nav">
45
46
47 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48 <div class="wy-side-scroll">
49 <div class="wy-side-nav-search">
50
51
52
53 <a href="index.html" class="icon icon-home"> Faraday
54
55
56
57 </a>
58
59
60
61
62 <div class="version">
63 0.1
64 </div>
65
66
67
68
69 <div role="search">
70 <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
71 <input type="text" name="q" placeholder="Search docs" />
72 <input type="hidden" name="check_keywords" value="yes" />
73 <input type="hidden" name="area" value="default" />
74 </form>
75 </div>
76
77
78 </div>
79
80 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
81
82
83
84 <!-- Local TOC -->
85 <div class="local-toc"><ul>
86 <li><a class="reference internal" href="#">server</a></li>
87 </ul>
88 </div>
89
90
91 </div>
92 </div>
93 </nav>
94
95 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
96
97
98 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
99 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
100 <a href="index.html">Faraday</a>
101 </nav>
102
103
104
105 <div class="wy-nav-content">
106 <div class="rst-content">
107
108
109
110
111
112
113 <div role="navigation" aria-label="breadcrumbs navigation">
114 <ul class="wy-breadcrumbs">
115 <li><a href="index.html">Docs</a> &raquo;</li>
116
117 <li>server</li>
118 <li class="wy-breadcrumbs-aside">
119
120
121 <a href="_sources/modules.rst.txt" rel="nofollow"> View page source</a>
122
123
124 </li>
125 </ul>
126 <hr/>
127 </div>
128 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
129 <div itemprop="articleBody">
130
131 <div class="section" id="server">
132 <h1>server<a class="headerlink" href="#server" title="Permalink to this headline">¶</a></h1>
133 <div class="toctree-wrapper compound">
134 <ul>
135 <li class="toctree-l1"><a class="reference internal" href="server.html">server package</a><ul>
136 <li class="toctree-l2"><a class="reference internal" href="server.html#submodules">Submodules</a></li>
137 <li class="toctree-l2"><a class="reference internal" href="server.html#module-persistence.server.server">server.utils module</a></li>
138 </ul>
139 </li>
140 </ul>
141 </div>
142 </div>
143
144
145 </div>
146 </div>
147 <footer>
148
149
150 <hr/>
151
152 <div role="contentinfo">
153 <p>
154 &copy; Copyright 2016, Infobyte.
155
156 </p>
157 </div>
158 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
159
160 </footer>
161
162 </div>
163 </div>
164
165 </section>
166
167 </div>
168
169
170
171
172
173 <script type="text/javascript">
174 var DOCUMENTATION_OPTIONS = {
175 URL_ROOT:'./',
176 VERSION:'0.1',
177 COLLAPSE_INDEX:false,
178 FILE_SUFFIX:'.html',
179 HAS_SOURCE: true
180 };
181 </script>
182 <script type="text/javascript" src="_static/jquery.js"></script>
183 <script type="text/javascript" src="_static/underscore.js"></script>
184 <script type="text/javascript" src="_static/doctools.js"></script>
185
186
187
188
189
190 <script type="text/javascript" src="_static/js/theme.js"></script>
191
192
193
194
195 <script type="text/javascript">
196 jQuery(function () {
197 SphinxRtdTheme.StickyNav.enable();
198 });
199 </script>
200
201
202 </body>
203 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>Python Module Index &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="genindex.html"/>
34 <link rel="search" title="Search" href="search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="index.html"/>
36
37
38
39
40
41 <script src="_static/js/modernizr.min.js"></script>
42
43 </head>
44
45 <body class="wy-body-for-nav" role="document">
46
47 <div class="wy-grid-for-nav">
48
49
50 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
51 <div class="wy-side-scroll">
52 <div class="wy-side-nav-search">
53
54
55
56 <a href="index.html" class="icon icon-home"> Faraday
57
58
59
60 </a>
61
62
63
64
65 <div class="version">
66 0.1
67 </div>
68
69
70
71
72 <div role="search">
73 <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
74 <input type="text" name="q" placeholder="Search docs" />
75 <input type="hidden" name="check_keywords" value="yes" />
76 <input type="hidden" name="area" value="default" />
77 </form>
78 </div>
79
80
81 </div>
82
83 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
84
85
86
87 <!-- Local TOC -->
88 <div class="local-toc"></div>
89
90
91 </div>
92 </div>
93 </nav>
94
95 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
96
97
98 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
99 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
100 <a href="index.html">Faraday</a>
101 </nav>
102
103
104
105 <div class="wy-nav-content">
106 <div class="rst-content">
107
108
109
110
111
112
113 <div role="navigation" aria-label="breadcrumbs navigation">
114 <ul class="wy-breadcrumbs">
115 <li><a href="index.html">Docs</a> &raquo;</li>
116
117 <li></li>
118 <li class="wy-breadcrumbs-aside">
119
120
121
122 </li>
123 </ul>
124 <hr/>
125 </div>
126 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
127 <div itemprop="articleBody">
128
129
130 <h1>Python Module Index</h1>
131
132 <div class="modindex-jumpbox">
133 <a href="#cap-p"><strong>p</strong></a>
134 </div>
135
136 <table class="indextable modindextable">
137 <tr class="pcap"><td></td><td>&#160;</td><td></td></tr>
138 <tr class="cap" id="cap-p"><td></td><td>
139 <strong>p</strong></td><td></td></tr>
140 <tr>
141 <td><img src="_static/minus.png" class="toggler"
142 id="toggle-1" style="display: none" alt="-" /></td>
143 <td>
144 <code class="xref">persistence</code></td><td>
145 <em></em></td></tr>
146 <tr class="cg-1">
147 <td></td>
148 <td>&#160;&#160;&#160;
149 <a href="server.html#module-persistence.server.server"><code class="xref">persistence.server.server</code></a></td><td>
150 <em></em></td></tr>
151 </table>
152
153
154 </div>
155 </div>
156 <footer>
157
158
159 <hr/>
160
161 <div role="contentinfo">
162 <p>
163 &copy; Copyright 2016, Infobyte.
164
165 </p>
166 </div>
167 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
168
169 </footer>
170
171 </div>
172 </div>
173
174 </section>
175
176 </div>
177
178
179
180
181
182 <script type="text/javascript">
183 var DOCUMENTATION_OPTIONS = {
184 URL_ROOT:'./',
185 VERSION:'0.1',
186 COLLAPSE_INDEX:false,
187 FILE_SUFFIX:'.html',
188 HAS_SOURCE: true
189 };
190 </script>
191 <script type="text/javascript" src="_static/jquery.js"></script>
192 <script type="text/javascript" src="_static/underscore.js"></script>
193 <script type="text/javascript" src="_static/doctools.js"></script>
194
195
196
197
198
199 <script type="text/javascript" src="_static/js/theme.js"></script>
200
201
202
203
204 <script type="text/javascript">
205 jQuery(function () {
206 SphinxRtdTheme.StickyNav.enable();
207 });
208 </script>
209
210
211 </body>
212 </html>
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>Search &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="genindex.html"/>
34 <link rel="search" title="Search" href="#"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="index.html"/>
36
37
38 <script src="_static/js/modernizr.min.js"></script>
39
40 </head>
41
42 <body class="wy-body-for-nav" role="document">
43
44 <div class="wy-grid-for-nav">
45
46
47 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48 <div class="wy-side-scroll">
49 <div class="wy-side-nav-search">
50
51
52
53 <a href="index.html" class="icon icon-home"> Faraday
54
55
56
57 </a>
58
59
60
61
62 <div class="version">
63 0.1
64 </div>
65
66
67
68
69 <div role="search">
70 <form id="rtd-search-form" class="wy-form" action="#" method="get">
71 <input type="text" name="q" placeholder="Search docs" />
72 <input type="hidden" name="check_keywords" value="yes" />
73 <input type="hidden" name="area" value="default" />
74 </form>
75 </div>
76
77
78 </div>
79
80 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
81
82
83
84 <!-- Local TOC -->
85 <div class="local-toc"></div>
86
87
88 </div>
89 </div>
90 </nav>
91
92 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
93
94
95 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
96 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
97 <a href="index.html">Faraday</a>
98 </nav>
99
100
101
102 <div class="wy-nav-content">
103 <div class="rst-content">
104
105
106
107
108
109
110 <div role="navigation" aria-label="breadcrumbs navigation">
111 <ul class="wy-breadcrumbs">
112 <li><a href="index.html">Docs</a> &raquo;</li>
113
114 <li></li>
115 <li class="wy-breadcrumbs-aside">
116
117 </li>
118 </ul>
119 <hr/>
120 </div>
121 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
122 <div itemprop="articleBody">
123
124 <noscript>
125 <div id="fallback" class="admonition warning">
126 <p class="last">
127 Please activate JavaScript to enable the search
128 functionality.
129 </p>
130 </div>
131 </noscript>
132
133
134 <div id="search-results">
135
136 </div>
137
138 </div>
139 </div>
140 <footer>
141
142
143 <hr/>
144
145 <div role="contentinfo">
146 <p>
147 &copy; Copyright 2016, Infobyte.
148
149 </p>
150 </div>
151 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
152
153 </footer>
154
155 </div>
156 </div>
157
158 </section>
159
160 </div>
161
162
163
164
165
166 <script type="text/javascript">
167 var DOCUMENTATION_OPTIONS = {
168 URL_ROOT:'./',
169 VERSION:'0.1',
170 COLLAPSE_INDEX:false,
171 FILE_SUFFIX:'.html',
172 HAS_SOURCE: true
173 };
174 </script>
175 <script type="text/javascript" src="_static/jquery.js"></script>
176 <script type="text/javascript" src="_static/underscore.js"></script>
177 <script type="text/javascript" src="_static/doctools.js"></script>
178 <script type="text/javascript" src="_static/searchtools.js"></script>
179
180
181
182
183
184 <script type="text/javascript" src="_static/js/theme.js"></script>
185
186
187
188
189 <script type="text/javascript">
190 jQuery(function () {
191 SphinxRtdTheme.StickyNav.enable();
192 });
193 </script>
194
195 <script type="text/javascript">
196 jQuery(function() { Search.loadIndex("searchindex.js"); });
197 </script>
198
199 <script type="text/javascript" id="searchindexloader"></script>
200
201
202
203 </body>
204 </html>
0 Search.setIndex({docnames:["index","server"],envversion:50,filenames:["index.rst","server.rst"],objects:{"persistence.server":{server:[1,0,0,"-"]},"persistence.server.server":{create_command:[1,1,1,""],create_credential:[1,1,1,""],create_host:[1,1,1,""],create_interface:[1,1,1,""],create_note:[1,1,1,""],create_service:[1,1,1,""],create_vuln:[1,1,1,""],create_vuln_web:[1,1,1,""],create_workspace:[1,1,1,""],delete_command:[1,1,1,""],delete_credential:[1,1,1,""],delete_host:[1,1,1,""],delete_interface:[1,1,1,""],delete_note:[1,1,1,""],delete_service:[1,1,1,""],delete_vuln:[1,1,1,""],delete_workspace:[1,1,1,""],get_all_vulns:[1,1,1,""],get_changes_stream:[1,1,1,""],get_command:[1,1,1,""],get_commands:[1,1,1,""],get_commands_number:[1,1,1,""],get_credential:[1,1,1,""],get_credentials:[1,1,1,""],get_credentials_number:[1,1,1,""],get_host:[1,1,1,""],get_hosts:[1,1,1,""],get_hosts_number:[1,1,1,""],get_interface:[1,1,1,""],get_interfaces:[1,1,1,""],get_interfaces_number:[1,1,1,""],get_note:[1,1,1,""],get_notes:[1,1,1,""],get_notes_number:[1,1,1,""],get_object:[1,1,1,""],get_object_before_last_revision:[1,1,1,""],get_objects:[1,1,1,""],get_service:[1,1,1,""],get_services:[1,1,1,""],get_services_number:[1,1,1,""],get_vuln:[1,1,1,""],get_vulns:[1,1,1,""],get_vulns_number:[1,1,1,""],get_web_vuln:[1,1,1,""],get_web_vulns:[1,1,1,""],get_workspace:[1,1,1,""],get_workspace_numbers:[1,1,1,""],get_workspace_summary:[1,1,1,""],get_workspaces_names:[1,1,1,""],is_server_up:[1,1,1,""],test_server_url:[1,1,1,""],update_command:[1,1,1,""],update_credential:[1,1,1,""],update_host:[1,1,1,""],update_interface:[1,1,1,""],update_note:[1,1,1,""],update_service:[1,1,1,""],update_vuln:[1,1,1,""],update_vuln_web:[1,1,1,""]}},objnames:{"0":["py","module","Python module"],"1":["py","function","Python function"]},objtypes:{"0":"py:module","1":"py:function"},terms:{"case":1,"class":[],"default":1,"import":1,"return":1,"true":1,Adding:1,IDE:[],NOT:1,The:1,These:[],Useful:1,about:1,add_relationships_from_db:[],add_relationships_from_dict:[],address:1,adit:1,after:1,allow:[],alwai:1,amount:1,ani:1,api:1,arbitrari:1,aros:1,attach:[],attribut:[],automat:1,base:[],befor:1,began:1,below:1,bool:1,both:1,bug:1,can:1,care:1,categori:1,changes_stream:[],check:1,classmethod:[],collect:1,column:[],com:[],command:1,command_id:1,command_nam:1,commandruninform:[],conf:[],confirm:1,connect:1,construct:[],constructor:[],contact:1,contain:1,content:0,copi:1,copyright:[],couch:1,couchdb:1,couchdb_id:[],could:[],creat:1,create_command:1,create_credenti:1,create_host:1,create_interfac:1,create_not:1,create_servic:1,create_tim:[],create_vuln:1,create_vuln_web:1,create_workspac:1,creator:[],cred:[],credenti:1,credential_id:1,critic:1,custom:1,dao:[],data:1,databas:1,databasemetadata:[],date:1,declar:[],default_gatewai:1,default_gateway_ip:[],default_gateway_mac:[],delet:1,delete_command:1,delete_credenti:1,delete_host:1,delete_interfac:1,delete_not:1,delete_servic:1,delete_vuln:1,delete_workspac:1,desc:1,descript:1,dictionari:1,didn:1,direct:1,doc:[],doc_typ:[],document:[],document_typ:[],doe:1,don:1,durat:1,dure:1,easeofresolut:[],edit:1,either:1,element:1,empti:1,entiti:[],entity_id:[],entity_metadata:[],entity_metadata_id:[],entitymetadata:[],entitynotfound:[],equal:1,error:1,exampl:[],except:[],execut:1,ext:[],extra_param:1,fals:1,faradai:1,faraday_up:1,faradayent:[],file:1,finish:1,finish_d:1,fix:1,found:1,from:1,get:1,get_all_vuln:1,get_changes_stream:1,get_command:1,get_commands_numb:1,get_credenti:1,get_credentials_numb:1,get_entity_class_from_doc:[],get_entity_class_from_typ:[],get_host:1,get_hosts_numb:1,get_interfac:1,get_interfaces_numb:1,get_not:1,get_notes_numb:1,get_object:1,get_object_before_last_revis:1,get_servic:1,get_services_numb:1,get_vuln:1,get_vulns_numb:1,get_web_vuln:1,get_workspac:1,get_workspace_numb:1,get_workspace_summari:1,get_workspaces_nam:1,given:1,handl:1,happen:1,heartbeat:1,high:1,host:1,host_id:1,hostnam:1,http:[],impact_account:[],impact_avail:[],impact_confidenti:[],impact_integr:[],inde:1,index:0,indic:1,info:1,infobyt:1,infobytesec:[],inform:1,initi:[],inmediatli:1,instanc:[],integ:1,interfac:1,interface_id:1,ipv4:1,ipv4_address:[],ipv4_dn:[],ipv4_gatewai:[],ipv4_mask:[],ipv6:1,ipv6_address:[],ipv6_dn:[],ipv6_gatewai:[],ipv6_prefix:[],irrelev:1,is_server_up:1,itim:1,its:1,json:[],kei:[],know:1,known:1,kwarg:[],last:1,lcc:1,leav:1,licens:[],list:1,llc:[],low:1,mac:1,map:[],match:1,med:1,metada:1,metadata:1,method:1,model:[],modul:0,more:1,morethanoneobjectfoundbyid:1,must:1,name:1,need:1,network:1,network_seg:1,never:1,none:1,normal:1,note:1,note_id:1,number:1,object:1,object_id:1,object_signatur:1,one:1,onli:1,oper:1,option:[],otherwis:1,own:1,owner:1,packag:[],page:0,param:1,paramet:1,parent:1,pars:[],password:1,path:1,penetr:[],persist:1,pname:1,port:1,ports_clos:[],ports_filt:[],ports_open:[],possibl:1,present:[],primarli:1,problem:1,process:1,pronc:1,protocol:1,queri:1,rais:1,ran:1,reason:1,recent:1,ref:1,refer:1,regard:1,relationship:[],remov:1,repres:1,request:1,resolut:1,respons:1,revis:1,run:1,save:1,search:0,see:[],segment:1,server_io_except:[],server_url:1,servic:1,service_id:1,session:[],set:1,sever:1,share:1,should:1,simpl:[],sinc:1,some:1,sourc:1,special:1,sqlalchemi:[],stablish:1,start_dat:1,stat:1,statu:1,str:1,string:1,submodul:[],support:1,system:1,test:[],test_server_url:1,text:1,them:1,thi:1,though:1,time:1,took:1,tupl:1,two:1,type:1,uniqu:1,updat:1,update_act:[],update_command:1,update_controller_act:[],update_credenti:1,update_from_docu:[],update_host:1,update_interfac:1,update_not:1,update_servic:1,update_tim:[],update_us:[],update_vuln:1,update_vuln_web:1,url:1,url_to_test:1,usag:1,used:1,user:1,usernam:1,using:1,util:[],valid:1,valu:1,variabl:1,version:1,vuln:1,vuln_id:1,vuln_typ:[],vulner:1,vulnerabilityweb:[],wai:1,web:1,websit:1,when:1,where:1,which:1,work:1,worksapc:1,workspac:1,workspace_nam:1,wrongobjectsignatur:1,www:[],you:1},titles:["Welcome to Faraday&#8217;s documentation!","server package"],titleterms:{changes_stream:[],conf:[],content:[],document:0,faradai:0,indic:0,indice:[],model:[],modul:1,packag:1,server:1,server_io_except:[],submodul:1,tabl:0,util:1,welcom:0}})
0
1
2 <!DOCTYPE html>
3 <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
4 <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
5 <head>
6 <meta charset="utf-8">
7
8 <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
10 <title>server package &mdash; Faraday 0.1 documentation</title>
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
27
28
29
30
31
32 <link rel="index" title="Index"
33 href="genindex.html"/>
34 <link rel="search" title="Search" href="search.html"/>
35 <link rel="top" title="Faraday 0.1 documentation" href="index.html"/>
36
37
38 <script src="_static/js/modernizr.min.js"></script>
39
40 </head>
41
42 <body class="wy-body-for-nav" role="document">
43
44 <div class="wy-grid-for-nav">
45
46
47 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
48 <div class="wy-side-scroll">
49 <div class="wy-side-nav-search">
50
51
52
53 <a href="index.html" class="icon icon-home"> Faraday
54
55
56
57 </a>
58
59
60
61
62 <div class="version">
63 0.1
64 </div>
65
66
67
68
69 <div role="search">
70 <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
71 <input type="text" name="q" placeholder="Search docs" />
72 <input type="hidden" name="check_keywords" value="yes" />
73 <input type="hidden" name="area" value="default" />
74 </form>
75 </div>
76
77
78 </div>
79
80 <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
81
82
83
84 <!-- Local TOC -->
85 <div class="local-toc"><ul>
86 <li><a class="reference internal" href="#">server package</a><ul>
87 <li><a class="reference internal" href="#submodules">Submodules</a></li>
88 <li><a class="reference internal" href="#module-persistence.server.server">server.utils module</a></li>
89 </ul>
90 </li>
91 </ul>
92 </div>
93
94
95 </div>
96 </div>
97 </nav>
98
99 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
100
101
102 <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
103 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
104 <a href="index.html">Faraday</a>
105 </nav>
106
107
108
109 <div class="wy-nav-content">
110 <div class="rst-content">
111
112
113
114
115
116
117 <div role="navigation" aria-label="breadcrumbs navigation">
118 <ul class="wy-breadcrumbs">
119 <li><a href="index.html">Docs</a> &raquo;</li>
120
121 <li>server package</li>
122 <li class="wy-breadcrumbs-aside">
123
124
125 <a href="_sources/server.rst.txt" rel="nofollow"> View page source</a>
126
127
128 </li>
129 </ul>
130 <hr/>
131 </div>
132 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
133 <div itemprop="articleBody">
134
135 <div class="section" id="server-package">
136 <h1>server package<a class="headerlink" href="#server-package" title="Permalink to this headline">¶</a></h1>
137 <div class="section" id="submodules">
138 <h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
139 </div>
140 <div class="section" id="module-persistence.server.server">
141 <span id="server-utils-module"></span><h2>server.utils module<a class="headerlink" href="#module-persistence.server.server" title="Permalink to this headline">¶</a></h2>
142 <p>A module to handle request to the Faraday Server.</p>
143 <div class="admonition note">
144 <p class="first admonition-title">Note</p>
145 <p>Before using this as an API, you should copy this file and edit
146 the FARADAY_UP and the SERVER_URL variables found inmediatly
147 below the imports.</p>
148 <p class="last">FARADAY_UP should be set to False in the copy of the file, and SERVER_URL
149 must be a valid server url.</p>
150 </div>
151 <div class="admonition warning">
152 <p class="first admonition-title">Warning</p>
153 <p class="last">This module was though of primarly as a way of querying and removing
154 information from the Faraday Server. Adding objects is supported, but should
155 be used with care, specially regarding the ID of objects, which must
156 be always unique.</p>
157 </div>
158 <dl class="function">
159 <dt id="persistence.server.server.get_hosts">
160 <code class="descclassname">persistence.server.server.</code><code class="descname">get_hosts</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_hosts"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_hosts" title="Permalink to this definition">¶</a></dt>
161 <dd><p>Get hosts from the server.</p>
162 <table class="docutils field-list" frame="void" rules="none">
163 <col class="field-name" />
164 <col class="field-body" />
165 <tbody valign="top">
166 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
167 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the hosts.</li>
168 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
169 </ul>
170 </td>
171 </tr>
172 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the hosts matching the query.</p>
173 </td>
174 </tr>
175 </tbody>
176 </table>
177 </dd></dl>
178
179 <dl class="function">
180 <dt id="persistence.server.server.get_all_vulns">
181 <code class="descclassname">persistence.server.server.</code><code class="descname">get_all_vulns</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_all_vulns"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_all_vulns" title="Permalink to this definition">¶</a></dt>
182 <dd><p>Get vulns, both normal and web, from the server.</p>
183 <table class="docutils field-list" frame="void" rules="none">
184 <col class="field-name" />
185 <col class="field-body" />
186 <tbody valign="top">
187 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
188 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the vulns.</li>
189 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
190 </ul>
191 </td>
192 </tr>
193 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the vulns matching the query.</p>
194 </td>
195 </tr>
196 </tbody>
197 </table>
198 </dd></dl>
199
200 <dl class="function">
201 <dt id="persistence.server.server.get_vulns">
202 <code class="descclassname">persistence.server.server.</code><code class="descname">get_vulns</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_vulns"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_vulns" title="Permalink to this definition">¶</a></dt>
203 <dd><p>Get only normal vulns from the server.</p>
204 <table class="docutils field-list" frame="void" rules="none">
205 <col class="field-name" />
206 <col class="field-body" />
207 <tbody valign="top">
208 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
209 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the vulns.</li>
210 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
211 </ul>
212 </td>
213 </tr>
214 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the vulns matching the query.</p>
215 </td>
216 </tr>
217 </tbody>
218 </table>
219 </dd></dl>
220
221 <dl class="function">
222 <dt id="persistence.server.server.get_web_vulns">
223 <code class="descclassname">persistence.server.server.</code><code class="descname">get_web_vulns</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_web_vulns"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_web_vulns" title="Permalink to this definition">¶</a></dt>
224 <dd><p>Get only web vulns from the server.</p>
225 <table class="docutils field-list" frame="void" rules="none">
226 <col class="field-name" />
227 <col class="field-body" />
228 <tbody valign="top">
229 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
230 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the vulns.</li>
231 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
232 </ul>
233 </td>
234 </tr>
235 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the vulns matching the query.</p>
236 </td>
237 </tr>
238 </tbody>
239 </table>
240 </dd></dl>
241
242 <dl class="function">
243 <dt id="persistence.server.server.get_interfaces">
244 <code class="descclassname">persistence.server.server.</code><code class="descname">get_interfaces</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_interfaces"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_interfaces" title="Permalink to this definition">¶</a></dt>
245 <dd><p>Get interfaces from the server.</p>
246 <table class="docutils field-list" frame="void" rules="none">
247 <col class="field-name" />
248 <col class="field-body" />
249 <tbody valign="top">
250 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
251 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the interfaces.</li>
252 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
253 </ul>
254 </td>
255 </tr>
256 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the interfaces matching the query.</p>
257 </td>
258 </tr>
259 </tbody>
260 </table>
261 </dd></dl>
262
263 <dl class="function">
264 <dt id="persistence.server.server.get_services">
265 <code class="descclassname">persistence.server.server.</code><code class="descname">get_services</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_services"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_services" title="Permalink to this definition">¶</a></dt>
266 <dd><p>Get services from the server.</p>
267 <table class="docutils field-list" frame="void" rules="none">
268 <col class="field-name" />
269 <col class="field-body" />
270 <tbody valign="top">
271 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
272 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the services.</li>
273 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
274 </ul>
275 </td>
276 </tr>
277 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the services matching the query.</p>
278 </td>
279 </tr>
280 </tbody>
281 </table>
282 </dd></dl>
283
284 <dl class="function">
285 <dt id="persistence.server.server.get_credentials">
286 <code class="descclassname">persistence.server.server.</code><code class="descname">get_credentials</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_credentials"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_credentials" title="Permalink to this definition">¶</a></dt>
287 <dd><p>Get credentials from the server.</p>
288 <table class="docutils field-list" frame="void" rules="none">
289 <col class="field-name" />
290 <col class="field-body" />
291 <tbody valign="top">
292 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
293 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the credentials.</li>
294 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
295 </ul>
296 </td>
297 </tr>
298 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the credentials matching the query.</p>
299 </td>
300 </tr>
301 </tbody>
302 </table>
303 </dd></dl>
304
305 <dl class="function">
306 <dt id="persistence.server.server.get_notes">
307 <code class="descclassname">persistence.server.server.</code><code class="descname">get_notes</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_notes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_notes" title="Permalink to this definition">¶</a></dt>
308 <dd><p>Get notes from the server.</p>
309 <table class="docutils field-list" frame="void" rules="none">
310 <col class="field-name" />
311 <col class="field-body" />
312 <tbody valign="top">
313 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
314 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the notes.</li>
315 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
316 </ul>
317 </td>
318 </tr>
319 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the notes matching the query.</p>
320 </td>
321 </tr>
322 </tbody>
323 </table>
324 </dd></dl>
325
326 <dl class="function">
327 <dt id="persistence.server.server.get_commands">
328 <code class="descclassname">persistence.server.server.</code><code class="descname">get_commands</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_commands"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_commands" title="Permalink to this definition">¶</a></dt>
329 <dd><p>Get commands from the server.</p>
330 <table class="docutils field-list" frame="void" rules="none">
331 <col class="field-name" />
332 <col class="field-body" />
333 <tbody valign="top">
334 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
335 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the commands.</li>
336 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
337 </ul>
338 </td>
339 </tr>
340 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary containing the commands matching the query.</p>
341 </td>
342 </tr>
343 </tbody>
344 </table>
345 </dd></dl>
346
347 <dl class="function">
348 <dt id="persistence.server.server.get_objects">
349 <code class="descclassname">persistence.server.server.</code><code class="descname">get_objects</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>object_signature</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_objects"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_objects" title="Permalink to this definition">¶</a></dt>
350 <dd><p>Get any type of object from the server, be it hosts, vulns, interfaces,
351 services, credentials, commands or notes.</p>
352 <table class="docutils field-list" frame="void" rules="none">
353 <col class="field-name" />
354 <col class="field-body" />
355 <tbody valign="top">
356 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
357 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace from which to get the commands.</li>
358 <li><strong>object_signature</strong> (<em>str</em>) &#8211; the type of object to get. Must equal &#8216;hosts&#8217;,
359 &#8216;vulns&#8217;, &#8216;interfaces&#8217;, &#8216;services&#8217;, &#8216;credentials&#8217;, &#8216;notes&#8217; or &#8216;commands&#8217;</li>
360 <li><strong>**params</strong> &#8211; any of valid request parameters for CouchDB.</li>
361 </ul>
362 </td>
363 </tr>
364 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing the commands matching the query.</p>
365 </td>
366 </tr>
367 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
368 <li><code class="xref py py-exc docutils literal"><span class="pre">WrongObjectSignature</span></code> &#8211; if the object_signature string didn&#8217;t match</li>
369 <li>a faraday object.</li>
370 </ul>
371 </td>
372 </tr>
373 </tbody>
374 </table>
375 </dd></dl>
376
377 <dl class="function">
378 <dt id="persistence.server.server.get_changes_stream">
379 <code class="descclassname">persistence.server.server.</code><code class="descname">get_changes_stream</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>since=0</em>, <em>heartbeat='1000'</em>, <em>**extra_params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_changes_stream"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_changes_stream" title="Permalink to this definition">¶</a></dt>
380 <dd></dd></dl>
381
382 <dl class="function">
383 <dt id="persistence.server.server.get_workspaces_names">
384 <code class="descclassname">persistence.server.server.</code><code class="descname">get_workspaces_names</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_workspaces_names"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_workspaces_names" title="Permalink to this definition">¶</a></dt>
385 <dd><p>Returns:
386 A dictionary with a list with the workspaces names.</p>
387 </dd></dl>
388
389 <dl class="function">
390 <dt id="persistence.server.server.get_object_before_last_revision">
391 <code class="descclassname">persistence.server.server.</code><code class="descname">get_object_before_last_revision</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>object_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_object_before_last_revision"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_object_before_last_revision" title="Permalink to this definition">¶</a></dt>
392 <dd><p>Get an object before its last revision. Useful to get information about
393 recently deleted objects.</p>
394 <div class="admonition warning">
395 <p class="first admonition-title">Warning</p>
396 <p class="last">Error-pronce process. You should check for &#8216;None&#8217; after usage,
397 as that&#8217;s the return value if any problem arose during execution.</p>
398 </div>
399 <table class="docutils field-list" frame="void" rules="none">
400 <col class="field-name" />
401 <col class="field-body" />
402 <tbody valign="top">
403 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
404 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object was</li>
405 <li><strong>object_id</strong> (<em>str</em>) &#8211; the id of the object</li>
406 </ul>
407 </td>
408 </tr>
409 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the object&#8217;s information.</p>
410 </td>
411 </tr>
412 </tbody>
413 </table>
414 </dd></dl>
415
416 <dl class="function">
417 <dt id="persistence.server.server.get_object">
418 <code class="descclassname">persistence.server.server.</code><code class="descname">get_object</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>object_signature</em>, <em>object_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_object" title="Permalink to this definition">¶</a></dt>
419 <dd><p>Get an unique object of arbitrary type.</p>
420 <table class="docutils field-list" frame="void" rules="none">
421 <col class="field-name" />
422 <col class="field-body" />
423 <tbody valign="top">
424 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
425 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
426 <li><strong>object_signature</strong> (<em>str</em>) &#8211; must be either &#8216;hosts&#8217;, &#8216;vulns&#8217;, &#8216;interfaces&#8217;
427 &#8216;services&#8217;, &#8216;credentials&#8217;, &#8216;notes&#8217; or &#8216;commands&#8217;.</li>
428 <li><strong>object_id</strong> (<em>str</em>) &#8211; the id of the object</li>
429 </ul>
430 </td>
431 </tr>
432 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the object.</p>
433 </td>
434 </tr>
435 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
436 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the object_id is shared</li>
437 <li>by two or more objects. This should never happen. If it does,</li>
438 <li>contact Infobyte LCC.</li>
439 </ul>
440 </td>
441 </tr>
442 </tbody>
443 </table>
444 </dd></dl>
445
446 <dl class="function">
447 <dt id="persistence.server.server.get_host">
448 <code class="descclassname">persistence.server.server.</code><code class="descname">get_host</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>host_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_host" title="Permalink to this definition">¶</a></dt>
449 <dd><p>Get an unique host.</p>
450 <table class="docutils field-list" frame="void" rules="none">
451 <col class="field-name" />
452 <col class="field-body" />
453 <tbody valign="top">
454 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
455 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
456 <li><strong>host_id</strong> (<em>str</em>) &#8211; the id of the host</li>
457 </ul>
458 </td>
459 </tr>
460 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the host.</p>
461 </td>
462 </tr>
463 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
464 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the host id is shared</li>
465 <li>by two or more objects. This should never happen. If it does,</li>
466 <li>contact Infobyte LCC.</li>
467 </ul>
468 </td>
469 </tr>
470 </tbody>
471 </table>
472 </dd></dl>
473
474 <dl class="function">
475 <dt id="persistence.server.server.get_vuln">
476 <code class="descclassname">persistence.server.server.</code><code class="descname">get_vuln</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>vuln_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_vuln"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_vuln" title="Permalink to this definition">¶</a></dt>
477 <dd><p>Get an unique vuln.</p>
478 <table class="docutils field-list" frame="void" rules="none">
479 <col class="field-name" />
480 <col class="field-body" />
481 <tbody valign="top">
482 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
483 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
484 <li><strong>vuln_id</strong> (<em>str</em>) &#8211; the id of the vuln</li>
485 </ul>
486 </td>
487 </tr>
488 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the vuln.</p>
489 </td>
490 </tr>
491 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
492 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the vuln id is shared</li>
493 <li>by two or more objects. This should never happen. If it does,</li>
494 <li>contact Infobyte LCC.</li>
495 </ul>
496 </td>
497 </tr>
498 </tbody>
499 </table>
500 </dd></dl>
501
502 <dl class="function">
503 <dt id="persistence.server.server.get_web_vuln">
504 <code class="descclassname">persistence.server.server.</code><code class="descname">get_web_vuln</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>vuln_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_web_vuln"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_web_vuln" title="Permalink to this definition">¶</a></dt>
505 <dd><p>Get an unique web vuln.</p>
506 <table class="docutils field-list" frame="void" rules="none">
507 <col class="field-name" />
508 <col class="field-body" />
509 <tbody valign="top">
510 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
511 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
512 <li><strong>vuln_id</strong> (<em>web</em>) &#8211; the id of the web vuln</li>
513 </ul>
514 </td>
515 </tr>
516 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the web vuln.</p>
517 </td>
518 </tr>
519 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
520 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the web vuln id is shared</li>
521 <li>by two or more objects. This should never happen. If it does,</li>
522 <li>contact Infobyte LCC.</li>
523 </ul>
524 </td>
525 </tr>
526 </tbody>
527 </table>
528 </dd></dl>
529
530 <dl class="function">
531 <dt id="persistence.server.server.get_interface">
532 <code class="descclassname">persistence.server.server.</code><code class="descname">get_interface</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>interface_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_interface" title="Permalink to this definition">¶</a></dt>
533 <dd><p>Get an unique interface.</p>
534 <table class="docutils field-list" frame="void" rules="none">
535 <col class="field-name" />
536 <col class="field-body" />
537 <tbody valign="top">
538 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
539 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
540 <li><strong>interface_id</strong> (<em>str</em>) &#8211; the id of the interface</li>
541 </ul>
542 </td>
543 </tr>
544 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the interface.</p>
545 </td>
546 </tr>
547 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
548 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the interface id is shared</li>
549 <li>by two or more objects. This should never happen. If it does,</li>
550 <li>contact Infobyte LCC.</li>
551 </ul>
552 </td>
553 </tr>
554 </tbody>
555 </table>
556 </dd></dl>
557
558 <dl class="function">
559 <dt id="persistence.server.server.get_service">
560 <code class="descclassname">persistence.server.server.</code><code class="descname">get_service</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>service_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_service" title="Permalink to this definition">¶</a></dt>
561 <dd><p>Get an unique service.</p>
562 <table class="docutils field-list" frame="void" rules="none">
563 <col class="field-name" />
564 <col class="field-body" />
565 <tbody valign="top">
566 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
567 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
568 <li><strong>service_id</strong> (<em>str</em>) &#8211; the id of the service</li>
569 </ul>
570 </td>
571 </tr>
572 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the service.</p>
573 </td>
574 </tr>
575 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
576 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the service id is shared</li>
577 <li>by two or more objects. This should never happen. If it does,</li>
578 <li>contact Infobyte LCC.</li>
579 </ul>
580 </td>
581 </tr>
582 </tbody>
583 </table>
584 </dd></dl>
585
586 <dl class="function">
587 <dt id="persistence.server.server.get_note">
588 <code class="descclassname">persistence.server.server.</code><code class="descname">get_note</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>note_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_note"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_note" title="Permalink to this definition">¶</a></dt>
589 <dd><p>Get an unique note.</p>
590 <table class="docutils field-list" frame="void" rules="none">
591 <col class="field-name" />
592 <col class="field-body" />
593 <tbody valign="top">
594 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
595 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
596 <li><strong>note_id</strong> (<em>str</em>) &#8211; the id of the note</li>
597 </ul>
598 </td>
599 </tr>
600 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the note.</p>
601 </td>
602 </tr>
603 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
604 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the note id is shared</li>
605 <li>by two or more objects. This should never happen. If it does,</li>
606 <li>contact Infobyte LCC.</li>
607 </ul>
608 </td>
609 </tr>
610 </tbody>
611 </table>
612 </dd></dl>
613
614 <dl class="function">
615 <dt id="persistence.server.server.get_credential">
616 <code class="descclassname">persistence.server.server.</code><code class="descname">get_credential</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>credential_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_credential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_credential" title="Permalink to this definition">¶</a></dt>
617 <dd><p>Get an unique credential.</p>
618 <table class="docutils field-list" frame="void" rules="none">
619 <col class="field-name" />
620 <col class="field-body" />
621 <tbody valign="top">
622 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
623 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
624 <li><strong>credential_id</strong> (<em>str</em>) &#8211; the id of the credential</li>
625 </ul>
626 </td>
627 </tr>
628 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the credential.</p>
629 </td>
630 </tr>
631 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
632 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the credential id is shared</li>
633 <li>by two or more objects. This should never happen. If it does,</li>
634 <li>contact Infobyte LCC.</li>
635 </ul>
636 </td>
637 </tr>
638 </tbody>
639 </table>
640 </dd></dl>
641
642 <dl class="function">
643 <dt id="persistence.server.server.get_command">
644 <code class="descclassname">persistence.server.server.</code><code class="descname">get_command</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>command_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_command" title="Permalink to this definition">¶</a></dt>
645 <dd><p>Get an unique command.</p>
646 <table class="docutils field-list" frame="void" rules="none">
647 <col class="field-name" />
648 <col class="field-body" />
649 <tbody valign="top">
650 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
651 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace where the object should be found.</li>
652 <li><strong>command_id</strong> (<em>str</em>) &#8211; the id of the command</li>
653 </ul>
654 </td>
655 </tr>
656 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the command.</p>
657 </td>
658 </tr>
659 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
660 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the command id is shared</li>
661 <li>by two or more objects. This should never happen. If it does,</li>
662 <li>contact Infobyte LCC.</li>
663 </ul>
664 </td>
665 </tr>
666 </tbody>
667 </table>
668 </dd></dl>
669
670 <dl class="function">
671 <dt id="persistence.server.server.get_workspace">
672 <code class="descclassname">persistence.server.server.</code><code class="descname">get_workspace</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_workspace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_workspace" title="Permalink to this definition">¶</a></dt>
673 <dd><p>Get an unique command.</p>
674 <table class="docutils field-list" frame="void" rules="none">
675 <col class="field-name" />
676 <col class="field-body" />
677 <tbody valign="top">
678 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
679 <li><strong>command_name</strong> (<em>str</em>) &#8211; the command where the object should be found.</li>
680 <li><strong>command_id</strong> (<em>str</em>) &#8211; the id of the command</li>
681 </ul>
682 </td>
683 </tr>
684 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A dictionary containing information about the command.</p>
685 </td>
686 </tr>
687 <tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
688 <li><code class="xref py py-exc docutils literal"><span class="pre">MoreThanOneObjectFoundByID</span></code> &#8211; if for some reason the command id is shared</li>
689 <li>by two or more objects. This should never happen. If it does,</li>
690 <li>contact Infobyte LCC.</li>
691 </ul>
692 </td>
693 </tr>
694 </tbody>
695 </table>
696 </dd></dl>
697
698 <dl class="function">
699 <dt id="persistence.server.server.get_workspace_summary">
700 <code class="descclassname">persistence.server.server.</code><code class="descname">get_workspace_summary</code><span class="sig-paren">(</span><em>workspace_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_workspace_summary"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_workspace_summary" title="Permalink to this definition">¶</a></dt>
701 <dd><p>Get a collection of data about the workspace.</p>
702 <table class="docutils field-list" frame="void" rules="none">
703 <col class="field-name" />
704 <col class="field-body" />
705 <tbody valign="top">
706 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace to get the stats from.</td>
707 </tr>
708 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A dictionary with the workspace&#8217;s information</td>
709 </tr>
710 </tbody>
711 </table>
712 </dd></dl>
713
714 <dl class="function">
715 <dt id="persistence.server.server.get_workspace_numbers">
716 <code class="descclassname">persistence.server.server.</code><code class="descname">get_workspace_numbers</code><span class="sig-paren">(</span><em>workspace_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_workspace_numbers"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_workspace_numbers" title="Permalink to this definition">¶</a></dt>
717 <dd><p>Get the number of hosts, interfaces, services and vulns in the workspace.</p>
718 <table class="docutils field-list" frame="void" rules="none">
719 <col class="field-name" />
720 <col class="field-body" />
721 <tbody valign="top">
722 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</td>
723 </tr>
724 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A tuple of 4 elements with the amounts of hosts, interfaces, services and vulns.</td>
725 </tr>
726 </tbody>
727 </table>
728 </dd></dl>
729
730 <dl class="function">
731 <dt id="persistence.server.server.get_hosts_number">
732 <code class="descclassname">persistence.server.server.</code><code class="descname">get_hosts_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_hosts_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_hosts_number" title="Permalink to this definition">¶</a></dt>
733 <dd><table class="docutils field-list" frame="void" rules="none">
734 <col class="field-name" />
735 <col class="field-body" />
736 <tbody valign="top">
737 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
738 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
739 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
740 </ul>
741 </td>
742 </tr>
743 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of hosts in the workspace as an integer.</p>
744 </td>
745 </tr>
746 </tbody>
747 </table>
748 </dd></dl>
749
750 <dl class="function">
751 <dt id="persistence.server.server.get_services_number">
752 <code class="descclassname">persistence.server.server.</code><code class="descname">get_services_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_services_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_services_number" title="Permalink to this definition">¶</a></dt>
753 <dd><table class="docutils field-list" frame="void" rules="none">
754 <col class="field-name" />
755 <col class="field-body" />
756 <tbody valign="top">
757 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
758 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
759 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
760 </ul>
761 </td>
762 </tr>
763 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of services in the workspace as an integer.</p>
764 </td>
765 </tr>
766 </tbody>
767 </table>
768 </dd></dl>
769
770 <dl class="function">
771 <dt id="persistence.server.server.get_interfaces_number">
772 <code class="descclassname">persistence.server.server.</code><code class="descname">get_interfaces_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_interfaces_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_interfaces_number" title="Permalink to this definition">¶</a></dt>
773 <dd><table class="docutils field-list" frame="void" rules="none">
774 <col class="field-name" />
775 <col class="field-body" />
776 <tbody valign="top">
777 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
778 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
779 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
780 </ul>
781 </td>
782 </tr>
783 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of interfaces in the workspace as an integer.</p>
784 </td>
785 </tr>
786 </tbody>
787 </table>
788 </dd></dl>
789
790 <dl class="function">
791 <dt id="persistence.server.server.get_vulns_number">
792 <code class="descclassname">persistence.server.server.</code><code class="descname">get_vulns_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_vulns_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_vulns_number" title="Permalink to this definition">¶</a></dt>
793 <dd><table class="docutils field-list" frame="void" rules="none">
794 <col class="field-name" />
795 <col class="field-body" />
796 <tbody valign="top">
797 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
798 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
799 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
800 </ul>
801 </td>
802 </tr>
803 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of vulns in the workspace as an integer.</p>
804 </td>
805 </tr>
806 </tbody>
807 </table>
808 </dd></dl>
809
810 <dl class="function">
811 <dt id="persistence.server.server.get_notes_number">
812 <code class="descclassname">persistence.server.server.</code><code class="descname">get_notes_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_notes_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_notes_number" title="Permalink to this definition">¶</a></dt>
813 <dd><table class="docutils field-list" frame="void" rules="none">
814 <col class="field-name" />
815 <col class="field-body" />
816 <tbody valign="top">
817 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
818 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
819 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
820 </ul>
821 </td>
822 </tr>
823 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of notes in the workspace as an integer.</p>
824 </td>
825 </tr>
826 </tbody>
827 </table>
828 </dd></dl>
829
830 <dl class="function">
831 <dt id="persistence.server.server.get_credentials_number">
832 <code class="descclassname">persistence.server.server.</code><code class="descname">get_credentials_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_credentials_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_credentials_number" title="Permalink to this definition">¶</a></dt>
833 <dd><table class="docutils field-list" frame="void" rules="none">
834 <col class="field-name" />
835 <col class="field-body" />
836 <tbody valign="top">
837 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
838 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
839 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
840 </ul>
841 </td>
842 </tr>
843 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of credentials in the workspace as an integer.</p>
844 </td>
845 </tr>
846 </tbody>
847 </table>
848 </dd></dl>
849
850 <dl class="function">
851 <dt id="persistence.server.server.get_commands_number">
852 <code class="descclassname">persistence.server.server.</code><code class="descname">get_commands_number</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>**params</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#get_commands_number"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.get_commands_number" title="Permalink to this definition">¶</a></dt>
853 <dd><table class="docutils field-list" frame="void" rules="none">
854 <col class="field-name" />
855 <col class="field-body" />
856 <tbody valign="top">
857 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
858 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace to query</li>
859 <li><strong>**params</strong> &#8211; any of the Couchdb request parameters</li>
860 </ul>
861 </td>
862 </tr>
863 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The amount of commands in the workspace as an integer.</p>
864 </td>
865 </tr>
866 </tbody>
867 </table>
868 </dd></dl>
869
870 <dl class="function">
871 <dt id="persistence.server.server.create_host">
872 <code class="descclassname">persistence.server.server.</code><code class="descname">create_host</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>os</em>, <em>default_gateway</em>, <em>description=''</em>, <em>metadata=None</em>, <em>owned=False</em>, <em>owner=''</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_host" title="Permalink to this definition">¶</a></dt>
873 <dd><p>Create a host.</p>
874 <table class="docutils field-list" frame="void" rules="none">
875 <col class="field-name" />
876 <col class="field-body" />
877 <tbody valign="top">
878 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
879 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the host will be saved.</li>
880 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the host. Must be unique.</li>
881 <li><strong>name</strong> (<em>str</em>) &#8211; the host&#8217;s name</li>
882 <li><strong>os</strong> (<em>str</em>) &#8211; the operative system of the host</li>
883 <li><strong>default_gateway</strong> (<em>str</em>) &#8211; the host&#8217;s default_gateway</li>
884 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
885 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
886 on None.</li>
887 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the host owned or not?</li>
888 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
889 <li><strong>parent</strong> (<em>Faraday Object</em>) &#8211; the host&#8217;s parent. If you don&#8217;t know this, leave
890 on None.</li>
891 </ul>
892 </td>
893 </tr>
894 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
895 </td>
896 </tr>
897 </tbody>
898 </table>
899 </dd></dl>
900
901 <dl class="function">
902 <dt id="persistence.server.server.update_host">
903 <code class="descclassname">persistence.server.server.</code><code class="descname">update_host</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>os</em>, <em>default_gateway</em>, <em>description=''</em>, <em>metadata=None</em>, <em>owned=False</em>, <em>owner=''</em>, <em>parent=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_host" title="Permalink to this definition">¶</a></dt>
904 <dd><p>Updates a host.</p>
905 <table class="docutils field-list" frame="void" rules="none">
906 <col class="field-name" />
907 <col class="field-body" />
908 <tbody valign="top">
909 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
910 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the host will be saved.</li>
911 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the host. Must be unique.</li>
912 <li><strong>name</strong> (<em>str</em>) &#8211; the host&#8217;s name</li>
913 <li><strong>os</strong> (<em>str</em>) &#8211; the operative system of the host</li>
914 <li><strong>default_gateway</strong> (<em>str</em>) &#8211; the host&#8217;s default_gateway</li>
915 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
916 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
917 on None, it will be created automatically.</li>
918 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the host owned or not?</li>
919 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
920 <li><strong>parent</strong> (<em>Faraday Object</em>) &#8211; the host&#8217;s parent. If you don&#8217;t know this, leave
921 on None.</li>
922 </ul>
923 </td>
924 </tr>
925 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
926 </td>
927 </tr>
928 </tbody>
929 </table>
930 </dd></dl>
931
932 <dl class="function">
933 <dt id="persistence.server.server.create_interface">
934 <code class="descclassname">persistence.server.server.</code><code class="descname">create_interface</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>mac</em>, <em>owned=False</em>, <em>owner=''</em>, <em>hostnames=None</em>, <em>network_segment=None</em>, <em>ipv4=None</em>, <em>ipv6=None</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_interface" title="Permalink to this definition">¶</a></dt>
935 <dd><p>Creates an interface.</p>
936 <div class="admonition warning">
937 <p class="first admonition-title">Warning</p>
938 <p class="last">DO NOT leave ipv4 and ipv6 values on None, as the default indicated.
939 This is a known bug and we&#8217;re working to fix it. ipv4 and ipv6 need to
940 be valid IP addresses, or, in case one of them is irrelevant, empty strings.</p>
941 </div>
942 <table class="docutils field-list" frame="void" rules="none">
943 <col class="field-name" />
944 <col class="field-body" />
945 <tbody valign="top">
946 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
947 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the interface will be saved.</li>
948 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the interface. Must be unique.</li>
949 <li><strong>name</strong> (<em>str</em>) &#8211; the interface&#8217;s name</li>
950 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
951 <li><strong>mac</strong> (<em>str</em>) &#8211; </li>
952 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the host owned or not?</li>
953 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
954 <li><strong>hostnames</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; a list of hostnames</li>
955 <li><strong>network_segment</strong> (<em>str</em>) &#8211; the network segment</li>
956 <li><strong>ipv4</strong> (<em>str</em>) &#8211; the ipv4 direction of the interface.</li>
957 <li><strong>ipv6</strong> (<em>str</em>) &#8211; the ipv6 direction of the interface.</li>
958 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
959 on None, it will be created automatically.</li>
960 </ul>
961 </td>
962 </tr>
963 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
964 </td>
965 </tr>
966 </tbody>
967 </table>
968 </dd></dl>
969
970 <dl class="function">
971 <dt id="persistence.server.server.update_interface">
972 <code class="descclassname">persistence.server.server.</code><code class="descname">update_interface</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>mac</em>, <em>owned=False</em>, <em>owner=''</em>, <em>hostnames=None</em>, <em>network_segment=None</em>, <em>ipv4=None</em>, <em>ipv6=None</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_interface" title="Permalink to this definition">¶</a></dt>
973 <dd><p>Creates an interface.</p>
974 <div class="admonition warning">
975 <p class="first admonition-title">Warning</p>
976 <p class="last">DO NOT leave ipv4 and ipv6 values on None, as the default indicated.
977 This is a known bug and we&#8217;re working to fix it. ipv4 and ipv6 need to
978 be valid IP addresses, or, in case one of them is irrelevant, empty strings.</p>
979 </div>
980 <table class="docutils field-list" frame="void" rules="none">
981 <col class="field-name" />
982 <col class="field-body" />
983 <tbody valign="top">
984 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
985 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the interface will be saved.</li>
986 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the interface. Must be unique.</li>
987 <li><strong>name</strong> (<em>str</em>) &#8211; the interface&#8217;s name</li>
988 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
989 <li><strong>mac</strong> (<em>str</em>) &#8211; </li>
990 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the host owned or not?</li>
991 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
992 <li><strong>hostnames</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; a list of hostnames</li>
993 <li><strong>network_segment</strong> (<em>str</em>) &#8211; the network segment</li>
994 <li><strong>ipv4</strong> (<em>str</em>) &#8211; the ipv4 direction of the interface.</li>
995 <li><strong>ipv6</strong> (<em>str</em>) &#8211; the ipv6 direction of the interface.</li>
996 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
997 on None, it will be created automatically.</li>
998 </ul>
999 </td>
1000 </tr>
1001 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1002 </td>
1003 </tr>
1004 </tbody>
1005 </table>
1006 </dd></dl>
1007
1008 <dl class="function">
1009 <dt id="persistence.server.server.create_service">
1010 <code class="descclassname">persistence.server.server.</code><code class="descname">create_service</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>ports</em>, <em>owned=False</em>, <em>owner=''</em>, <em>protocol=''</em>, <em>status=''</em>, <em>version=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_service" title="Permalink to this definition">¶</a></dt>
1011 <dd><p>Creates a service.</p>
1012 <table class="docutils field-list" frame="void" rules="none">
1013 <col class="field-name" />
1014 <col class="field-body" />
1015 <tbody valign="top">
1016 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1017 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the service will be saved.</li>
1018 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the service. Must be unique.</li>
1019 <li><strong>name</strong> (<em>str</em>) &#8211; the host&#8217;s name</li>
1020 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1021 <li><strong>ports</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; a list of ports for the service.</li>
1022 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the service owned or not?</li>
1023 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the service</li>
1024 <li><strong>protocol</strong> (<em>str</em>) &#8211; the service&#8217;s protocol</li>
1025 <li><strong>status</strong> (<em>str</em>) &#8211; the service&#8217;s status</li>
1026 <li><strong>version</strong> (<em>str</em>) &#8211; the service&#8217;s version</li>
1027 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1028 on None, it will be created automatically.</li>
1029 </ul>
1030 </td>
1031 </tr>
1032 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1033 </td>
1034 </tr>
1035 </tbody>
1036 </table>
1037 </dd></dl>
1038
1039 <dl class="function">
1040 <dt id="persistence.server.server.update_service">
1041 <code class="descclassname">persistence.server.server.</code><code class="descname">update_service</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>ports</em>, <em>owned=False</em>, <em>owner=''</em>, <em>protocol=''</em>, <em>status=''</em>, <em>version=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_service" title="Permalink to this definition">¶</a></dt>
1042 <dd><p>Creates a service.</p>
1043 <table class="docutils field-list" frame="void" rules="none">
1044 <col class="field-name" />
1045 <col class="field-body" />
1046 <tbody valign="top">
1047 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1048 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the service will be saved.</li>
1049 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the service. Must be unique.</li>
1050 <li><strong>name</strong> (<em>str</em>) &#8211; the service&#8217;s name</li>
1051 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1052 <li><strong>ports</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; a list of ports for the service.</li>
1053 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the host owned or not?</li>
1054 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the service</li>
1055 <li><strong>protocol</strong> (<em>str</em>) &#8211; the service&#8217;s protocol</li>
1056 <li><strong>status</strong> (<em>str</em>) &#8211; the service&#8217;s status</li>
1057 <li><strong>version</strong> (<em>str</em>) &#8211; the service&#8217;s version</li>
1058 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1059 on None, it will be created automatically.</li>
1060 </ul>
1061 </td>
1062 </tr>
1063 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1064 </td>
1065 </tr>
1066 </tbody>
1067 </table>
1068 </dd></dl>
1069
1070 <dl class="function">
1071 <dt id="persistence.server.server.create_vuln">
1072 <code class="descclassname">persistence.server.server.</code><code class="descname">create_vuln</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>owned=None</em>, <em>owner=''</em>, <em>confirmed=False</em>, <em>data=''</em>, <em>refs=None</em>, <em>severity='info'</em>, <em>resolution=''</em>, <em>desc=''</em>, <em>metadata=None</em>, <em>status=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_vuln"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_vuln" title="Permalink to this definition">¶</a></dt>
1073 <dd><p>Creates a vuln.</p>
1074 <table class="docutils field-list" frame="void" rules="none">
1075 <col class="field-name" />
1076 <col class="field-body" />
1077 <tbody valign="top">
1078 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1079 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln will be saved.</li>
1080 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln. Must be unique.</li>
1081 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln&#8217;s name</li>
1082 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1083 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the vuln owned or not?</li>
1084 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the vuln</li>
1085 <li><strong>confirmed</strong> (<em>bool</em>) &#8211; is the vulnerability confirmed?</li>
1086 <li><strong>data</strong> (<em>str</em>) &#8211; any aditional data about the vuln</li>
1087 <li><strong>refs</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; references for the vulnerability</li>
1088 <li><strong>severity</strong> (<em>str</em>) &#8211; a string indicating the vuln&#8217;s severity. can be &#8216;info&#8217;,
1089 &#8216;low&#8217;, &#8216;med&#8217;, &#8216;high&#8217;, &#8216;critical&#8217;</li>
1090 <li><strong>resolution</strong> (<em>str</em>) &#8211; the vuln&#8217;s possible resolution</li>
1091 <li><strong>desc</strong> (<em>str</em>) &#8211; a vuln&#8217;s description.</li>
1092 <li><strong>status</strong> (<em>str</em>) &#8211; the service&#8217;s status</li>
1093 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1094 on None, it will be created automatically.</li>
1095 </ul>
1096 </td>
1097 </tr>
1098 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1099 </td>
1100 </tr>
1101 </tbody>
1102 </table>
1103 </dd></dl>
1104
1105 <dl class="function">
1106 <dt id="persistence.server.server.update_vuln">
1107 <code class="descclassname">persistence.server.server.</code><code class="descname">update_vuln</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>owned=None</em>, <em>owner=''</em>, <em>confirmed=False</em>, <em>data=''</em>, <em>refs=None</em>, <em>severity='info'</em>, <em>resolution=''</em>, <em>desc=''</em>, <em>metadata=None</em>, <em>status=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_vuln"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_vuln" title="Permalink to this definition">¶</a></dt>
1108 <dd><p>Updates a vuln.</p>
1109 <table class="docutils field-list" frame="void" rules="none">
1110 <col class="field-name" />
1111 <col class="field-body" />
1112 <tbody valign="top">
1113 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1114 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the host will be saved.</li>
1115 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the host. Must be unique.</li>
1116 <li><strong>name</strong> (<em>str</em>) &#8211; the host&#8217;s name</li>
1117 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1118 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the vuln owned or not?</li>
1119 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the vuln</li>
1120 <li><strong>confirmed</strong> (<em>bool</em>) &#8211; is the vulnerability confirmed?</li>
1121 <li><strong>data</strong> (<em>str</em>) &#8211; any aditional data about the vuln</li>
1122 <li><strong>refs</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; references for the vulnerability</li>
1123 <li><strong>severity</strong> (<em>str</em>) &#8211; a string indicating the vuln&#8217;s severity. can be &#8216;info&#8217;,
1124 &#8216;low&#8217;, &#8216;med&#8217;, &#8216;high&#8217;, &#8216;critical&#8217;</li>
1125 <li><strong>resolution</strong> (<em>str</em>) &#8211; the vuln&#8217;s possible resolution</li>
1126 <li><strong>desc</strong> (<em>str</em>) &#8211; a vuln&#8217;s description.</li>
1127 <li><strong>status</strong> (<em>str</em>) &#8211; the service&#8217;s status</li>
1128 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1129 on None, it will be created automatically.</li>
1130 </ul>
1131 </td>
1132 </tr>
1133 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1134 </td>
1135 </tr>
1136 </tbody>
1137 </table>
1138 </dd></dl>
1139
1140 <dl class="function">
1141 <dt id="persistence.server.server.create_vuln_web">
1142 <code class="descclassname">persistence.server.server.</code><code class="descname">create_vuln_web</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>owned=None</em>, <em>owner=''</em>, <em>confirmed=False</em>, <em>data=''</em>, <em>refs=None</em>, <em>severity='info'</em>, <em>resolution=''</em>, <em>desc=''</em>, <em>metadata=None</em>, <em>method=None</em>, <em>params=''</em>, <em>path=None</em>, <em>pname=None</em>, <em>query=None</em>, <em>request=None</em>, <em>response=None</em>, <em>category=''</em>, <em>website=None</em>, <em>status=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_vuln_web"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_vuln_web" title="Permalink to this definition">¶</a></dt>
1143 <dd><p>Creates a vuln web.</p>
1144 <table class="docutils field-list" frame="void" rules="none">
1145 <col class="field-name" />
1146 <col class="field-body" />
1147 <tbody valign="top">
1148 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1149 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1150 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1151 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1152 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1153 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
1154 <li><strong>confirmed</strong> (<em>bool</em>) &#8211; is the vulnerability confirmed?</li>
1155 <li><strong>data</strong> (<em>str</em>) &#8211; any aditional data about the vuln</li>
1156 <li><strong>refs</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; references for the vulnerability</li>
1157 <li><strong>severity</strong> (<em>str</em>) &#8211; a string indicating the vuln&#8217;s severity. can be &#8216;info&#8217;,
1158 &#8216;low&#8217;, &#8216;med&#8217;, &#8216;high&#8217;, &#8216;critical&#8217;</li>
1159 <li><strong>resolution</strong> (<em>str</em>) &#8211; the vuln&#8217;s possible resolution</li>
1160 <li><strong>desc</strong> (<em>str</em>) &#8211; a vuln&#8217;s description.</li>
1161 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1162 on None, it will be created automatically.</li>
1163 <li><strong>method</strong> (<em>str</em>) &#8211; the web vuln method</li>
1164 <li><strong>params</strong> (<em>str</em>) &#8211; the parameters for the web vuln</li>
1165 <li><strong>path</strong> (<em>str</em>) &#8211; the web vuln&#8217;s path</li>
1166 <li><strong>query</strong> (<em>str</em>) &#8211; the web vuln&#8217;s query</li>
1167 <li><strong>request</strong> (<em>str</em>) &#8211; the web vuln&#8217;s request</li>
1168 <li><strong>response</strong> (<em>str</em>) &#8211; the web vuln&#8217;s response</li>
1169 <li><strong>category</strong> (<em>str</em>) &#8211; a category for the web vuln&#8217;s</li>
1170 <li><strong>website</strong> (<em>str</em>) &#8211; the website where the vuln was found</li>
1171 <li><strong>status</strong> (<em>str</em>) &#8211; the web vulns&#8217;s status</li>
1172 </ul>
1173 </td>
1174 </tr>
1175 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1176 </td>
1177 </tr>
1178 </tbody>
1179 </table>
1180 </dd></dl>
1181
1182 <dl class="function">
1183 <dt id="persistence.server.server.update_vuln_web">
1184 <code class="descclassname">persistence.server.server.</code><code class="descname">update_vuln_web</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>description</em>, <em>owned=None</em>, <em>owner=''</em>, <em>confirmed=False</em>, <em>data=''</em>, <em>refs=None</em>, <em>severity='info'</em>, <em>resolution=''</em>, <em>desc=''</em>, <em>metadata=None</em>, <em>method=None</em>, <em>params=''</em>, <em>path=None</em>, <em>pname=None</em>, <em>query=None</em>, <em>request=None</em>, <em>response=None</em>, <em>category=''</em>, <em>website=None</em>, <em>status=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_vuln_web"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_vuln_web" title="Permalink to this definition">¶</a></dt>
1185 <dd><p>Creates a vuln web.</p>
1186 <table class="docutils field-list" frame="void" rules="none">
1187 <col class="field-name" />
1188 <col class="field-body" />
1189 <tbody valign="top">
1190 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1191 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1192 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1193 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1194 <li><strong>description</strong> (<em>str</em>) &#8211; a description.</li>
1195 <li><strong>owner</strong> (<em>str</em>) &#8211; an owner for the host</li>
1196 <li><strong>confirmed</strong> (<em>bool</em>) &#8211; is the vulnerability confirmed?</li>
1197 <li><strong>data</strong> (<em>str</em>) &#8211; any aditional data about the vuln</li>
1198 <li><strong>refs</strong> (<em></em><em>[</em><em>str</em><em>]</em><em></em>) &#8211; references for the vulnerability</li>
1199 <li><strong>severity</strong> (<em>str</em>) &#8211; a string indicating the vuln&#8217;s severity. can be &#8216;info&#8217;,
1200 &#8216;low&#8217;, &#8216;med&#8217;, &#8216;high&#8217;, &#8216;critical&#8217;</li>
1201 <li><strong>resolution</strong> (<em>str</em>) &#8211; the vuln&#8217;s possible resolution</li>
1202 <li><strong>desc</strong> (<em>str</em>) &#8211; a vuln&#8217;s description.</li>
1203 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1204 on None, it will be created automatically.</li>
1205 <li><strong>method</strong> (<em>str</em>) &#8211; the web vuln method</li>
1206 <li><strong>params</strong> (<em>str</em>) &#8211; the parameters for the web vuln</li>
1207 <li><strong>path</strong> (<em>str</em>) &#8211; the web vuln&#8217;s path</li>
1208 <li><strong>query</strong> (<em>str</em>) &#8211; the web vuln&#8217;s query</li>
1209 <li><strong>request</strong> (<em>str</em>) &#8211; the web vuln&#8217;s request</li>
1210 <li><strong>response</strong> (<em>str</em>) &#8211; the web vuln&#8217;s response</li>
1211 <li><strong>category</strong> (<em>str</em>) &#8211; a category for the web vuln&#8217;s</li>
1212 <li><strong>website</strong> (<em>str</em>) &#8211; the website where the vuln was found</li>
1213 <li><strong>status</strong> (<em>str</em>) &#8211; the web vulns&#8217;s status</li>
1214 </ul>
1215 </td>
1216 </tr>
1217 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1218 </td>
1219 </tr>
1220 </tbody>
1221 </table>
1222 </dd></dl>
1223
1224 <dl class="function">
1225 <dt id="persistence.server.server.create_note">
1226 <code class="descclassname">persistence.server.server.</code><code class="descname">create_note</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>text</em>, <em>owned=None</em>, <em>owner=''</em>, <em>description=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_note"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_note" title="Permalink to this definition">¶</a></dt>
1227 <dd><p>Creates a note.</p>
1228 <table class="docutils field-list" frame="void" rules="none">
1229 <col class="field-name" />
1230 <col class="field-body" />
1231 <tbody valign="top">
1232 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1233 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1234 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1235 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1236 <li><strong>text</strong> (<em>str</em>) &#8211; the note&#8217;s text</li>
1237 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the note owned?</li>
1238 <li><strong>owner</strong> (<em>str</em>) &#8211; the note&#8217;s owner</li>
1239 <li><strong>description</strong> (<em>str</em>) &#8211; a description</li>
1240 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1241 on None, it will be created automatically.</li>
1242 </ul>
1243 </td>
1244 </tr>
1245 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1246 </td>
1247 </tr>
1248 </tbody>
1249 </table>
1250 </dd></dl>
1251
1252 <dl class="function">
1253 <dt id="persistence.server.server.update_note">
1254 <code class="descclassname">persistence.server.server.</code><code class="descname">update_note</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>text</em>, <em>owned=None</em>, <em>owner=''</em>, <em>description=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_note"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_note" title="Permalink to this definition">¶</a></dt>
1255 <dd><p>Updates a note.</p>
1256 <table class="docutils field-list" frame="void" rules="none">
1257 <col class="field-name" />
1258 <col class="field-body" />
1259 <tbody valign="top">
1260 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1261 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1262 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1263 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1264 <li><strong>text</strong> (<em>str</em>) &#8211; the note&#8217;s text</li>
1265 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the note owned?</li>
1266 <li><strong>owner</strong> (<em>str</em>) &#8211; the note&#8217;s owner</li>
1267 <li><strong>description</strong> (<em>str</em>) &#8211; a description</li>
1268 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1269 on None, it will be created automatically.</li>
1270 </ul>
1271 </td>
1272 </tr>
1273 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1274 </td>
1275 </tr>
1276 </tbody>
1277 </table>
1278 </dd></dl>
1279
1280 <dl class="function">
1281 <dt id="persistence.server.server.create_credential">
1282 <code class="descclassname">persistence.server.server.</code><code class="descname">create_credential</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>username</em>, <em>password</em>, <em>owned=None</em>, <em>owner=''</em>, <em>description=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_credential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_credential" title="Permalink to this definition">¶</a></dt>
1283 <dd><p>Creates a credential.</p>
1284 <table class="docutils field-list" frame="void" rules="none">
1285 <col class="field-name" />
1286 <col class="field-body" />
1287 <tbody valign="top">
1288 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1289 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1290 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1291 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1292 <li><strong>username</strong> (<em>str</em>) &#8211; </li>
1293 <li><strong>password</strong> (<em>str</em>) &#8211; </li>
1294 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the note owned?</li>
1295 <li><strong>owner</strong> (<em>str</em>) &#8211; the note&#8217;s owner</li>
1296 <li><strong>description</strong> (<em>str</em>) &#8211; a description</li>
1297 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1298 on None, it will be created automatically.</li>
1299 </ul>
1300 </td>
1301 </tr>
1302 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1303 </td>
1304 </tr>
1305 </tbody>
1306 </table>
1307 </dd></dl>
1308
1309 <dl class="function">
1310 <dt id="persistence.server.server.update_credential">
1311 <code class="descclassname">persistence.server.server.</code><code class="descname">update_credential</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>name</em>, <em>username</em>, <em>password</em>, <em>owned=None</em>, <em>owner=''</em>, <em>description=''</em>, <em>metadata=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_credential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_credential" title="Permalink to this definition">¶</a></dt>
1312 <dd><p>Updates a credential.</p>
1313 <table class="docutils field-list" frame="void" rules="none">
1314 <col class="field-name" />
1315 <col class="field-body" />
1316 <tbody valign="top">
1317 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1318 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1319 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1320 <li><strong>name</strong> (<em>str</em>) &#8211; the vuln web&#8217;s name</li>
1321 <li><strong>username</strong> (<em>str</em>) &#8211; </li>
1322 <li><strong>password</strong> (<em>str</em>) &#8211; </li>
1323 <li><strong>owned</strong> (<em>bool</em>) &#8211; is the note owned?</li>
1324 <li><strong>owner</strong> (<em>str</em>) &#8211; the note&#8217;s owner</li>
1325 <li><strong>description</strong> (<em>str</em>) &#8211; a description</li>
1326 <li><strong>metadata</strong> &#8211; a collection of metadata. If you don&#8217;t know the metada. leave
1327 on None, it will be created automatically.</li>
1328 </ul>
1329 </td>
1330 </tr>
1331 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1332 </td>
1333 </tr>
1334 </tbody>
1335 </table>
1336 </dd></dl>
1337
1338 <dl class="function">
1339 <dt id="persistence.server.server.create_command">
1340 <code class="descclassname">persistence.server.server.</code><code class="descname">create_command</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>command</em>, <em>duration=None</em>, <em>hostname=None</em>, <em>ip=None</em>, <em>itime=None</em>, <em>params=None</em>, <em>user=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_command" title="Permalink to this definition">¶</a></dt>
1341 <dd><p>Creates a command.</p>
1342 <table class="docutils field-list" frame="void" rules="none">
1343 <col class="field-name" />
1344 <col class="field-body" />
1345 <tbody valign="top">
1346 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1347 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1348 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1349 <li><strong>command</strong> (<em>str</em>) &#8211; the command to be created</li>
1350 <li><strong>duration</strong> (<em>str</em>) &#8211; </li>
1351 <li><strong>hostname</strong> (<em>str</em>) &#8211; the hostname where the command was executed</li>
1352 <li><strong>ip</strong> (<em>str</em>) &#8211; the ip of the host where the command was executed</li>
1353 <li><strong>itime</strong> (<em>str</em>) &#8211; the time it took to run</li>
1354 <li><strong>params</strong> (<em>str</em>) &#8211; the parameters given</li>
1355 <li><strong>user</strong> (<em>str</em>) &#8211; the user that ran the command</li>
1356 </ul>
1357 </td>
1358 </tr>
1359 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1360 </td>
1361 </tr>
1362 </tbody>
1363 </table>
1364 </dd></dl>
1365
1366 <dl class="function">
1367 <dt id="persistence.server.server.update_command">
1368 <code class="descclassname">persistence.server.server.</code><code class="descname">update_command</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>id</em>, <em>command</em>, <em>duration=None</em>, <em>hostname=None</em>, <em>ip=None</em>, <em>itime=None</em>, <em>params=None</em>, <em>user=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#update_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.update_command" title="Permalink to this definition">¶</a></dt>
1369 <dd><p>Updates a command.</p>
1370 <table class="docutils field-list" frame="void" rules="none">
1371 <col class="field-name" />
1372 <col class="field-body" />
1373 <tbody valign="top">
1374 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1375 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the name of the workspace where the vuln web will be saved.</li>
1376 <li><strong>id</strong> (<em>str</em>) &#8211; the id of the vuln web. Must be unique.</li>
1377 <li><strong>command</strong> (<em>str</em>) &#8211; the command to be created</li>
1378 <li><strong>duration</strong> (<em>str</em>) &#8211; </li>
1379 <li><strong>hostname</strong> (<em>str</em>) &#8211; the hostname where the command was executed</li>
1380 <li><strong>ip</strong> (<em>str</em>) &#8211; the ip of the host where the command was executed</li>
1381 <li><strong>itime</strong> (<em>str</em>) &#8211; the time it took to run</li>
1382 <li><strong>params</strong> (<em>str</em>) &#8211; the parameters given</li>
1383 <li><strong>user</strong> (<em>str</em>) &#8211; the user that ran the command</li>
1384 </ul>
1385 </td>
1386 </tr>
1387 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1388 </td>
1389 </tr>
1390 </tbody>
1391 </table>
1392 </dd></dl>
1393
1394 <dl class="function">
1395 <dt id="persistence.server.server.create_workspace">
1396 <code class="descclassname">persistence.server.server.</code><code class="descname">create_workspace</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>description</em>, <em>start_date</em>, <em>finish_date</em>, <em>customer=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#create_workspace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.create_workspace" title="Permalink to this definition">¶</a></dt>
1397 <dd><p>Create a workspace.</p>
1398 <table class="docutils field-list" frame="void" rules="none">
1399 <col class="field-name" />
1400 <col class="field-body" />
1401 <tbody valign="top">
1402 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
1403 <li><strong>workspace_name</strong> (<em>str</em>) &#8211; the workspace&#8217;s name</li>
1404 <li><strong>description</strong> (<em>str</em>) &#8211; a description for the worksapce</li>
1405 <li><strong>start_date</strong> (<em>str</em>) &#8211; a date to represent when work began in the workspace</li>
1406 <li><strong>finish_date</strong> (<em>str</em>) &#8211; a date to represent when work will be finished on the workspace</li>
1407 <li><strong>customer</strong> (<em>str</em>) &#8211; the customer for which we are creating the workspace</li>
1408 </ul>
1409 </td>
1410 </tr>
1411 <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A dictionary with the server&#8217;s response.</p>
1412 </td>
1413 </tr>
1414 </tbody>
1415 </table>
1416 </dd></dl>
1417
1418 <dl class="function">
1419 <dt id="persistence.server.server.delete_host">
1420 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_host</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>host_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_host"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_host" title="Permalink to this definition">¶</a></dt>
1421 <dd><p>Delete host of id host_id from the database.</p>
1422 </dd></dl>
1423
1424 <dl class="function">
1425 <dt id="persistence.server.server.delete_interface">
1426 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_interface</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>interface_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_interface"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_interface" title="Permalink to this definition">¶</a></dt>
1427 <dd><p>Delete interface of id interface_id from the database.</p>
1428 </dd></dl>
1429
1430 <dl class="function">
1431 <dt id="persistence.server.server.delete_service">
1432 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_service</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>service_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_service"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_service" title="Permalink to this definition">¶</a></dt>
1433 <dd><p>Delete service of id service_id from the database.</p>
1434 </dd></dl>
1435
1436 <dl class="function">
1437 <dt id="persistence.server.server.delete_vuln">
1438 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_vuln</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>vuln_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_vuln"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_vuln" title="Permalink to this definition">¶</a></dt>
1439 <dd><p>Delete vuln of id vuln_id from the database.</p>
1440 </dd></dl>
1441
1442 <dl class="function">
1443 <dt id="persistence.server.server.delete_note">
1444 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_note</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>note_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_note"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_note" title="Permalink to this definition">¶</a></dt>
1445 <dd><p>Delete note of id note_id from the database.</p>
1446 </dd></dl>
1447
1448 <dl class="function">
1449 <dt id="persistence.server.server.delete_credential">
1450 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_credential</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>credential_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_credential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_credential" title="Permalink to this definition">¶</a></dt>
1451 <dd><p>Delete credential of id credential_id from the database.</p>
1452 </dd></dl>
1453
1454 <dl class="function">
1455 <dt id="persistence.server.server.delete_command">
1456 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_command</code><span class="sig-paren">(</span><em>workspace_name</em>, <em>command_id</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_command"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_command" title="Permalink to this definition">¶</a></dt>
1457 <dd><p>Delete command of id command_id from the database.</p>
1458 </dd></dl>
1459
1460 <dl class="function">
1461 <dt id="persistence.server.server.delete_workspace">
1462 <code class="descclassname">persistence.server.server.</code><code class="descname">delete_workspace</code><span class="sig-paren">(</span><em>workspace_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#delete_workspace"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.delete_workspace" title="Permalink to this definition">¶</a></dt>
1463 <dd><p>Delete the couch database of id workspace_name</p>
1464 </dd></dl>
1465
1466 <dl class="function">
1467 <dt id="persistence.server.server.is_server_up">
1468 <code class="descclassname">persistence.server.server.</code><code class="descname">is_server_up</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#is_server_up"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.is_server_up" title="Permalink to this definition">¶</a></dt>
1469 <dd><p>Return True if we can stablish a connection with the server,
1470 False otherwise.</p>
1471 </dd></dl>
1472
1473 <dl class="function">
1474 <dt id="persistence.server.server.test_server_url">
1475 <code class="descclassname">persistence.server.server.</code><code class="descname">test_server_url</code><span class="sig-paren">(</span><em>url_to_test</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/persistence/server/server.html#test_server_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#persistence.server.server.test_server_url" title="Permalink to this definition">¶</a></dt>
1476 <dd><p>Return True if the url_to_test is indeed a valid Faraday Server URL.
1477 False otherwise.</p>
1478 </dd></dl>
1479
1480 </div>
1481 </div>
1482
1483
1484 </div>
1485 </div>
1486 <footer>
1487
1488
1489 <hr/>
1490
1491 <div role="contentinfo">
1492 <p>
1493 &copy; Copyright 2016, Infobyte.
1494
1495 </p>
1496 </div>
1497 Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
1498
1499 </footer>
1500
1501 </div>
1502 </div>
1503
1504 </section>
1505
1506 </div>
1507
1508
1509
1510
1511
1512 <script type="text/javascript">
1513 var DOCUMENTATION_OPTIONS = {
1514 URL_ROOT:'./',
1515 VERSION:'0.1',
1516 COLLAPSE_INDEX:false,
1517 FILE_SUFFIX:'.html',
1518 HAS_SOURCE: true
1519 };
1520 </script>
1521 <script type="text/javascript" src="_static/jquery.js"></script>
1522 <script type="text/javascript" src="_static/underscore.js"></script>
1523 <script type="text/javascript" src="_static/doctools.js"></script>
1524
1525
1526
1527
1528
1529 <script type="text/javascript" src="_static/js/theme.js"></script>
1530
1531
1532
1533
1534 <script type="text/javascript">
1535 jQuery(function () {
1536 SphinxRtdTheme.StickyNav.enable();
1537 });
1538 </script>
1539
1540
1541 </body>
1542 </html>
0 #!/usr/bin/env python3
1 # -*- coding: utf-8 -*-
2 #
3 # Faraday documentation build configuration file, created by
4 # sphinx-quickstart on Fri Dec 9 14:53:21 2016.
5 #
6 # This file is execfile()d with the current directory set to its
7 # containing dir.
8 #
9 # Note that not all possible configuration values are present in this
10 # autogenerated file.
11 #
12 # All configuration values have a default; values that are commented out
13 # serve to show the default.
14
15 # If extensions (or modules to document with autodoc) are in another directory,
16 # add these directories to sys.path here. If the directory is relative to the
17 # documentation root, use os.path.abspath to make it absolute, like shown here.
18 #
19 import os
20 import sys
21 print os.path.abspath('..')
22 sys.path.insert(0, os.path.abspath('..'))
23 sys.path.insert(0, os.path.abspath('../../..'))
24
25 # -- General configuration ------------------------------------------------
26 autoclass_content = 'both'
27 autodoc_member_order = 'bysource'
28
29 # If your documentation needs a minimal Sphinx version, state it here.
30 #
31 # needs_sphinx = '1.0'
32
33 # Add any Sphinx extension module names here, as strings. They can be
34 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35 # ones.
36 extensions = [
37 'sphinx.ext.autodoc',
38 'sphinx.ext.viewcode',
39 'sphinx.ext.napoleon'
40 ]
41
42 # Add any paths that contain templates here, relative to this directory.
43 templates_path = ['_templates']
44
45 # The suffix(es) of source filenames.
46 # You can specify multiple suffix as a list of string:
47 #
48 # source_suffix = ['.rst', '.md']
49 source_suffix = '.rst'
50
51 # The encoding of source files.
52 #
53 # source_encoding = 'utf-8-sig'
54
55 # The master toctree document.
56 master_doc = 'index'
57
58 # General information about the project.
59 project = 'Faraday'
60 copyright = '2016, Infobyte'
61 author = 'Infobyte'
62
63 # The version info for the project you're documenting, acts as replacement for
64 # |version| and |release|, also used in various other places throughout the
65 # built documents.
66 #
67 # The short X.Y version.
68 version = '0.1'
69 # The full version, including alpha/beta/rc tags.
70 release = '0.1'
71
72 # The language for content autogenerated by Sphinx. Refer to documentation
73 # for a list of supported languages.
74 #
75 # This is also used if you do content translation via gettext catalogs.
76 # Usually you set "language" from the command line for these cases.
77 language = None
78
79 # There are two options for replacing |today|: either, you set today to some
80 # non-false value, then it is used:
81 #
82 # today = ''
83 #
84 # Else, today_fmt is used as the format for a strftime call.
85 #
86 # today_fmt = '%B %d, %Y'
87
88 # List of patterns, relative to source directory, that match files and
89 # directories to ignore when looking for source files.
90 # This patterns also effect to html_static_path and html_extra_path
91 exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
92
93 # The reST default role (used for this markup: `text`) to use for all
94 # documents.
95 #
96 # default_role = None
97
98 # If true, '()' will be appended to :func: etc. cross-reference text.
99 #
100 # add_function_parentheses = True
101
102 # If true, the current module name will be prepended to all description
103 # unit titles (such as .. function::).
104 #
105 # add_module_names = True
106
107 # If true, sectionauthor and moduleauthor directives will be shown in the
108 # output. They are ignored by default.
109 #
110 # show_authors = False
111
112 # The name of the Pygments (syntax highlighting) style to use.
113 pygments_style = 'sphinx'
114
115 # A list of ignored prefixes for module index sorting.
116 # modindex_common_prefix = []
117
118 # If true, keep warnings as "system message" paragraphs in the built documents.
119 # keep_warnings = False
120
121 # If true, `todo` and `todoList` produce output, else they produce nothing.
122 todo_include_todos = False
123
124
125 # -- Options for HTML output ----------------------------------------------
126
127 # The theme to use for HTML and HTML Help pages. See the documentation for
128 # a list of builtin themes.
129 #
130 # html_theme = 'alabaster'
131 import sphinx_rtd_theme
132 html_theme = "sphinx_rtd_theme"
133 html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
134
135
136 # Theme options are theme-specific and customize the look and feel of a theme
137 # further. For a list of options available for each theme, see the
138 # documentation.
139 #
140 # html_theme_options = {}
141
142 # Add any paths that contain custom themes here, relative to this directory.
143 # html_theme_path = []
144
145 # The name for this set of Sphinx documents.
146 # "<project> v<release> documentation" by default.
147 #
148 # html_title = 'Faraday v0.1'
149
150 # A shorter title for the navigation bar. Default is the same as html_title.
151 #
152 # html_short_title = None
153
154 # The name of an image file (relative to this directory) to place at the top
155 # of the sidebar.
156 #
157 # html_logo = None
158
159 # The name of an image file (relative to this directory) to use as a favicon of
160 # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
161 # pixels large.
162 #
163 # html_favicon = None
164
165 # Add any paths that contain custom static files (such as style sheets) here,
166 # relative to this directory. They are copied after the builtin static files,
167 # so a file named "default.css" will overwrite the builtin "default.css".
168 html_static_path = ['_static']
169
170 # Add any extra paths that contain custom files (such as robots.txt or
171 # .htaccess) here, relative to this directory. These files are copied
172 # directly to the root of the documentation.
173 #
174 # html_extra_path = []
175
176 # If not None, a 'Last updated on:' timestamp is inserted at every page
177 # bottom, using the given strftime format.
178 # The empty string is equivalent to '%b %d, %Y'.
179 #
180 # html_last_updated_fmt = None
181
182 # If true, SmartyPants will be used to convert quotes and dashes to
183 # typographically correct entities.
184 #
185 # html_use_smartypants = True
186
187 # Custom sidebar templates, maps document names to template names.
188 #
189 # html_sidebars = {}
190
191 # Additional templates that should be rendered to pages, maps page names to
192 # template names.
193 #
194 # html_additional_pages = {}
195
196 # If false, no module index is generated.
197 #
198 # html_domain_indices = True
199
200 # If false, no index is generated.
201 #
202 # html_use_index = True
203
204 # If true, the index is split into individual pages for each letter.
205 #
206 # html_split_index = False
207
208 # If true, links to the reST sources are added to the pages.
209 #
210 # html_show_sourcelink = True
211
212 # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
213 #
214 # html_show_sphinx = True
215
216 # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
217 #
218 # html_show_copyright = True
219
220 # If true, an OpenSearch description file will be output, and all pages will
221 # contain a <link> tag referring to it. The value of this option must be the
222 # base URL from which the finished HTML is served.
223 #
224 # html_use_opensearch = ''
225
226 # This is the file name suffix for HTML files (e.g. ".xhtml").
227 # html_file_suffix = None
228
229 # Language to be used for generating the HTML full-text search index.
230 # Sphinx supports the following languages:
231 # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
232 # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr', 'zh'
233 #
234 # html_search_language = 'en'
235
236 # A dictionary with options for the search language support, empty by default.
237 # 'ja' uses this config value.
238 # 'zh' user can custom change `jieba` dictionary path.
239 #
240 # html_search_options = {'type': 'default'}
241
242 # The name of a javascript file (relative to the configuration directory) that
243 # implements a search results scorer. If empty, the default will be used.
244 #
245 # html_search_scorer = 'scorer.js'
246
247 # Output file base name for HTML help builder.
248 htmlhelp_basename = 'Faradaydoc'
249
250 # -- Options for LaTeX output ---------------------------------------------
251
252 latex_elements = {
253 # The paper size ('letterpaper' or 'a4paper').
254 #
255 # 'papersize': 'letterpaper',
256
257 # The font size ('10pt', '11pt' or '12pt').
258 #
259 # 'pointsize': '10pt',
260
261 # Additional stuff for the LaTeX preamble.
262 #
263 # 'preamble': '',
264
265 # Latex figure (float) alignment
266 #
267 # 'figure_align': 'htbp',
268 }
269
270 # Grouping the document tree into LaTeX files. List of tuples
271 # (source start file, target name, title,
272 # author, documentclass [howto, manual, or own class]).
273 latex_documents = [
274 (master_doc, 'Faraday.tex', 'Faraday Documentation',
275 'Infobyte', 'manual'),
276 ]
277
278 # The name of an image file (relative to this directory) to place at the top of
279 # the title page.
280 #
281 # latex_logo = None
282
283 # For "manual" documents, if this is true, then toplevel headings are parts,
284 # not chapters.
285 #
286 # latex_use_parts = False
287
288 # If true, show page references after internal links.
289 #
290 # latex_show_pagerefs = False
291
292 # If true, show URL addresses after external links.
293 #
294 # latex_show_urls = False
295
296 # Documents to append as an appendix to all manuals.
297 #
298 # latex_appendices = []
299
300 # It false, will not define \strong, \code, itleref, \crossref ... but only
301 # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added
302 # packages.
303 #
304 # latex_keep_old_macro_names = True
305
306 # If false, no module index is generated.
307 #
308 # latex_domain_indices = True
309
310
311 # -- Options for manual page output ---------------------------------------
312
313 # One entry per manual page. List of tuples
314 # (source start file, name, description, authors, manual section).
315 man_pages = [
316 (master_doc, 'faraday', 'Faraday Documentation',
317 [author], 1)
318 ]
319
320 # If true, show URL addresses after external links.
321 #
322 # man_show_urls = False
323
324
325 # -- Options for Texinfo output -------------------------------------------
326
327 # Grouping the document tree into Texinfo files. List of tuples
328 # (source start file, target name, title, author,
329 # dir menu entry, description, category)
330 texinfo_documents = [
331 (master_doc, 'Faraday', 'Faraday Documentation',
332 author, 'Faraday', 'One line description of project.',
333 'Miscellaneous'),
334 ]
335
336 # Documents to append as an appendix to all manuals.
337 #
338 # texinfo_appendices = []
339
340 # If false, no module index is generated.
341 #
342 # texinfo_domain_indices = True
343
344 # How to display URL addresses: 'footnote', 'no', or 'inline'.
345 #
346 # texinfo_show_urls = 'footnote'
347
348 # If true, do not generate a @detailmenu in the "Top" node's menu.
349 #
350 # texinfo_no_detailmenu = False
0 .. Faraday documentation master file, created by
1 sphinx-quickstart on Fri Dec 9 14:53:21 2016.
2 You can adapt this file completely to your liking, but it should at least
3 contain the root `toctree` directive.
4
5 Welcome to Faraday's documentation!
6 ===================================
7
8 Contents:
9
10 .. toctree::
11 :maxdepth: 2
12
13
14
15 Indices and tables
16 ==================
17
18 * :ref:`genindex`
19 * :ref:`modindex`
20 * :ref:`search`
21
0 @ECHO OFF
1
2 REM Command file for Sphinx documentation
3
4 if "%SPHINXBUILD%" == "" (
5 set SPHINXBUILD=sphinx-build
6 )
7 set BUILDDIR=_build
8 set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
9 set I18NSPHINXOPTS=%SPHINXOPTS% .
10 if NOT "%PAPER%" == "" (
11 set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
12 set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
13 )
14
15 if "%1" == "" goto help
16
17 if "%1" == "help" (
18 :help
19 echo.Please use `make ^<target^>` where ^<target^> is one of
20 echo. html to make standalone HTML files
21 echo. dirhtml to make HTML files named index.html in directories
22 echo. singlehtml to make a single large HTML file
23 echo. pickle to make pickle files
24 echo. json to make JSON files
25 echo. htmlhelp to make HTML files and a HTML help project
26 echo. qthelp to make HTML files and a qthelp project
27 echo. devhelp to make HTML files and a Devhelp project
28 echo. epub to make an epub
29 echo. epub3 to make an epub3
30 echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31 echo. text to make text files
32 echo. man to make manual pages
33 echo. texinfo to make Texinfo files
34 echo. gettext to make PO message catalogs
35 echo. changes to make an overview over all changed/added/deprecated items
36 echo. xml to make Docutils-native XML files
37 echo. pseudoxml to make pseudoxml-XML files for display purposes
38 echo. linkcheck to check all external links for integrity
39 echo. doctest to run all doctests embedded in the documentation if enabled
40 echo. coverage to run coverage check of the documentation if enabled
41 echo. dummy to check syntax errors of document sources
42 goto end
43 )
44
45 if "%1" == "clean" (
46 for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
47 del /q /s %BUILDDIR%\*
48 goto end
49 )
50
51
52 REM Check if sphinx-build is available and fallback to Python version if any
53 %SPHINXBUILD% 1>NUL 2>NUL
54 if errorlevel 9009 goto sphinx_python
55 goto sphinx_ok
56
57 :sphinx_python
58
59 set SPHINXBUILD=python -m sphinx.__init__
60 %SPHINXBUILD% 2> nul
61 if errorlevel 9009 (
62 echo.
63 echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
64 echo.installed, then set the SPHINXBUILD environment variable to point
65 echo.to the full path of the 'sphinx-build' executable. Alternatively you
66 echo.may add the Sphinx directory to PATH.
67 echo.
68 echo.If you don't have Sphinx installed, grab it from
69 echo.http://sphinx-doc.org/
70 exit /b 1
71 )
72
73 :sphinx_ok
74
75
76 if "%1" == "html" (
77 %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
78 if errorlevel 1 exit /b 1
79 echo.
80 echo.Build finished. The HTML pages are in %BUILDDIR%/html.
81 goto end
82 )
83
84 if "%1" == "dirhtml" (
85 %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
86 if errorlevel 1 exit /b 1
87 echo.
88 echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
89 goto end
90 )
91
92 if "%1" == "singlehtml" (
93 %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
94 if errorlevel 1 exit /b 1
95 echo.
96 echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
97 goto end
98 )
99
100 if "%1" == "pickle" (
101 %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
102 if errorlevel 1 exit /b 1
103 echo.
104 echo.Build finished; now you can process the pickle files.
105 goto end
106 )
107
108 if "%1" == "json" (
109 %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
110 if errorlevel 1 exit /b 1
111 echo.
112 echo.Build finished; now you can process the JSON files.
113 goto end
114 )
115
116 if "%1" == "htmlhelp" (
117 %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
118 if errorlevel 1 exit /b 1
119 echo.
120 echo.Build finished; now you can run HTML Help Workshop with the ^
121 .hhp project file in %BUILDDIR%/htmlhelp.
122 goto end
123 )
124
125 if "%1" == "qthelp" (
126 %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
127 if errorlevel 1 exit /b 1
128 echo.
129 echo.Build finished; now you can run "qcollectiongenerator" with the ^
130 .qhcp project file in %BUILDDIR%/qthelp, like this:
131 echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Faraday.qhcp
132 echo.To view the help file:
133 echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Faraday.ghc
134 goto end
135 )
136
137 if "%1" == "devhelp" (
138 %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
139 if errorlevel 1 exit /b 1
140 echo.
141 echo.Build finished.
142 goto end
143 )
144
145 if "%1" == "epub" (
146 %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
147 if errorlevel 1 exit /b 1
148 echo.
149 echo.Build finished. The epub file is in %BUILDDIR%/epub.
150 goto end
151 )
152
153 if "%1" == "epub3" (
154 %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3
155 if errorlevel 1 exit /b 1
156 echo.
157 echo.Build finished. The epub3 file is in %BUILDDIR%/epub3.
158 goto end
159 )
160
161 if "%1" == "latex" (
162 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
163 if errorlevel 1 exit /b 1
164 echo.
165 echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
166 goto end
167 )
168
169 if "%1" == "latexpdf" (
170 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
171 cd %BUILDDIR%/latex
172 make all-pdf
173 cd %~dp0
174 echo.
175 echo.Build finished; the PDF files are in %BUILDDIR%/latex.
176 goto end
177 )
178
179 if "%1" == "latexpdfja" (
180 %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
181 cd %BUILDDIR%/latex
182 make all-pdf-ja
183 cd %~dp0
184 echo.
185 echo.Build finished; the PDF files are in %BUILDDIR%/latex.
186 goto end
187 )
188
189 if "%1" == "text" (
190 %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
191 if errorlevel 1 exit /b 1
192 echo.
193 echo.Build finished. The text files are in %BUILDDIR%/text.
194 goto end
195 )
196
197 if "%1" == "man" (
198 %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
199 if errorlevel 1 exit /b 1
200 echo.
201 echo.Build finished. The manual pages are in %BUILDDIR%/man.
202 goto end
203 )
204
205 if "%1" == "texinfo" (
206 %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
207 if errorlevel 1 exit /b 1
208 echo.
209 echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
210 goto end
211 )
212
213 if "%1" == "gettext" (
214 %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
215 if errorlevel 1 exit /b 1
216 echo.
217 echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
218 goto end
219 )
220
221 if "%1" == "changes" (
222 %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
223 if errorlevel 1 exit /b 1
224 echo.
225 echo.The overview file is in %BUILDDIR%/changes.
226 goto end
227 )
228
229 if "%1" == "linkcheck" (
230 %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
231 if errorlevel 1 exit /b 1
232 echo.
233 echo.Link check complete; look for any errors in the above output ^
234 or in %BUILDDIR%/linkcheck/output.txt.
235 goto end
236 )
237
238 if "%1" == "doctest" (
239 %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
240 if errorlevel 1 exit /b 1
241 echo.
242 echo.Testing of doctests in the sources finished, look at the ^
243 results in %BUILDDIR%/doctest/output.txt.
244 goto end
245 )
246
247 if "%1" == "coverage" (
248 %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage
249 if errorlevel 1 exit /b 1
250 echo.
251 echo.Testing of coverage in the sources finished, look at the ^
252 results in %BUILDDIR%/coverage/python.txt.
253 goto end
254 )
255
256 if "%1" == "xml" (
257 %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
258 if errorlevel 1 exit /b 1
259 echo.
260 echo.Build finished. The XML files are in %BUILDDIR%/xml.
261 goto end
262 )
263
264 if "%1" == "pseudoxml" (
265 %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
266 if errorlevel 1 exit /b 1
267 echo.
268 echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
269 goto end
270 )
271
272 if "%1" == "dummy" (
273 %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy
274 if errorlevel 1 exit /b 1
275 echo.
276 echo.Build finished. Dummy builder generates no files.
277 goto end
278 )
279
280 :end
0 server package
1 ==============
2
3 Submodules
4 ----------
5
6 server.utils module
7 -------------------
8
9 .. automodule:: persistence.server.server
10 :members:
11 :undoc-members:
12 :show-inheritance:
00 #!/usr/bin/python2.7
11 # -*- coding: utf-8 -*-
2 '''
3 Faraday Penetration Test IDE
4 Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)
5 See the file 'doc/LICENSE' for the license information
6
7 '''
2
3 # Faraday Penetration Test IDE
4 # Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)
5 # See the file 'doc/LICENSE' for the license information
6
7
8 """A module to handle request to the Faraday Server.
9
10 Note:
11 Before using this as an API, you should copy this file and edit
12 the FARADAY_UP and the SERVER_URL variables found inmediatly
13 below the imports.
14
15 FARADAY_UP should be set to False in the copy of the file, and SERVER_URL
16 must be a valid server url.
17
18 Warning:
19 This module was though of primarly as a way of querying and removing
20 information from the Faraday Server. Adding objects is supported, but should
21 be used with care, specially regarding the ID of objects, which must
22 be always unique.
23 """
24
825 import requests
926 import json
1027 from persistence.server.utils import force_unique
292309
293310
294311 def get_hosts(workspace_name, **params):
295 """Given a workspace name and an arbitrary number of query params,
296 return a list a dictionaries containg information about hosts
297 matching the query
312 """Get hosts from the server.
313
314 Args:
315 workspace_name (str): the workspace from which to get the hosts.
316 **params: any of valid request parameters for CouchDB.
317
318 Returns:
319 A dictionary containing the hosts matching the query.
298320 """
299321 return _get_faraday_ready_dictionaries(workspace_name, 'hosts',
300322 'rows', **params)
301323
302324
303325 def get_all_vulns(workspace_name, **params):
304 """Given a workspace name and an arbitrary number of query params,
305 return a list a dictionaries containg information about vulns
306 matching the query
326 """Get vulns, both normal and web, from the server.
327
328 Args:
329 workspace_name (str): the workspace from which to get the vulns.
330 **params: any of valid request parameters for CouchDB.
331
332 Returns:
333 A dictionary containing the vulns matching the query.
307334 """
308335 return _get_faraday_ready_dictionaries(workspace_name, 'vulns',
309336 'vulnerabilities', **params)
310337
311338
312339 def get_vulns(workspace_name, **params):
313 """Given a workspace name and an arbitrary number of query params,
314 return a list a dictionaries containg information about not web vulns
315 matching the query
340 """Get only normal vulns from the server.
341
342 Args:
343 workspace_name (str): the workspace from which to get the vulns.
344 **params: any of valid request parameters for CouchDB.
345
346 Returns:
347 A dictionary containing the vulns matching the query.
316348 """
317349 return get_all_vulns(workspace_name, type='Vulnerability', **params)
318350
319351
320352 def get_web_vulns(workspace_name, **params):
321 """Given a workspace name and an arbitrary number of query params,
322 return a list a dictionaries containg information about web vulns
323 matching the query
353 """Get only web vulns from the server.
354
355 Args:
356 workspace_name (str): the workspace from which to get the vulns.
357 **params: any of valid request parameters for CouchDB.
358
359 Returns:
360 A dictionary containing the vulns matching the query.
324361 """
325362 return get_all_vulns(workspace_name, type="VulnerabilityWeb", **params)
326363
327364 def get_interfaces(workspace_name, **params):
328 """Given a workspace name and an arbitrary number of query params,
329 return a list a dictionaries containg information about interfaces
330 matching the query
365 """Get interfaces from the server.
366
367 Args:
368 workspace_name (str): the workspace from which to get the interfaces.
369 **params: any of valid request parameters for CouchDB.
370
371 Returns:
372 A dictionary containing the interfaces matching the query.
331373 """
332374 return _get_faraday_ready_dictionaries(workspace_name, 'interfaces',
333375 'interfaces', **params)
334376
335377 def get_services(workspace_name, **params):
336 """Given a workspace name and an arbitrary number of query params,
337 return a list a dictionaries containg information about services
338 matching the query
378 """Get services from the server.
379
380 Args:
381 workspace_name (str): the workspace from which to get the services.
382 **params: any of valid request parameters for CouchDB.
383
384 Returns:
385 A dictionary containing the services matching the query.
339386 """
340387 return _get_faraday_ready_dictionaries(workspace_name, 'services',
341388 'services', **params)
342389
343390 def get_credentials(workspace_name, **params):
344 """Given a workspace name and an arbitrary number of query params,
345 return a list a dictionaries containg information about credentials
346 matching the query
391 """Get credentials from the server.
392
393 Args:
394 workspace_name (str): the workspace from which to get the credentials.
395 **params: any of valid request parameters for CouchDB.
396
397 Returns:
398 A dictionary containing the credentials matching the query.
347399 """
348400 return _get_faraday_ready_dictionaries(workspace_name, 'credentials',
349401 'rows', **params)
350402
351403 def get_notes(workspace_name, **params):
352 """Given a workspace name and an arbitrary number of query params,
353 return a list a dictionaries containg information about notes
354 matching the query
404 """Get notes from the server.
405
406 Args:
407 workspace_name (str): the workspace from which to get the notes.
408 **params: any of valid request parameters for CouchDB.
409
410 Returns:
411 A dictionary containing the notes matching the query.
355412 """
356413 return _get_faraday_ready_dictionaries(workspace_name, 'notes',
357414 'rows', **params)
358415
359416 def get_commands(workspace_name, **params):
417 """Get commands from the server.
418
419 Args:
420 workspace_name (str): the workspace from which to get the commands.
421 **params: any of valid request parameters for CouchDB.
422
423 Returns:
424 A dictionary containing the commands matching the query.
425 """
360426 return _get_faraday_ready_dictionaries(workspace_name, 'commands',
361427 'commands', **params)
362428
363429 def get_objects(workspace_name, object_signature, **params):
364 """Given a workspace name, an object_signature as string and an arbitrary
365 number of query params, return a list a dictionaries containg information
366 about 'object_signature' objects matching the query.
367
368 object_signature must be either 'hosts', 'vulns', 'interfaces'
369 'services', 'credentials', 'notes' or 'commands'.
370 Will raise an WrongObjectSignature error if this condition is not met.
430 """Get any type of object from the server, be it hosts, vulns, interfaces,
431 services, credentials, commands or notes.
432
433 Args:
434 workspace_name (str): the workspace from which to get the commands.
435 object_signature (str): the type of object to get. Must equal 'hosts',
436 'vulns', 'interfaces', 'services', 'credentials', 'notes' or 'commands'
437 **params: any of valid request parameters for CouchDB.
438
439 Returns:
440 A dictionary containing the commands matching the query.
441
442 Raises:
443 WrongObjectSignature: if the object_signature string didn't match
444 a faraday object.
371445 """
372446 object_to_func = {'hosts': get_hosts,
373447 'vulns': get_vulns,
389463 heartbeat=heartbeat, **extra_params)
390464
391465 def get_workspaces_names():
392 """Return a json containing the list with the workspaces names."""
466 """Returns:
467 A dictionary with a list with the workspaces names."""
393468 return _get("{0}/ws".format(_create_server_api_url()))
394469
395470 # XXX: COUCH IT!
404479 # XXX: COUCH IT!
405480 # COUCH IT LEVEL: REVOLUTIONS
406481 def get_object_before_last_revision(workspace_name, object_id):
407 """Return a dictionary containing the object information before
408 its last revision (modification). Useful to get the attributes of
409 objects already deleted."""
482 """Get an object before its last revision. Useful to get information about
483 recently deleted objects.
484
485 Warning:
486 Error-pronce process. You should check for 'None' after usage,
487 as that's the return value if any problem arose during execution.
488
489 Args:
490 workspace_name (str): the workspace where the object was
491 object_id (str): the id of the object
492
493 Returns:
494 A dictionary with the object's information.
495 """
410496 get_url = _create_couch_get_url(workspace_name, object_id)
411497 response = _unsafe_io_with_server(requests.get, 200, get_url,
412498 params={'revs': 'true', 'open_revs': 'all'})
426512
427513
428514 def get_object(workspace_name, object_signature, object_id):
429 """Take a workspace_name, an object_signature and an object_id as strings,
430 return the dictionary containging the object of type object_signature
431 and matching object_id in the workspace workspace_name, or None if
432 no object matching object_id was found.
433
434 object_signature must be either 'hosts', 'vulns', 'interfaces'
435 'services', 'credentials', 'notes' or 'commands'.
436 Will raise an WrongObjectSignature error if this condition is not met.
437
438 Will raise a MoreThanOneObjectFoundByID error if for some reason
439 the object_id is shared by two or more objects in the workspace. This
440 should never happen.
515 """Get an unique object of arbitrary type.
516
517 Args:
518 workspace_name (str): the workspace where the object should be found.
519 object_signature (str): must be either 'hosts', 'vulns', 'interfaces'
520 'services', 'credentials', 'notes' or 'commands'.
521 object_id (str): the id of the object
522
523 Returns:
524 A dictionary containing information about the object.
525
526 Raises:
527 MoreThanOneObjectFoundByID: if for some reason the object_id is shared
528 by two or more objects. This should never happen. If it does,
529 contact Infobyte LCC.
441530 """
442531 objects = get_objects(workspace_name, object_signature, couchid=object_id)
443532 return force_unique(objects)
444533
445534 def get_host(workspace_name, host_id):
446 """Take a workspace name and host_id as strings. Return a dictionary
447 containing the host matching host_id on workspace workspace_name if found,
448 or None if no hosts were found.
449
450 Will raise a MoreThanOneObjectFoundByID error if for some reason
451 the host_id is shared by two or more hosts in the workspace. This
452 should never happen.
535 """Get an unique host.
536
537 Args:
538 workspace_name (str): the workspace where the object should be found.
539 host_id (str): the id of the host
540
541 Returns:
542 A dictionary containing information about the host.
543
544 Raises:
545 MoreThanOneObjectFoundByID: if for some reason the host id is shared
546 by two or more objects. This should never happen. If it does,
547 contact Infobyte LCC.
453548 """
454549 return force_unique(get_hosts(workspace_name, couchid=host_id))
455550
456551 def get_vuln(workspace_name, vuln_id):
457 """Take a workspace name and vuln_id as strings. Return a dictionary
458 containing the vuln matching vuln_id on workspace workspace_name if found,
459 or None if no vulns were found.
460
461 Will raise a MoreThanOneObjectFoundByID error if for some reason
462 the vuln_id is shared by two or more vulns in the workspace. This
463 should never happen.
552 """Get an unique vuln.
553
554 Args:
555 workspace_name (str): the workspace where the object should be found.
556 vuln_id (str): the id of the vuln
557
558 Returns:
559 A dictionary containing information about the vuln.
560
561 Raises:
562 MoreThanOneObjectFoundByID: if for some reason the vuln id is shared
563 by two or more objects. This should never happen. If it does,
564 contact Infobyte LCC.
464565 """
465566 return force_unique(get_vulns(workspace_name, couchid=vuln_id))
466567
467568 def get_web_vuln(workspace_name, vuln_id):
468 """Take a workspace name and vuln_id as strings. Return a dictionary
469 containing the web vuln matching vuln_id on workspace workspace_name if found,
470 or None if no web vulns were found.
471
472 Will raise a MoreThanOneObjectFoundByID error if for some reason
473 the vuln_id is shared by two or more web vulns in the workspace. This
474 should never happen.
569 """Get an unique web vuln.
570
571 Args:
572 workspace_name (str): the workspace where the object should be found.
573 web vuln_id (str): the id of the web vuln
574
575 Returns:
576 A dictionary containing information about the web vuln.
577
578 Raises:
579 MoreThanOneObjectFoundByID: if for some reason the web vuln id is shared
580 by two or more objects. This should never happen. If it does,
581 contact Infobyte LCC.
475582 """
476583 return force_unique(get_web_vulns(workspace_name, couchid=vuln_id))
477584
478585 def get_interface(workspace_name, interface_id):
479 """Take a workspace name and interface_id as strings. Return a dictionary
480 containing the interface matching interface_id on workspace workspace_name
481 if found, or None if no interfaces were found.
482
483 Will raise a MoreThanOneObjectFoundByID error if for some reason
484 the interface_id is shared by two or more interfaces in the workspace. This
485 should never happen.
586 """Get an unique interface.
587
588 Args:
589 workspace_name (str): the workspace where the object should be found.
590 interface_id (str): the id of the interface
591
592 Returns:
593 A dictionary containing information about the interface.
594
595 Raises:
596 MoreThanOneObjectFoundByID: if for some reason the interface id is shared
597 by two or more objects. This should never happen. If it does,
598 contact Infobyte LCC.
486599 """
487600 return force_unique(get_interfaces(workspace_name, couchid=interface_id))
488601
489602 def get_service(workspace_name, service_id):
490 """Take a workspace name and service_id as strings. Return a dictionary
491 containing the service matching service_id on workspace workspace_name if
492 found, or None if no services were found.
493
494 Will raise a MoreThanOneObjectFoundByID error if for some reason
495 the service_id is shared by two or more services in the workspace. This
496 should never happen.
603 """Get an unique service.
604
605 Args:
606 workspace_name (str): the workspace where the object should be found.
607 service_id (str): the id of the service
608
609 Returns:
610 A dictionary containing information about the service.
611
612 Raises:
613 MoreThanOneObjectFoundByID: if for some reason the service id is shared
614 by two or more objects. This should never happen. If it does,
615 contact Infobyte LCC.
497616 """
498617 return force_unique(get_services(workspace_name, couchid=service_id))
499618
500619 def get_note(workspace_name, note_id):
501 """Take a workspace name and note_id as strings. Return a dictionary
502 containing the note matching note_id on workspace workspace_name if found,
503 or None if no notes were found.
504
505 Will raise a MoreThanOneObjectFoundByID error if for some reason
506 the note_id is shared by two or more notes in the workspace. This
507 should never happen.
620 """Get an unique note.
621
622 Args:
623 workspace_name (str): the workspace where the object should be found.
624 note_id (str): the id of the note
625
626 Returns:
627 A dictionary containing information about the note.
628
629 Raises:
630 MoreThanOneObjectFoundByID: if for some reason the note id is shared
631 by two or more objects. This should never happen. If it does,
632 contact Infobyte LCC.
508633 """
509634 return force_unique(get_notes(workspace_name, couchid=note_id))
510635
511636 def get_credential(workspace_name, credential_id):
512 """Take a workspace name and credential_id as strings. Return a dictionary
513 containing the credential matching credential_id on workspace
514 workspace_name if found, or None if no credentials were found.
515
516 Will raise a MoreThanOneObjectFoundByID error if for some reason
517 the credential_id is shared by two or more credentials in the workspace.
518 This should never happen.
637 """Get an unique credential.
638
639 Args:
640 workspace_name (str): the workspace where the object should be found.
641 credential_id (str): the id of the credential
642
643 Returns:
644 A dictionary containing information about the credential.
645
646 Raises:
647 MoreThanOneObjectFoundByID: if for some reason the credential id is shared
648 by two or more objects. This should never happen. If it does,
649 contact Infobyte LCC.
519650 """
520651 return force_unique(get_services(workspace_name, couchid=credential_id))
521652
522653 def get_command(workspace_name, command_id):
654 """Get an unique command.
655
656 Args:
657 workspace_name (str): the workspace where the object should be found.
658 command_id (str): the id of the command
659
660 Returns:
661 A dictionary containing information about the command.
662
663 Raises:
664 MoreThanOneObjectFoundByID: if for some reason the command id is shared
665 by two or more objects. This should never happen. If it does,
666 contact Infobyte LCC.
667 """
523668 return force_unique(get_commands(workspace_name, couchid=command_id))
524669
525670 def get_workspace(workspace_name, **params):
526 """Take a workspace name as string. Return a dictionary
527 containing the workspace document on couch database with the same
528 workspace_name if found, or None if no db or document were found.
671 """Get an unique command.
672
673 Args:
674 command_name (str): the command where the object should be found.
675 command_id (str): the id of the command
676
677 Returns:
678 A dictionary containing information about the command.
679
680 Raises:
681 MoreThanOneObjectFoundByID: if for some reason the command id is shared
682 by two or more objects. This should never happen. If it does,
683 contact Infobyte LCC.
529684 """
530685 request_url = _create_server_get_url(workspace_name)
531686 return _get(request_url, **params)
532687
533688 def get_workspace_summary(workspace_name):
689 """Get a collection of data about the workspace.
690
691 Args:
692 workspace_name (str): the workspace to get the stats from.
693
694 Returns:
695 A dictionary with the workspace's information
696 """
534697 return _get_raw_workspace_summary(workspace_name)['stats']
535698
536699 def get_workspace_numbers(workspace_name):
537 """Returns a 4-uple of (host_amount, interface_amount, service_amount, vuln_amount)
538 inside of workspace workspace_name.
700 """Get the number of hosts, interfaces, services and vulns in the workspace.
701
702 Args:
703 workspace_name (str): the name of the workspace to query
704
705 Return:
706 A tuple of 4 elements with the amounts of hosts, interfaces, services and vulns.
539707 """
540708 stats = _get_raw_workspace_summary(workspace_name)['stats']
541709 return stats['hosts'], stats['interfaces'], stats['services'], stats['total_vulns']
542710
543711 def get_hosts_number(workspace_name, **params):
544 """Return the number of host found in workspace workspace_name"""
712 """
713 Args:
714 workspace_name (str): the name of the workspace to query
715 **params: any of the Couchdb request parameters
716
717 Returns:
718 The amount of hosts in the workspace as an integer.
719 """
545720 return int(get_workspace_summary(workspace_name)['hosts'])
546721
547722 def get_services_number(workspace_name, **params):
548 """Return the number of services found in workspace workspace_name"""
723 """
724 Args:
725 workspace_name (str): the name of the workspace to query
726 **params: any of the Couchdb request parameters
727
728 Returns:
729 The amount of services in the workspace as an integer.
730 """
549731 return int(get_workspace_summary(workspace_name)['interfaces'])
550732
551733 def get_interfaces_number(workspace_name, **params):
552 """Return the number of interfaces found in workspace workspace_name"""
734 """
735 Args:
736 workspace_name (str): the name of the workspace to query
737 **params: any of the Couchdb request parameters
738
739 Returns:
740 The amount of interfaces in the workspace as an integer.
741 """
553742 return int(get_workspace_summary(workspace_name)['interfaces'])
554743
555744 def get_vulns_number(workspace_name, **params):
556 """Return the number of vulns found in workspace workspace_name"""
745 """
746 Args:
747 workspace_name (str): the name of the workspace to query
748 **params: any of the Couchdb request parameters
749
750 Returns:
751 The amount of vulns in the workspace as an integer.
752 """
557753 return int(get_workspace_summary(workspace_name)['total_vulns'])
558754
559755 def get_notes_number(workspace_name, **params):
560 """Return the number of notes on workspace workspace_name."""
756 """
757 Args:
758 workspace_name (str): the name of the workspace to query
759 **params: any of the Couchdb request parameters
760
761 Returns:
762 The amount of notes in the workspace as an integer.
763 """
561764 return int(get_workspace_summary(workspace_name)['notes'])
562765
563766 def get_credentials_number(workspace_name, **params):
564 """Return the number of credential on workspace workspace_name."""
767 """
768 Args:
769 workspace_name (str): the name of the workspace to query
770 **params: any of the Couchdb request parameters
771
772 Returns:
773 The amount of credentials in the workspace as an integer.
774 """
565775 return int(_get_raw_credentials(workspace_name, **params))
566776
567777 def get_commands_number(workspace_name, **params):
568 """Return the number of commands on workspace workspace_name."""
778 """
779 Args:
780 workspace_name (str): the name of the workspace to query
781 **params: any of the Couchdb request parameters
782
783 Returns:
784 The amount of commands in the workspace as an integer.
785 """
569786 return int(_get_raw_commands(workspace_name, **params))
570787
571788 def create_host(workspace_name, id, name, os, default_gateway,
572789 description="", metadata=None, owned=False, owner="",
573790 parent=None):
574 """Save a host to the server. Return a dictionary with the server's
575 reponse.
791 """Create a host.
792
793 Args:
794 workspace_name (str): the name of the workspace where the host will be saved.
795 id (str): the id of the host. Must be unique.
796 name (str): the host's name
797 os (str): the operative system of the host
798 default_gateway (str): the host's default_gateway
799 description (str): a description.
800 metadata: a collection of metadata. If you don't know the metada. leave
801 on None.
802 owned (bool): is the host owned or not?
803 owner (str): an owner for the host
804 parent (Faraday Object): the host's parent. If you don't know this, leave
805 on None.
806
807 Returns:
808 A dictionary with the server's response.
576809 """
577810 return _save_to_server(workspace_name,
578811 id,
588821 def update_host(workspace_name, id, name, os, default_gateway,
589822 description="", metadata=None, owned=False, owner="",
590823 parent=None):
591 """Update an host in the server. Return a dictionary with the
592 server's response."""
824 """Updates a host.
825
826 Args:
827 workspace_name (str): the name of the workspace where the host will be saved.
828 id (str): the id of the host. Must be unique.
829 name (str): the host's name
830 os (str): the operative system of the host
831 default_gateway (str): the host's default_gateway
832 description (str): a description.
833 metadata: a collection of metadata. If you don't know the metada. leave
834 on None, it will be created automatically.
835 owned (bool): is the host owned or not?
836 owner (str): an owner for the host
837 parent (Faraday Object): the host's parent. If you don't know this, leave
838 on None.
839
840 Returns:
841 A dictionary with the server's response.
842 """
593843 return _update_in_server(workspace_name,
594844 id,
595845 name=name, os=os,
608858 def create_interface(workspace_name, id, name, description, mac,
609859 owned=False, owner="", hostnames=None, network_segment=None,
610860 ipv4=None, ipv6=None, metadata=None):
611 """Save an interface to the server. Return a dictionary with the
612 server's response."""
861 """Creates an interface.
862
863 Warning:
864 DO NOT leave ipv4 and ipv6 values on None, as the default indicated.
865 This is a known bug and we're working to fix it. ipv4 and ipv6 need to
866 be valid IP addresses, or, in case one of them is irrelevant, empty strings.
867
868 Args:
869 workspace_name (str): the name of the workspace where the interface will be saved.
870 id (str): the id of the interface. Must be unique.
871 name (str): the interface's name
872 description (str): a description.
873 mac (str) the mac address of the interface
874 owned (bool): is the host owned or not?
875 owner (str): an owner for the host
876 hostnames ([str]): a list of hostnames
877 network_segment (str): the network segment
878 ipv4 (str): the ipv4 direction of the interface.
879 ipv6 (str): the ipv6 direction of the interface.
880 metadata: a collection of metadata. If you don't know the metada. leave
881 on None, it will be created automatically.
882
883 Returns:
884 A dictionary with the server's response.
885 """
613886 return _save_to_server(workspace_name,
614887 id,
615888 name=name,
627900 def update_interface(workspace_name, id, name, description, mac,
628901 owned=False, owner="", hostnames=None, network_segment=None,
629902 ipv4=None, ipv6=None, metadata=None):
630 """Update an interface in the server. Return a dictionary with the
631 server's response."""
903 """Creates an interface.
904
905 Warning:
906 DO NOT leave ipv4 and ipv6 values on None, as the default indicated.
907 This is a known bug and we're working to fix it. ipv4 and ipv6 need to
908 be valid IP addresses, or, in case one of them is irrelevant, empty strings.
909
910 Args:
911 workspace_name (str): the name of the workspace where the interface will be saved.
912 id (str): the id of the interface. Must be unique.
913 name (str): the interface's name
914 description (str): a description.
915 mac (str) the mac address of the interface
916 owned (bool): is the host owned or not?
917 owner (str): an owner for the host
918 hostnames ([str]): a list of hostnames
919 network_segment (str): the network segment
920 ipv4 (str): the ipv4 direction of the interface.
921 ipv6 (str): the ipv6 direction of the interface.
922 metadata: a collection of metadata. If you don't know the metada. leave
923 on None, it will be created automatically.
924
925 Returns:
926 A dictionary with the server's response.
927 """
632928 return _update_in_server(workspace_name,
633929 id,
634930 name=name,
646942 def create_service(workspace_name, id, name, description, ports,
647943 owned=False, owner="", protocol="", status="", version="",
648944 metadata=None):
649 """Save a service to the server. Return a dictionary with the
650 server's response."""
945 """Creates a service.
946
947 Args:
948 workspace_name (str): the name of the workspace where the service will be saved.
949 id (str): the id of the service. Must be unique.
950 name (str): the host's name
951 description (str): a description.
952 ports ([str]): a list of ports for the service.
953 owned (bool): is the service owned or not?
954 owner (str): an owner for the service
955 protocol (str): the service's protocol
956 status (str): the service's status
957 version (str): the service's version
958 metadata: a collection of metadata. If you don't know the metada. leave
959 on None, it will be created automatically.
960
961 Returns:
962 A dictionary with the server's response.
963 """
651964 return _save_to_server(workspace_name,
652965 id,
653966 name=name,
664977 def update_service(workspace_name, id, name, description, ports,
665978 owned=False, owner="", protocol="", status="", version="",
666979 metadata=None):
667 """Update a service in the server. Return a dictionary with the
668 server's response."""
980 """Creates a service.
981
982 Args:
983 workspace_name (str): the name of the workspace where the service will be saved.
984 id (str): the id of the service. Must be unique.
985 name (str): the service's name
986 description (str): a description.
987 ports ([str]): a list of ports for the service.
988 owned (bool): is the host owned or not?
989 owner (str): an owner for the service
990 protocol (str): the service's protocol
991 status (str): the service's status
992 version (str): the service's version
993 metadata: a collection of metadata. If you don't know the metada. leave
994 on None, it will be created automatically.
995
996 Returns:
997 A dictionary with the server's response.
998 """
669999 return _update_in_server(workspace_name,
6701000 id,
6711001 name=name,
6831013 def create_vuln(workspace_name, id, name, description, owned=None, owner="",
6841014 confirmed=False, data="", refs=None, severity="info", resolution="",
6851015 desc="", metadata=None, status=None):
686 """Save a vulnerability to the server. Return the json with the
687 server's response.
1016 """Creates a vuln.
1017
1018 Args:
1019 workspace_name (str): the name of the workspace where the vuln will be saved.
1020 id (str): the id of the vuln. Must be unique.
1021 name (str): the vuln's name
1022 description (str): a description.
1023 owned (bool): is the vuln owned or not?
1024 owner (str): an owner for the vuln
1025 confirmed (bool): is the vulnerability confirmed?
1026 data (str): any aditional data about the vuln
1027 refs ([str]): references for the vulnerability
1028 severity (str): a string indicating the vuln's severity. can be 'info',
1029 'low', 'med', 'high', 'critical'
1030 resolution (str): the vuln's possible resolution
1031 desc (str): a vuln's description.
1032 status (str): the service's status
1033 metadata: a collection of metadata. If you don't know the metada. leave
1034 on None, it will be created automatically.
1035
1036 Returns:
1037 A dictionary with the server's response.
6881038 """
6891039 return _save_to_server(workspace_name,
6901040 id,
7051055 def update_vuln(workspace_name, id, name, description, owned=None, owner="",
7061056 confirmed=False, data="", refs=None, severity="info", resolution="",
7071057 desc="", metadata=None, status=None):
708 """Update a vulnerability in the server. Return the json with the
709 server's response.
1058 """Updates a vuln.
1059
1060 Args:
1061 workspace_name (str): the name of the workspace where the host will be saved.
1062 id (str): the id of the host. Must be unique.
1063 name (str): the host's name
1064 description (str): a description.
1065 owned (bool): is the vuln owned or not?
1066 owner (str): an owner for the vuln
1067 confirmed (bool): is the vulnerability confirmed?
1068 data (str): any aditional data about the vuln
1069 refs ([str]): references for the vulnerability
1070 severity (str): a string indicating the vuln's severity. can be 'info',
1071 'low', 'med', 'high', 'critical'
1072 resolution (str): the vuln's possible resolution
1073 desc (str): a vuln's description.
1074 status (str): the service's status
1075 metadata: a collection of metadata. If you don't know the metada. leave
1076 on None, it will be created automatically.
1077
1078 Returns:
1079 A dictionary with the server's response.
7101080 """
7111081 return _update_in_server(workspace_name,
7121082 id,
7291099 desc="", metadata=None, method=None, params="", path=None, pname=None,
7301100 query=None, request=None, response=None, category="", website=None,
7311101 status=None):
732 """Save a web vulnerability to the server. Return the json with the
733 server's response.
1102 """Creates a vuln web.
1103
1104 Args:
1105 workspace_name (str): the name of the workspace where the vuln web will be saved.
1106 id (str): the id of the vuln web. Must be unique.
1107 name (str): the vuln web's name
1108 description (str): a description.
1109 owner (str): an owner for the host
1110 confirmed (bool): is the vulnerability confirmed?
1111 data (str): any aditional data about the vuln
1112 refs ([str]): references for the vulnerability
1113 severity (str): a string indicating the vuln's severity. can be 'info',
1114 'low', 'med', 'high', 'critical'
1115 resolution (str): the vuln's possible resolution
1116 desc (str): a vuln's description.
1117 metadata: a collection of metadata. If you don't know the metada. leave
1118 on None, it will be created automatically.
1119 method (str): the web vuln method
1120 params (str): the parameters for the web vuln
1121 path (str): the web vuln's path
1122 query (str): the web vuln's query
1123 request (str): the web vuln's request
1124 response (str): the web vuln's response
1125 category (str): a category for the web vuln's
1126 website (str): the website where the vuln was found
1127 status (str): the web vulns's status
1128
1129 Returns:
1130 A dictionary with the server's response.
7341131 """
7351132 return _save_to_server(workspace_name,
7361133 id,
7621159 desc="", metadata=None, method=None, params="", path=None, pname=None,
7631160 query=None, request=None, response=None, category="", website=None,
7641161 status=None):
765 """Update a web vulnerability in the server. Return the json with the
766 server's response.
1162 """Creates a vuln web.
1163
1164 Args:
1165 workspace_name (str): the name of the workspace where the vuln web will be saved.
1166 id (str): the id of the vuln web. Must be unique.
1167 name (str): the vuln web's name
1168 description (str): a description.
1169 owner (str): an owner for the host
1170 confirmed (bool): is the vulnerability confirmed?
1171 data (str): any aditional data about the vuln
1172 refs ([str]): references for the vulnerability
1173 severity (str): a string indicating the vuln's severity. can be 'info',
1174 'low', 'med', 'high', 'critical'
1175 resolution (str): the vuln's possible resolution
1176 desc (str): a vuln's description.
1177 metadata: a collection of metadata. If you don't know the metada. leave
1178 on None, it will be created automatically.
1179 method (str): the web vuln method
1180 params (str): the parameters for the web vuln
1181 path (str): the web vuln's path
1182 query (str): the web vuln's query
1183 request (str): the web vuln's request
1184 response (str): the web vuln's response
1185 category (str): a category for the web vuln's
1186 website (str): the website where the vuln was found
1187 status (str): the web vulns's status
1188
1189 Returns:
1190 A dictionary with the server's response.
7671191 """
7681192 return _update_in_server(workspace_name,
7691193 id,
7921216
7931217 def create_note(workspace_name, id, name, text, owned=None, owner="",
7941218 description="", metadata=None):
795 """Save a note to the server. Return the json with the
796 server's response.
1219 """Creates a note.
1220
1221 Args:
1222 workspace_name (str): the name of the workspace where the vuln web will be saved.
1223 id (str): the id of the vuln web. Must be unique.
1224 name (str): the vuln web's name
1225 text (str): the note's text
1226 owned (bool): is the note owned?
1227 owner (str): the note's owner
1228 description (str): a description
1229 metadata: a collection of metadata. If you don't know the metada. leave
1230 on None, it will be created automatically.
1231
1232 Returns:
1233 A dictionary with the server's response.
7971234 """
7981235 return _save_to_server(workspace_name,
7991236 id,
8071244
8081245 def update_note(workspace_name, id, name, text, owned=None, owner="",
8091246 description="", metadata=None):
810 """Update a note in the server. Return the json with the
811 server's response.
1247 """Updates a note.
1248
1249 Args:
1250 workspace_name (str): the name of the workspace where the vuln web will be saved.
1251 id (str): the id of the vuln web. Must be unique.
1252 name (str): the vuln web's name
1253 text (str): the note's text
1254 owned (bool): is the note owned?
1255 owner (str): the note's owner
1256 description (str): a description
1257 metadata: a collection of metadata. If you don't know the metada. leave
1258 on None, it will be created automatically.
1259
1260 Returns:
1261 A dictionary with the server's response.
8121262 """
8131263 return _update_in_server(workspace_name,
8141264 id,
8231273
8241274 def create_credential(workspace_name, id, name, username, password,
8251275 owned=None, owner="", description="", metadata=None):
826 """Save a credential to the server. Return the json with the
827 server's response.
1276 """Creates a credential.
1277
1278 Args:
1279 workspace_name (str): the name of the workspace where the vuln web will be saved.
1280 id (str): the id of the vuln web. Must be unique.
1281 name (str): the vuln web's name
1282 username (str)
1283 password (str)
1284 owned (bool): is the note owned?
1285 owner (str): the note's owner
1286 description (str): a description
1287 metadata: a collection of metadata. If you don't know the metada. leave
1288 on None, it will be created automatically.
1289
1290 Returns:
1291 A dictionary with the server's response.
8281292 """
8291293 return _save_to_server(workspace_name,
8301294 id,
8391303
8401304 def update_credential(workspace_name, id, name, username, password,
8411305 owned=None, owner="", description="", metadata=None):
842 """Update a credential in the server. Return the json with the
843 server's response.
1306 """Updates a credential.
1307
1308 Args:
1309 workspace_name (str): the name of the workspace where the vuln web will be saved.
1310 id (str): the id of the vuln web. Must be unique.
1311 name (str): the vuln web's name
1312 username (str)
1313 password (str)
1314 owned (bool): is the note owned?
1315 owner (str): the note's owner
1316 description (str): a description
1317 metadata: a collection of metadata. If you don't know the metada. leave
1318 on None, it will be created automatically.
1319
1320 Returns:
1321 A dictionary with the server's response.
8441322 """
8451323 return _update_in_server(workspace_name,
8461324 id,
8551333
8561334 def create_command(workspace_name, id, command, duration=None, hostname=None,
8571335 ip=None, itime=None, params=None, user=None):
858 """Create a command in the server. Return the json with the
859 server's response.
1336 """Creates a command.
1337
1338 Args:
1339 workspace_name (str): the name of the workspace where the vuln web will be saved.
1340 id (str): the id of the vuln web. Must be unique.
1341 command (str): the command to be created
1342 duration (str). the command's duration
1343 hostname (str): the hostname where the command was executed
1344 ip (str): the ip of the host where the command was executed
1345 itime (str): the time it took to run
1346 params (str): the parameters given
1347 user (str): the user that ran the command
1348
1349 Returns:
1350 A dictionary with the server's response.
8601351 """
8611352 return _save_to_server(workspace_name,
8621353 id,
8721363
8731364 def update_command(workspace_name, id, command, duration=None, hostname=None,
8741365 ip=None, itime=None, params=None, user=None):
875 """Update a command in the server. Return the json with the
876 server's response.
1366 """Updates a command.
1367
1368 Args:
1369 workspace_name (str): the name of the workspace where the vuln web will be saved.
1370 id (str): the id of the vuln web. Must be unique.
1371 command (str): the command to be created
1372 duration (str). the command's duration
1373 hostname (str): the hostname where the command was executed
1374 ip (str): the ip of the host where the command was executed
1375 itime (str): the time it took to run
1376 params (str): the parameters given
1377 user (str): the user that ran the command
1378
1379 Returns:
1380 A dictionary with the server's response.
8771381 """
8781382 return _update_in_server(workspace_name,
8791383 id,
8901394
8911395 def create_workspace(workspace_name, description, start_date, finish_date,
8921396 customer=None):
893 """Create a workspace in the server. Return the json with the
894 server's response.
1397 """Create a workspace.
1398
1399 Args:
1400 workspace_name (str): the workspace's name
1401 description (str): a description for the worksapce
1402 start_date (str): a date to represent when work began in the workspace
1403 finish_date (str): a date to represent when work will be finished on the workspace
1404 customer (str): the customer for which we are creating the workspace
1405
1406 Returns:
1407 A dictionary with the server's response.
8951408 """
8961409 return _save_db_to_server(workspace_name,
8971410 name=workspace_name,
191191
192192 vuln_obj = model.common.factory.createModelObject(
193193 Vuln.class_signature,
194 name, desc=desc, ref=ref, severity=severity, resolution=resolution,
194 name, desc=desc, refs=ref, severity=severity, resolution=resolution,
195195 confirmed=False, parent_id=host_id)
196196
197197 vuln_obj._metadata.creator = self.id
204204
205205 vuln_obj = model.common.factory.createModelObject(
206206 Vuln.class_signature,
207 name, desc=desc, ref=ref, severity=severity, resolution=resolution,
207 name, desc=desc, refs=ref, severity=severity, resolution=resolution,
208208 confirmed=False, parent_id=interface_id)
209209
210210 vuln_obj._metadata.creator = self.id
216216
217217 vuln_obj = model.common.factory.createModelObject(
218218 Vuln.class_signature,
219 name, desc=desc, ref=ref, severity=severity, resolution=resolution,
219 name, desc=desc, refs=ref, severity=severity, resolution=resolution,
220220 confirmed=False, parent_id=service_id)
221221
222222 vuln_obj._metadata.creator = self.id
228228 website="", path="", request="",
229229 response="", method="", pname="",
230230 params="", query="", category=""):
231
232231 vulnweb_obj = model.common.factory.createModelObject(
233232 VulnWeb.class_signature,
234 name, desc=desc, ref=ref, severity=severity, resolution=resolution,
233 name, desc=desc, refs=ref, severity=severity, resolution=resolution,
235234 website=website, path=path, request=request, response=response,
236235 method=method, pname=pname, params=params, query=query,
237236 category=category, confirmed=False, parent_id=service_id)
0 '''
1 Faraday Penetration Test IDE
2 Copyright (C) 2017 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 #!/usr/bin/env python
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE
5 Copyright (C) 2017 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7 '''
8
9 import pprint
10 from plugins import core
11 from lxml import objectify
12 from urlparse import urlparse
13
14 __author__ = "Alejando Parodi, Ezequiel Tavella"
15 __copyright__ = "Copyright (c) 2015, Infobyte LLC"
16 __credits__ = ["Alejando Parodi", "Ezequiel Tavella"]
17 __license__ = ""
18 __version__ = "1.0"
19 __maintainer__ = "Ezequiel Tavella"
20 __status__ = "Development"
21
22
23 def get_ip(domain):
24 try:
25 data = socket.gethostbyname_ex(domain)
26 ip = repr(data[2])
27 return ip
28 except Exception:
29 return domain
30
31
32 def cleaner_unicode(string):
33 if string is not None:
34 return string.encode('ascii', errors='backslashreplace')
35 else:
36 return string
37
38
39 class AppscanParser():
40
41 def __init__(self, output):
42 self.issue_list = []
43 self.obj_xml = objectify.fromstring(output)
44
45 def parse_issues(self):
46
47 for issue in self.obj_xml["issue-type-group"]["item"]:
48 url_list = []
49 obj_issue = {}
50
51 obj_issue["name"] = issue["name"].text
52 obj_issue['advisory'] = issue["advisory"]["ref"].text
53
54 if(issue["cve"]):
55 obj_issue['cve'] = issue["cve"].text
56
57 for threat in self.obj_xml["url-group"]["item"]:
58 if threat["issue-type"] == issue["fix-recommendation"]["ref"]:
59
60 url_list.append(threat['name'].text)
61
62 obj_issue['urls'] = url_list
63
64 for item in self.obj_xml["issue-group"]["item"]:
65
66 if int(item["url"]["ref"]) == int(threat.get('id')):
67 if item["issue-type"]["ref"] == threat['issue-type']:
68
69 http_traffic = item["variant-group"]["item"]["test-http-traffic"].text.split("\n\n")
70
71 obj_issue["request"] = http_traffic[0]
72 obj_issue["response"] = http_traffic[1]
73
74 if(issue["threat-class"]["ref"] == item["threat-class"]["ref"]):
75
76 obj_issue["severity"] = item["severity"].text
77 obj_issue["cvss_score"] = item["cvss-score"].text
78 obj_issue["issue_description"] = item["variant-group"]["item"]["issue-information"]["issue-tip"].text
79 break
80
81 for recomendation in self.obj_xml["fix-recommendation-group"]["item"]:
82 full_data = ""
83 if(recomendation.attrib['id'] == issue["fix-recommendation"]["ref"]):
84 for data in recomendation['general']['fixRecommendation']["text"]:
85 full_data += '' + data
86 obj_issue["recomendation"] = full_data
87 if(hasattr(recomendation['general']['fixRecommendation'], 'link')):
88 obj_issue["ref_link"] = recomendation['general']['fixRecommendation']['link'].text
89
90 self.issue_list.append(obj_issue)
91
92 return self.issue_list
93
94 def get_scan_information(self):
95
96 scan_information = "File: " + self.obj_xml["scan-information"]["scan-file-name"]\
97 + "\nStart: " + self.obj_xml["scan-information"]["scan-date-and-time"]\
98 + "\nSoftware: " + self.obj_xml["scan-information"]["product-name"]\
99 + "\nVersion: " + self.obj_xml["scan-information"]["product-version"]\
100 + "\nScanner Elapsed time: " + self.obj_xml["scan-summary"]["scan-Duration"]
101
102 return scan_information
103
104
105 class AppscanPlugin(core.PluginBase):
106 """ Example plugin to parse Appscan XML report"""
107
108 def __init__(self):
109 core.PluginBase.__init__(self)
110 self.id = "Appscan"
111 self.name = "Appscan XML Plugin"
112 self.plugin_version = "0.0.1"
113 self.options = None
114
115 def parseOutputString(self, output, debug=False):
116
117 parser = AppscanParser(output)
118 issues = parser.parse_issues()
119 for issue in issues:
120
121 if "urls" not in issue:
122 continue
123
124 for url in issue["urls"]:
125
126 url_parsed = urlparse(url)
127
128 # Get domain of URL.
129 if url_parsed.netloc:
130 hostname = url_parsed.netloc
131 ip = get_ip(url_parsed.netloc)
132 elif url_parsed.path:
133 hostname = url_parsed.path
134 ip = get_ip(url_parsed.path)
135
136 host_id = self.createAndAddHost(ip)
137 interface_id = self.createAndAddInterface(
138 host_id,
139 ip,
140 ipv4_address=ip,
141 hostname_resolution=[hostname])
142
143 service_id = self.createAndAddServiceToInterface(
144 host_id,
145 interface_id,
146 "HTTP Server",
147 protocol="tcp?HTTP")
148
149 refs = []
150 if "ref_link" in issue:
151 refs.append("Fix link: " + issue["ref_link"])
152 if "cvss_score" in issue:
153 refs.append("CVSS Score: " + issue["cvss_score"])
154 if "cve" in issue:
155 refs.append("CVE: " + issue["cve"])
156 if "advisory" in issue:
157 refs.append("Advisory: " + issue["advisory"])
158
159 self.createAndAddVulnWebToService(
160 host_id,
161 service_id,
162 cleaner_unicode(issue["name"]),
163 cleaner_unicode(issue["issue_description"]) if "issue_description" in issue else "",
164 ref=refs,
165 severity=issue["severity"],
166 resolution=cleaner_unicode(issue["recomendation"]),
167 website=hostname,
168 path=url_parsed.path,
169 request=cleaner_unicode(issue["request"]) if "request" in issue else "",
170 response=cleaner_unicode(issue["response"]) if "response" in issue else "",
171 method=issue["request"][0:3] if "request" in issue else "")
172
173 return
174
175 def processCommandString(self, username, current_path, command_string):
176 return
177
178
179 def createPlugin():
180 return AppscanPlugin()
55 ###
66 #__author__ = "Francisco Amato"
77 #__copyright__ = "Copyright (c) 2014, Infobyte LLC"
8 #__credits__ = ["Francisco Amato"]
9 #__version__ = "1.2.0"
8 #__credits__ = ["Francisco Amato", "Micaela Ranea Sanchez"]
9 #__version__ = "1.3.0"
1010 #__maintainer__ = "Francisco Amato"
1111 #__email__ = "[email protected]"
1212 #__status__ = "Development"
1616 require "pp"
1717
1818
19 PLUGINVERSION="Faraday v1.2 Ruby"
19 PLUGINVERSION="Faraday v1.3 Ruby"
2020 #Tested: Burp Professional v1.6.09
2121
2222 XMLRPC::Config.module_eval do
224224 severity="Information"
225225 desc="This request was manually sent using burp"
226226 else
227 desc=issue.getIssueDetail().to_s
228 desc+="<br/>Resolution:" + issue.getIssueBackground().to_s
229 severity=issue.getSeverity().to_s
230 issuename=issue.getIssueName().to_s
231 resolution=issue.getRemediationBackground().to_s
227 desc = issue.getIssueDetail().to_s.empty? ? "" : "Detail\n" + issue.getIssueDetail().to_s
228 background = issue.getIssueBackground().to_s
229 if !background.empty?
230 desc.concat("Background\n").concat(background)
231 end
232 severity = issue.getSeverity().to_s
233 issuename = issue.getIssueName().to_s
234 resolution = issue.getRemediationBackground().to_s
235
236 desc = desc.gsub(/<(\/p|br\/|\/li|ul|ol)>/, "\n").gsub(/<li>/, "* ").gsub(/<\/?[^>]*>/, "")
237 resolution = resolution.gsub(/<(\/p|br\/|\/li)>/, "\n").gsub(/<li>/, "* ").gsub(/<\/?[^>]*>/, "")
232238 end
233239
234240 @stdout.println("New scan issue host: " +host +",name:"+ issuename +",IP:" + ip)
255261
256262 #Menu action
257263 if ctx == 5 or ctx == 6 or ctx == 2
258 req = @helpers.analyzeRequest(issue.getRequest())
259
260 param = getParam(req)
261 issuename += "("+issue.getUrl().getPath()[0,20]+")"
262 path = issue.getUrl().to_s
263 request = issue.getRequest().to_s
264 method = req.getMethod().to_s
265
264 req = @helpers.analyzeRequest(issue.getRequest())
265
266 param = getParam(req)
267 issuename += "("+issue.getUrl().getPath()[0,20]+")"
268 path = issue.getUrl().to_s
269 request = issue.getRequest().to_s
270 method = req.getMethod().to_s
266271 else #Scan event or Menu scan tab
267 unless issue.getHttpMessages().nil? #issues with request #IHttpRequestResponse
268 c = 0
269 issue.getHttpMessages().each do |m|
270 if c == 0
271 req = @helpers.analyzeRequest(m.getRequest())
272 path = m.getUrl().to_s
273 request = m.getRequest().to_s
274 method = req.getMethod().to_s
275
276 param = getParam(req)
277 else
278 desc += "<br/>Request (" + c.to_s + "): " + m.getUrl().to_s
279 end
280
281 c = c + 1
282 end
283
284 if c == 0
285 path = issue.getUrl().to_s
286 end
287
288 end
272 unless issue.getHttpMessages().nil? #issues with request #IHttpRequestResponse
273 c = 0
274 issue.getHttpMessages().each do |m|
275 if c == 0
276 req = @helpers.analyzeRequest(m.getRequest())
277 path = m.getUrl().to_s
278 request = m.getRequest().to_s
279 method = req.getMethod().to_s
280 response = m.getResponse().to_s
281
282 param = getParam(req)
283 else
284 desc += "Request (" + c.to_s + "): " + m.getUrl().to_s
285 end
286
287 c = c + 1
288 end
289
290 if c == 0
291 path = issue.getUrl().to_s
292 end
293 end
289294 end
290295
291296 #createAndAddVulnWebToService(host_id, service_id, name, desc, ref, severity, resolution, website, path, request, response,method,pname, params,query,category):
367372 end
368373 end
369374
370
371375 end
9797
9898 host_id = self.createAndAddHost(ip)
9999 iface_id = self.createAndAddInterface(host_id, ip, ipv4_address = ip)
100 serv_id = self.createAndAddServiceToInterface(host_id, iface_id, proto, protocol = proto, ports = puerto, status = status)
100 serv_id = self.createAndAddServiceToInterface(host_id, iface_id, proto, protocol = proto, ports =[puerto], status = status)
101101
102102 if len(self.text) > 0:
103103 self.createAndAddNoteToService(host_id, serv_id, 'Url Fuzzing', self.text)
0 '''
1 Faraday Penetration Test IDE
2 Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/)
3 See the file 'doc/LICENSE' for the license information
4
5 '''
0 #!/usr/bin/python2.7
1 # -*- coding: utf-8 -*-
2
3 '''
4 Faraday Penetration Test IDE
5 Copyright (C) 2017 Infobyte LLC (http://www.infobytesec.com/)
6 See the file 'doc/LICENSE' for the license information
7 '''
8
9 from plugins import core
10 import re
11
12 __author__ = "Roberto Focke"
13 __copyright__ = "Copyright (c) 2017, Infobyte LLC"
14 __license__ = ""
15 __version__ = "1.0.0"
16
17
18 class hping3 (core.PluginBase):
19
20 def __init__(self):
21
22 core.PluginBase.__init__(self)
23 self.id = "Hping3"
24 self.name = "hping3"
25 self.plugin_version = "0.0.1"
26 self.version = "1.0.0"
27 self.srv = {'21': ' ftp', '80': 'http', '143': 'imap', '1433': 'mssql',
28 '3306': 'mysql', '524': 'ncp', '119': 'nntp',
29 '5631': 'pcanywhere', '110': 'pop3', '5432': 'postgres',
30 '512': 'rexec', '513': 'rlogin', '514': 'rsh',
31 '25': 'smtp', '161': 'snmp', '22': 'ssh', '3690': 'svn',
32 '23': 'telnet', '5900': 'vnc'}
33
34 self._command_regex = re.compile(r'^(sudo hping3|hping3)\s+.*$')
35
36 def parseOutputString(self, output, debug=False):
37
38 regex_ipv4 = re.search(r"(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\)\:", output)
39 if regex_ipv4:
40 ip_address = regex_ipv4.group(0).rstrip("):") # Regex pls
41 else:
42 # Exit plugin, ip address not found. bad output
43 self.log("Abort plugin: Ip address not found", "INFO")
44 return
45
46 hostname = output.split(" ")[1]
47 host_id = self.createAndAddHost(hostname)
48
49 i_id = self.createAndAddInterface(
50 host_id, ip_address, ipv4_address=ip_address, hostname_resolution=hostname)
51
52 if re.match("HPING", output):
53
54 sport = re.search(r"sport=(\d{1,6})", output)
55 ssport = [sport.group(1)]
56 reci = re.search(r"flags=(\w{2,3})", output)
57 service = self.srv[sport.group(1)]
58
59 if reci.group(1) == "SA":
60 s_id = self.createAndAddServiceToInterface(
61 host_id, i_id, service, protocol="tcp", ports=ssport, status="open")
62
63 lineas = output.split("\n")
64
65 for linea in lineas:
66 if (re.match(" ", linea)):
67
68 list = re.findall("\w+", linea)
69 service = list[1]
70 port = [list[0]]
71
72 if list[2] == "S" and list[3] == "A":
73 s_id = self.createAndAddServiceToInterface(
74 host_id, i_id, service, protocol="tcp", ports=port, status="open")
75
76 def processCommandString(self, username, current_path, command_string):
77 return None
78
79
80 def createPlugin():
81 return hping3()
333333 old_hostname = "unknown"
334334
335335 host_id = self.createAndAddHost(
336 name=host.ip,
337 old_hostname=old_hostname)
336 name=host.ip)
338337
339338 # Create interface
340339 try:
5353 host = self.createAndAddHost(address)
5454 iface = self.createAndAddInterface(
5555 host, address, ipv4_address=address)
56 service = self.createAndAddServiceToInterface(
57 host, iface, "http", protocol="tcp", ports=80
58 )
56 service = self.createAndAddServiceToInterface(host, iface, "http", protocol="tcp", ports=[80])
5957 self.createAndAddNoteToService(
6058 host,
6159 service,
5656 h_id, host, ipv4_address=host)
5757 s_id = self.createAndAddServiceToInterface(h_id, i_id, str(self._port),
5858 "tcp",
59 ports=[
60 self._port],
59 ports=[self._port],
6160 status="open",
6261 version="",
6362 description="")
217217 web = False
218218 s_id = self.createAndAddServiceToInterface(h_id, i_id, 'unknown',
219219 v.protocol.lower(),
220 ports=[
221 str(v.port)],
220 ports=[str(v.port)],
222221 status="open")
223222
224223 if v.port in ['80', '443'] or re.search("ssl|http", v.name.lower()):
5353 if self.getSetting("Api_key") == "":
5454 self.log("Please set Sentinel API in plugin configuration", "ERROR")
5555 return True
56
56
5757 allVulns = self.getAllVulns()
5858 for element in allVulns['collection']:
5959
6161 severity = element.get('severity', "INFO")
6262 host = element.get('url', 'Unknown Hostname')
6363
64 hostId = self.faraday_api.createAndAddHost(host, "", "", False, "")
64 hostId = self.faraday_api.createAndAddHost(host, "")
6565
6666 interfaceId = self.faraday_api.createAndAddInterface(
6767 hostId,
7777 vulnData = self.getAttackVector(element.get('href', 'unknown'))
7878
7979 for vuln in vulnData['collection']:
80
80
8181 vuln_information = self.getVulnInformation(element.get('href', 'unknown'))
82
82
8383 desc = vuln_information.get("description", "").get("description_prepend", "")
8484 solution = vuln_information.get("solution", "").get("solution_prepend", "")
8585 siteId = vuln_information.get("site", "Unknown")
4444 self.filepath = skipfish_filepath
4545
4646 tmp = open(skipfish_filepath + "/samples.js", "r").read()
47 issues = json.loads(
48 self.extract_data(
49 tmp,
50 "var issue_samples =", "];",
51 lambda x: x.replace("'", '"'),
52 False,
53 False)
54 [1] + "]")
47 data = self.extract_data(
48 tmp,
49 "var issue_samples =", "];",
50 lambda x: x.replace("'", '"'),
51 False,
52 False)
53 # Escape characters not allowed in JSON, repr fix this with double Escape
54 # Also remove \n character and space for have a valid JSON.
55 issues = json.loads(repr(data[1]).replace("\\n"," ").replace("'","") + "]")
5556
5657 tmp = open(skipfish_filepath + "/index.html", "r").read()
5758 err_msg = json.loads(
4343 iface = self.createAndAddInterface(
4444 host, address, ipv4_address=address)
4545 service = self.createAndAddServiceToInterface(
46 host, iface, "ssh", protocol="tcp", ports=22
46 host, iface, "ssh", protocol="tcp", ports=[22]
4747 )
4848 username, password = credentials.split(":")
4949 cred = self.createAndAddCredToService(
7878 for e in sp:
7979 if 'Title:' in e:
8080 if 'WordPress version' in e:
81 r = re.search(r'WordPress version ([\d\.]+) identified', e) #get wordpress version
81 r = re.search(r'WordPress version (\d.\w)', e) #get wordpress version
8282 self.wpversion = r.group(1)
8383
8484 elif 'wp-content/themes/' in e:
137137 hostname_resolution=base_url)
138138
139139 service_id = self.createAndAddServiceToInterface(host_id, interface_id,
140 service, "tcp", ports = port)
140 service, "tcp", ports = [port])
141141
142142 potential_vulns = re.findall(r"(\[\!\].*)", output)
143143 for potential_vuln in potential_vulns:
163163 protocol) from a given string. In case more than one URL is found,
164164 return the service and base_url of the first one, ignore others.
165165 """
166 search_url = re.search(r"\[\+\](.*?)URL: (https?)://(.*?)/", output)
166 search_url = re.search(r"URL: ((http[s]?)\:\/\/([\w\.]+)[.\S]+)", output)
167167 service, base_url = search_url.group(2), search_url.group(3)
168168 return service, base_url
169169
55
66 from server.app import app
77 from server.utils.logger import get_logger
8 from server.utils.web import gzipped, validate_workspace, filter_request_args
8 from server.utils.web import gzipped, validate_workspace, filter_request_args, get_integer_parameter
99 from server.dao.command import CommandDAO
1010
1111 @gzipped
1515 get_logger(__name__).debug(
1616 "Request parameters: {!r}".format(flask.request.args))
1717
18 commands_filter = filter_request_args()
18 page = get_integer_parameter('page', default=0)
19 page_size = get_integer_parameter('page_size', default=0)
20
21 commands_filter = filter_request_args(
22 'page', 'page_size')
1923
2024 dao = CommandDAO(workspace)
2125
22 result = dao.list(command_filter=commands_filter)
26 result = dao.list(
27 page=page,
28 page_size=page_size,
29 command_filter=commands_filter)
2330
2431 return flask.jsonify(result)
55
66 from server.dao.base import FaradayDAO
77 from server.models import Command, EntityMetadata
8 from server.utils.database import apply_search_filter
8 from server.utils.database import apply_search_filter, paginate
99
1010 class CommandDAO(FaradayDAO):
1111 MAPPED_ENTITY = Command
1212 COLUMNS_MAP = {
13 'couchid': [EntityMetadata.couchdb_id]
13 'couchid': [EntityMetadata.couchdb_id]
1414 }
1515 STRICT_FILTERING = ["couchid"]
1616
17 def list(self, search=None, command_filter={}):
18 results = self.__query_database(search, command_filter)
17 def list(self, search=None, page=0, page_size=0, command_filter={}):
18 results = self.__query_database(search, page, page_size, command_filter)
1919
2020 rows = [ self.__get_command_data(result.command) for result in results ]
2121
2525
2626 return result
2727
28 def __query_database(self, search=None, command_filter={}):
28 def __query_database(self, search=None, page=0, page_size=0, command_filter={}):
2929 command_bundle = Bundle('command',
3030 Command.itime,
3131 Command.ip,
4242
4343 # Apply filtering options to the query
4444 query = apply_search_filter(query, self.COLUMNS_MAP, None, command_filter, self.STRICT_FILTERING)
45
46 if page_size:
47 query = paginate(query, page, page_size)
4548
4649 results = query.all()
4750
2020 "vulns": ["vuln_count"],
2121 "os": [Host.os],
2222 "owned": [Host.owned],
23 "command_id":[EntityMetadata.command_id]
2324 }
24 STRICT_FILTERING = ["service", "couchid"]
25 STRICT_FILTERING = ["service", "couchid", "command_id"]
2526
2627 def list(self, search=None, page=0, page_size=0, order_by=None, order_dir=None, host_filter={}):
2728 results, count = self.__query_database(search, page, page_size, order_by, order_dir, host_filter)
1414 COLUMNS_MAP = {
1515 "interface": [Service.interface_id],
1616 "couchid": [EntityMetadata.couchdb_id],
17 "command_id": [EntityMetadata.command_id],
1718 'id': [Service.id],
1819 "name": [Service.name],
1920 "protocol": [Service.protocol],
4949 "interfaceid": [Interface.id],
5050 "web": [],
5151 "issuetracker": [],
52 "creator": [EntityMetadata.creator]
52 "creator": [EntityMetadata.creator],
53 "command_id": [EntityMetadata.command_id]
5354 }
5455
55 STRICT_FILTERING = ["type", "service", "couchid", "hostid", "serviceid", 'interfaceid', 'id', 'status']
56 STRICT_FILTERING = ["type", "service", "couchid", "hostid", "serviceid", 'interfaceid', 'id', 'status', 'command_id']
5657
5758 def list(self, search=None, page=0, page_size=0, order_by=None, order_dir=None, vuln_filter={}):
5859 results, count = self.__query_database(search, page, page_size, order_by, order_dir, vuln_filter)
88 from sqlalchemy.ext.declarative import declarative_base
99
1010
11 SCHEMA_VERSION = 'W.2.2.0'
11 SCHEMA_VERSION = 'W.2.3.1'
1212
1313 Base = declarative_base()
1414
11231123 padding:0 0 5px;
11241124 text-align:right;
11251125 border-bottom:1px solid rgba(255,255,255,.3)
1126 }
1127
1128 .capitalize {
1129 text-transform: capitalize;
1130 }
1131
1132 .small-size {
1133 font-size:10px;
11261134 }
138138 <script type="text/javascript" src="scripts/dashboard/controllers/vulnsBySeverityCtrl.js"></script>
139139 <script type="text/javascript" src="scripts/dashboard/controllers/vulnsPiechartCtrl.js"></script>
140140 <script type="text/javascript" src="scripts/dashboard/controllers/workspaceProgressCtrl.js"></script>
141 <script type="text/javascript" src="scripts/dashboard/controllers/activityFeedCtrl.js"></script>
141142 <script type="text/javascript" src="scripts/dashboard/providers/dashboard.js"></script>
142143 <script type="text/javascript" src="scripts/d3/providers/d3.js"></script>
143144 <script type="text/javascript" src="scripts/d3/directives/treemap.js"></script>
0 // Faraday Penetration Test IDE
1 // Copyright (C) 2016 Infobyte LLC (http://www.infobytesec.com/)
2 // See the file 'doc/LICENSE' for the license information
3
4 'use strict';
5
6 angular.module('faradayApp')
7 .controller('activityFeedCtrl',
8 ['$scope', '$routeParams', 'dashboardSrv',
9 function($scope, $routeParams, dashboardSrv) {
10
11 var vm = this;
12 vm.commands = [];
13
14 // Get a count of all hosts created by this command.
15 vm.getHostCount = function(command){
16 dashboardSrv.getHostsCountByCommandId($scope.workspace, command._id)
17 .then(function(hosts) {
18
19 if( !isNaN(hosts['total_rows']) )
20 command.hosts_count = hosts['total_rows'];
21 else
22 command.hosts_count = 0;
23 });
24 };
25
26 // Get a count of all services created by this command.
27 vm.getServiceCount = function(command){
28 dashboardSrv.getServicesByCommandId($scope.workspace, command._id)
29 .then(function(services) {
30 if( services.services.length != 0 )
31 command.services_count = services.services.length;
32 else
33 command.services_count = 0;
34 });
35 };
36
37 // Get a count of all vulns created by this command.
38 vm.getVulnsCount = function(command){
39 dashboardSrv.getVulnsByCommandId($scope.workspace, command._id)
40 .then(function(vulnerabilities) {
41
42 vm.checkCriticalIssue(vulnerabilities, command);
43
44 if(!isNaN(vulnerabilities.count))
45 command.vulnerabilities_count = vulnerabilities.count;
46 else
47 command.vulnerabilities_count = 0;
48 });
49 };
50
51 //Check if is a command or Import report.
52 vm.setCommandType = function(command){
53
54 if(command.command.indexOf('Import') >= 0)
55 command.command_type = 'import';
56 else
57 command.command_type = 'command';
58 };
59
60 vm.checkCriticalIssue = function(vulnerabilities, command){
61 command.criticalIssue = 0;
62
63 vulnerabilities.vulnerabilities.forEach(function(vuln){
64 if(vuln.value.severity == 'critical'){
65 command.criticalIssue += 1;
66 }
67 });
68 };
69
70 // Get last 5 commands
71 var init = function() {
72 if($routeParams.wsId != undefined) {
73 $scope.workspace = $routeParams.wsId;
74
75 dashboardSrv.getCommands($scope.workspace)
76 .then(function(commands) {
77
78 vm.commands = commands;
79 vm.commands.forEach(function(command){
80
81 vm.getHostCount(command);
82 vm.getServiceCount(command);
83 vm.getVulnsCount(command);
84 vm.setCommandType(command);
85 });
86 });
87 }
88 };
89
90 dashboardSrv.registerCallback(init);
91 init();
92 }]);
0 <article class='panel panel-default left-big-box' ng-controller="activityFeedCtrl as activityFeed">
1
2 <header>
3 <h2>Activity Feed
4 <span class="glyphicon glyphicon-info-sign" uib-tooltip="Faraday feed"></span>
5 </h2>
6 </header>
7
8 <div ng-if="activityFeed.commands.length == 0" class="alert alert-info alert-dismissible no-margin-bottom">
9 <button type="button" class="close" data-dismiss="alert">
10 <span aria-hidden="true">&times;</span>
11 <span class="sr-only">Close</span>
12 </button>
13 <p>No activities found yet.</p>
14 </div>
15
16 <table id="commands" ng-if="activityFeed.commands.length > 0" class="tablesorter table table-striped">
17 <tbody>
18 <tr ng-repeat="cmd in activityFeed.commands | orderBy : '-date' | limitTo:5">
19 <td align="left">
20 <span ng-if="cmd.command_type == 'import'" class="fa fa-upload"/>
21 <span ng-if="cmd.command_type == 'command'" class="fa fa-terminal"/>
22
23 <b class="capitalize">{{cmd.user || Anonymous}}</b> <span ng-if="cmd.command_type == 'command'" uib-tooltip="{{ cmd.command + ' ' + cmd.params}}">ran {{cmd.command}}</span>
24 <span ng-if="cmd.command_type == 'import'" uib-tooltip="{{ cmd.command + ' ' + cmd.params}}">{{cmd.command.replace('Import', 'imported').replace(':', '') || Unknown}}</span>
25 <span> and found</span>
26 <span ng-if="cmd.hosts_count == 0 && cmd.services_count == 0 && cmd.vulnerabilities_count == 0 "> nothing</span>
27 <span ng-if="cmd.hosts_count != 0 || cmd.services_count != 0 || cmd.vulnerabilities_count != 0 ">: </span>
28 <span ng-if="cmd.hosts_count > 0">{{cmd.hosts_count}} {{cmd.hosts_count == 1 ? 'host' : 'hosts'}}</span>
29 <span ng-if="cmd.hosts_count != 0 && cmd.services_count != 0 && cmd.vulnerabilities_count != 0">, </span>
30 <span ng-if="(cmd.hosts_count != 0 && cmd.services_count != 0 && cmd.vulnerabilities_count == 0) || (cmd.hosts_count != 0 && cmd.services_count == 0 && cmd.vulnerabilities_count != 0)"> & </span>
31 <span ng-if="cmd.services_count > 0">{{cmd.services_count}} {{cmd.services_count == 1 ? 'service' : 'services'}}</span>
32 <span ng-if="(cmd.hosts_count != 0 && cmd.services_count != 0 && cmd.vulnerabilities_count != 0) || (cmd.hosts_count == 0 && cmd.services_count != 0 && cmd.vulnerabilities_count != 0)"> & </span>
33 <span ng-if="cmd.vulnerabilities_count > 0"><a ng-click="navigate('/status/ws/' + cmd.workspace + '/search/command_id=' + cmd._id)"> {{cmd.vulnerabilities_count}} {{cmd.vulnerabilities_count == 1 ? 'vulnerability' : 'vulnerabilities'}}</a></span>
34 <span ng-if="cmd.criticalIssue > 0">- {{cmd.criticalIssue}} {{cmd.criticalIssue == 1 ? 'is' : 'are'}} rated as <b>Critical</b>.</span>
35 <span class ="small-size" am-time-ago="cmd.date"/>
36 </td>
37 </tr>
38 </tbody>
39 </table>
40 </article>
2222 <tbody>
2323 <tr ng-repeat="cmd in commands | orderObjectBy:cmdSortField:cmdSortReverse">
2424 <td><b><p uib-tooltip="{{cmd.ip}}">{{cmd.user}}@{{cmd.hostname}}</p></b></td>
25 <td class="wrapword">{{cmd.command}}</td>
26 <td><span am-time-ago="cmd.date"></span></td>
25 <td class="wrapword">{{cmd.command + ' ' + cmd.params}}</td>
26 <td am-time-ago="cmd.date"/>
2727 <td ng-bind="cmd.duration || 'undefined'"></td>
2828 </tr>
2929 </tbody>
3333 <div ng-include="'scripts/dashboard/partials/summarized.html'"></div>
3434 <div class="row">
3535 <div class="col-lg-6 col-lg-left">
36 <div ng-include="'scripts/dashboard/partials/activityFeed.html'"></div>
3637 <div ng-include="'scripts/dashboard/partials/last-vulns.html'"></div>
3738 <div ng-include="'scripts/dashboard/partials/compound.html'"></div>
3839 </div>
1313 <table ng-if="vulns.length > 0" class="tablesorter table table-striped last-vuln">
1414 <thead>
1515 <tr>
16 <th><a>Date</a></th>
16 <th><a>Severity</a></th>
1717 <th><a>Target</a></th>
18 <th><a>Severity</a></th>
1918 <th><a>Name</a></th>
2019 <th><a>Web</a></th>
20 <th><a>Date</a></th>
2121 </tr>
2222 </thead>
2323 <tbody>
2424 <tr ng-repeat="vuln in vulns">
25 <td><span am-time-ago="vuln.metadata.create_time * 1000"></span></td>
25 <td><a href="" ng-click="navigate('/status/ws/'+workspace+'/search/severity='+vuln.severity)"><span class="label vuln fondo-{{vuln.severity}}">{{vuln.severity | uppercase}}</span></a></td>
2626 <td>
2727 <a href="" ng-click="navigate('/status/ws/'+workspace+'/search/target='+vuln.target)">{{vuln.target}}</a>
2828 </td>
29 <td><a href="" ng-click="navigate('/status/ws/'+workspace+'/search/severity='+vuln.severity)"><span class="label vuln fondo-{{vuln.severity}}">{{vuln.severity | uppercase}}</span></a></td>
3029 <td class="wrapword"><a href="" ng-click="navigate('/status/ws/'+workspace+'/search/name='+vuln.name)">{{vuln.name}}</a></td>
3130 <td>
3231 <span class="glyphicon glyphicon-ok" ng-show="vuln.web"></span>
3332 <span class="glyphicon glyphicon-remove" ng-show="!vuln.web"></span>
3433 </td>
34 <td><span am-time-ago="vuln.metadata.create_time * 1000"></span></td>
3535 </tr>
3636 </tbody>
3737 </table>
104104 return deferred.promise;
105105 };
106106
107 dashboardSrv.getServicesByCommandId = function(ws, command_id) {
108 var deferred = $q.defer();
109 ServerAPI.getServices(ws, {"command_id": command_id})
110 .then(function(res) {
111 deferred.resolve(res.data);
112 }, function() {
113 deferred.reject("Unable to get Services");
114 });
115
116 return deferred.promise;
117 };
118
119
107120 dashboardSrv.getTopServices = function(ws, colors) {
108121 var deferred = $q.defer();
109122
124137 }
125138 }, function() {
126139 deferred.reject("Unable to get Top Services");
140 });
141
142 return deferred.promise;
143 };
144
145 dashboardSrv.getVulnsByCommandId = function(ws, command_id) {
146 var deferred = $q.defer();
147 ServerAPI.getVulns(ws, {"command_id": command_id})
148 .then(function(res) {
149 deferred.resolve(res.data);
150 }, function() {
151 deferred.reject("Unable to get Vulnerabilities");
127152 });
128153
129154 return deferred.promise;
218243 } else if(_cmd.duration != undefined) {
219244 _cmd.duration = _cmd.duration.toFixed(2) + "s";
220245 }
221 _cmd.date = _cmd.itime * 1000;
222 _cmd.command = _cmd.command + ' ' + _cmd.params;
246 _cmd.date = _cmd.itime * 1000;
223247 tmp.push(_cmd);
224248 });
225249
231255 return deferred.promise;
232256 };
233257
234 dashboardSrv.getHosts = function(ws) {
258 dashboardSrv.getHosts = function(ws) {
235259 var deferred = $q.defer();
236260 ServerAPI.getHosts(ws)
237261 .then(function(res) {
242266 tmp.push(_host);
243267 });
244268 deferred.resolve(tmp);
269 }, function() {
270 deferred.reject();
271 });
272 return deferred.promise;
273 };
274
275 dashboardSrv.getHostsCountByCommandId = function(ws, command_id) {
276
277 var deferred = $q.defer();
278
279 ServerAPI.getHosts(ws, {"command_id": command_id })
280 .then(function(res) {
281 deferred.resolve(res.data);
245282 }, function() {
246283 deferred.reject();
247284 });
2323 $scope.vulns;
2424 $scope.workspaces;
2525 $scope.currentPage;
26 $scope.newCurrentPage;
27 $scope.newPageSize;
2826 $scope.gridOptions;
2927
3028 $scope.vulnWebSelected;
832830 // Add the total amount of vulnerabilities as an option for pagination
833831 // if it is larger than our biggest page size
834832 if ($scope.gridOptions.totalItems > paginationOptions.defaultPageSizes[paginationOptions.defaultPageSizes.length - 1]) {
833
835834 $scope.gridOptions.paginationPageSizes = paginationOptions.defaultPageSizes.concat([$scope.gridOptions.totalItems]);
835
836836 // sadly, this will load the vuln list again because it fires a paginationChanged event
837 if ($scope.gridOptions.paginationPageSize != $scope.gridOptions.totalItems) $scope.gridOptions.paginationPageSize = $scope.gridOptions.totalItems;
837 if ($scope.gridOptions.paginationPageSize > $scope.gridOptions.totalItems)
838 $scope.gridOptions.paginationPageSize = $scope.gridOptions.totalItems;
839
840 // New vuln and MAX items per page setted => reload page size.
841 if ($scope.gridOptions.paginationPageSize === $scope.gridOptions.totalItems - 1)
842 $scope.gridOptions.paginationPageSize = $scope.gridOptions.totalItems;
843
838844 }
839845 });
840846 };